SRS stands for Sender Rewriting Scheme and is a technique allowing users to forward emails received for one domain to a different domain. This page discusses SRS, when you want to turn it on, and how to do it.
The sender's email address appears in two locations when emails are exchanged between two SMTP servers:
Refer to this document for details about the differences between these values.
To avoid sender forgeries, spam filters, and email servers use technologies like SPF and DKIM. SPF relies on the value of F1, while DKIM's signature is based on F2. When SRS is enabled, the sending SMTP server changes the value of F1 before the message is sent to the next hop.
Consider the following scenario:
When SRS is enabled, the MAIL FROM value in the envelope (F1) is modified to contain a domain authorized to send emails from the assigned IP.
Refer to the before and after examples below.
EHLO mail-ed1-f54.google.com MAIL FROM: <someone@gmail.com> RCPT TO: <userA@mydomain.com>
EHLO mail-ed1-f54.google.com
MAIL FROM: <SRS=12345=67890=gmail.com=someone@gateway.mydomain.com>
RCPT TO: <userA@mydomain.com>
Notice the sender's email address is changed from someone@gmail.com
to SRS=12345=67890=gmail.com=someone@gateway.mydomain.com
,
which belongs to a domain other than gmail.com. When S1 receives this message, it will perform an SPF lookup
against gateway.mydomain.com rather than gmail.com, which will pass.
The actual composition of the email address (SRS=12345=67890=gmail.com=someone@gateway.mydomain.com) is beyond the scope of this article. However, if you are interested, you can refer to this page.
Enabling SRS is a three-step process:
SRS is not enabled for the default profile and cannot be done using the web GUI, which is designed to prevent accidental SRS enabling. If you need to enable SRS on the default profile, add the following line in server.properties file.
enable.srs.for.default.profile=true