Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration #12

Open
Fred2VOX opened this issue Aug 7, 2020 · 4 comments
Open

Configuration #12

Fred2VOX opened this issue Aug 7, 2020 · 4 comments

Comments

@Fred2VOX
Copy link

Fred2VOX commented Aug 7, 2020

Hi,
In first, thanks for this great work.

I followed the deployment instructions and get a running server. But, I encounter some issues during invocation thru swaks. So, my main question is:

  • I understood I've to configure a file named config.js and put into the configuration directory. I think I'm wrong, right?
  • If I'm wrong, I've to configure the files ended by toml and located into the directory config?

Another question:

  • Are some restrictions / contraints potentially blocking the usage of AWS DynamoDb thru the compatibility with Mongodb 3.6 ?

Thanks in advance for the answers

Fred

@andris9
Copy link
Member

andris9 commented Aug 9, 2020

  1. When using this repo then edit config files in this folder. These values are merged with the default config, so if some key is missing then default is used.
  2. AWS DynamoDb is not tested so it may or may not work.

@Fred2VOX
Copy link
Author

Fred2VOX commented Aug 9, 2020

@andris9
Thanks for the answer.

Could you clarify the configuration of DKIM feature, please? I don't find a way in the TOML file to specify the domain, the selector, or the place where to read the corresponding private certificate.

Thanks in advance

Fred

@andris9
Copy link
Member

andris9 commented Aug 9, 2020

ZoneMTA is more like a framework than a final MTA application. So the DKIM plugin is just an example and does not do much. You are supposed to write your own dkim plugin and load keys from whatever storage you use, either from file system or database or wherever.

Minimal DKIM plugin would look like this:

'use strict';

module.exports.title = 'DKIM signer';
module.exports.init = function (app, done) {
  // this hook is triggered when a connection is established to MX
  app.addHook('sender:connection', (delivery, options, next) => {

    // 1. resolve domain name to be used for signing
    let from = delivery.envelope.from || '';
    let fromDomain = from.substr(from.lastIndexOf('@') + 1).toLowerCase();

    // 2. load the key data from somewhere for `fromDomain`

    // 3. add key to DKIM handler assuming that `fromDomain` is "example.com" and dkim selector is "test"
    delivery.dkim.keys.push({
      domainName: 'example.com',
      keySelector: 'test',
      privateKey: '---- BEGIN RSA PRIVATE KEY...',
    });

     next();
  });
  done();
};

@andris9
Copy link
Member

andris9 commented Aug 9, 2020

If you want to use header From: address domain for signing then use delivery.parsedEnvelope.from instead of delivery.envelope.from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants