hmailserver / hmailserver

927 stars 301 forks source link

Implement Sender Rewrite Scheme (SRS) #262

Open RvdHout opened 6 years ago

RvdHout commented 6 years ago

Implement Sender Rewriting Scheme (SRS) to Resolve Forwarding Issues Forwarding in SMTP is fundamentally flawed unless you implement SRS.

http://www.openspf.org/SRS

If you maintain the Return-Path of the originating message while forwarding you effectively spoof the originating domain.

If you modify the Return-Path to be the address of the account that forwarded a message you break the Return-Path chain and delivery issues will result in the forwarded message Delivery Status Notification (DSN) being delivered to the forwarding user and not the original sender.

SRS resolves this by modifying the Return-Path in a way that doesn't spoof the originating domain but still allows DSNs to be sent to the original sender.

The Sender Rewrite Scheme (SRS) is becoming more popular and used, even Microsoft, Exchange Online and Office365 are supporting it as of now, eg: https://blogs.technet.microsoft.com/exchange/2018/06/15/sender-rewriting-scheme-srs-coming-to-office-365/

Hmailserver workarround, eg: RewriteEnvelopeFromWhenForwarding=1 is not to be used, according gmail:

We recommend that you do not change the envelope sender when forwarding email to Gmail. Sometimes, when forwarding email, the envelope sender gets changed to your domain. When this happens, Gmail may learn that your domain is sending spam, and will treat other emails from this domain as spam as well.

https://support.google.com/mail/answer/175365?hl=en

More resources: https://www.libsrs2.org/ https://www.unlocktheinbox.com/resources/srs/ https://blog.mythic-beasts.com/2017/10/30/sender-rewriting-scheme/

RvdHout commented 6 years ago

Maybe make it optional, as a account property as SRS rewriting is usually not required when the sender and forwarding domains are the same, something like...

Sender Rewrite Scheme (SRS)