zone-eu / zone-mta

📤 Modern outbound MTA cross platform and extendable server application
European Union Public License 1.2
599 stars 96 forks source link

zone-based DKIM signing policies #302

Closed DeadlyBug closed 2 years ago

DeadlyBug commented 2 years ago

Hello A ZoneMTA instance is currently signing all outgoing emails using instructions from https://github.com/zone-eu/zone-mta/wiki/Handling-DKIM-keys (although using .toml configuration format). A specific zone need to delegate DKIM signing to next hop, which is not possible through the current setup as ZoneMTA signs all emails. Is it possible to manage this use case through Zone configuration parameters? Email going through default zone would be signed, emails going through "delegated" zone would pass through ZoneMTA without being DKIM signed.

louis-lau commented 2 years ago

This is the plugin that handles the dkim key in your config: https://github.com/zone-eu/zone-mta/blob/master/plugins/core/dkim.js

I think you could easily create a copy of this plugin and add a check for the zone.

DeadlyBug commented 2 years ago

Hey thanks for the suggestions. Since I am using zone-mta-template the code is actually in https://github.com/zone-eu/zone-mta-template/blob/master/plugins/example-dkim.js

For the moment a quick & dirty hack will do, if someone has the same need here it is: diff.txt

louis-lau commented 2 years ago

Doesn't seem quick and dirty to me. ZoneMTA is meant as an MTA framework to be customized by you. This is exactly how plugins are intended.