episciences
episciences copied to clipboard
More intelligent handling of bounces
Is your feature request related to a problem? Please describe. Since #215 was handled, notifications of failed delivery can be sent to a central email address. Right now, at LMCS, we handle these bounce messages manually, by figuring out who was responsible for the message and contacting them. This adds quite some overhead that would be good to offload.
Describe the solution you'd like Ideally, the person who generated the message that was not delivered should be notified of this happening.
Having the receiving server deliver the bounce to the sender is not directly feasible, as that would mean sending mail with an envelope sender with a different domain, likely violating the SPF policy currently in place. However, this can be bypassed by implementing the Sender Rewriting Scheme (SRS). In a nutshell, SRS lets you set an encoded envelope-sender. When a bounce is sent to this address, the sending server verifies the encoding (which includes a hash for security) and passes the message on to the original address.
Describe alternatives you've considered A different option could be to set a static envelope sender and try to parse the messages being sent there. Note that the bounce includes the reply-to email address of the sender, so a cross-reference with the database may not be necessary. For added security, the DKIM signature on the original message could also be verified first. This would be workable, but perhaps more prone to errors (and mimic functionality already present in implementations of SRS that are already available).