Open Fred2VOX opened 4 years ago
@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
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();
};
If you want to use header From: address domain for signing then use delivery.parsedEnvelope.from
instead of delivery.envelope.from
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:
Another question:
Thanks in advance for the answers
Fred