foxcpp / maddy

✉️ Composable all-in-one mail server.
https://maddy.email
GNU General Public License v3.0
5.1k stars 246 forks source link

SMTP DSN extension support #329

Open foxcpp opened 3 years ago

foxcpp commented 3 years ago

Depends on https://github.com/emersion/go-smtp/issues/32. Related: #326.

foxcpp commented 3 years ago

Design considerations:

target.queue module is able to correctly generate only NOTIFY=DELAY and NOTIFY=FAILURE notifications.

Other target.* modules are responsible for generating NOTIFY=SUCCESS notifications. This includes target.imapsql, target.smtp and target.remote. Last two may also generate Action: relayed notifications if target server does not support DSN extension.

Since all these modules will need to have a configured SMTP pipeline for DSN messages, dsn directive is added for each. To simplify configuration, global directive is also added so all targets will use the same DSN pipeline by default.

To prevent abuse, DSN extension is offered only to Submission and LMTP endpoints by default. It is possible to enable it for public SMTP as well, but it is not recommended as NOTIFY=SUCCESS can be used to generate "backscatter spam".