Home / Blog / Security and compliance
SPF, Forwarding & SRS: The Invisible Mechanics Behind Email Delivery
A forwarded message can keep the same visible From address and still fail SPF. Follow the envelope sender through the forwarding hop to see which domain the receiving server checks.
Every email has two "from" addresses, most people don't know this:
The visible From header, what you see in your inbox. From: alice@contoso.com. This is what the reader sees.
The envelope MAIL FROM (also called the Return-Path), this is the invisible technical address used by mail servers for bounce messages and SPF checks. Think of it like the return address printed on the back of a physical envelope, the recipient never looks at it, but the postal system uses it to send undeliverable mail back.
SPF checks the envelope MAIL FROM, not the visible From header.
Why forwarding breaks SPF, the real-world scenario
Scenario: alice@maxwellgroup.com configures her mailbox in Exchange Online to auto-forward all emails to her personal Gmail alice.personal@gmail.com.
Without SRS, the flow is:
- Someone external, say vendor@supplier.com, sends an email to alice@maxwellgroup.com
- Exchange Online receives it and forwards it to alice.personal@gmail.com
- Here's the problem: Exchange Online keeps the original envelope MAIL FROM as vendor@supplier.com when it forwards the message
- Gmail receives the message and runs an SPF check: "Is this Microsoft 365 IP address authorised to send mail on behalf of supplier.com?"
- It checks supplier.com's SPF record, which lists supplier.com's own mail servers, not Microsoft's forwarding IPs
- SPF FAIL — Gmail marks it as spam or rejects it entirely
The email never did anything wrong. It was a legitimate message from a real vendor. But because it was forwarded, the sending IP no longer matches the envelope domain's SPF record.
What SRS does, the fix
SRS (Sender Rewriting Scheme) is Microsoft's automatic solution to this problem. When Exchange Online forwards an email outbound, it rewrites the envelope MAIL FROM before sending.
The rewritten address looks like this:
SRS0=HASH=TT=originaldomain.com=originaluser@tenant.onmicrosoft.com
Breaking that down with a real example — vendor@supplier.com forwarded through maxwellgroup's tenant:
SRS0=mX9k=A3=supplier.com=vendor@maxwellgroup.onmicrosoft.com
Now when Gmail checks SPF, it asks: "Is this Microsoft 365 IP authorised to send for maxwellgroup.onmicrosoft.com?", and the answer is yes, because Microsoft's SPF record covers all their outbound IPs for onmicrosoft.com.
SPF passes. Email is delivered cleanly.
The bounce handling genius
SRS also solves a second problem: what happens when a forwarded email bounces?
Without SRS, if the forwarded email to alice.personal@gmail.com fails delivery, the bounce (NDR) would go back to vendor@supplier.com, the original sender. That vendor gets a confusing bounce for an email they thought delivered successfully to Maxwell Group. They have no idea why.
With SRS, the bounce goes to SRS0=mX9k=A3=supplier.com=vendor@maxwellgroup.onmicrosoft.com. Microsoft's servers receive that NDR, decode the SRS hash, extract the original sender address vendor@supplier.com, and route the bounce back to them correctly. The vendor gets a meaningful NDR explaining the delivery failure to the forwarding destination.
When does Exchange Online apply SRS?
Microsoft 365 applies SRS automatically in these scenarios:
Auto-forwarding via mailbox rules or forwarding settings, when a mailbox in Exchange Online forwards to an external address, SRS is applied to outbound forwarded mail.
Hybrid routing depends on the message path. An on-premises message forwarded externally through Exchange Online can qualify for SRS. Ordinary outbound messages originating on-premises do not all receive this rewrite.
Transport rules with redirect action, if a transport rule redirects a message to an external address, SRS applies.
SRS does not apply to regular outbound email that a user directly sends, it is only for forwarded or redirected messages where the envelope sender would otherwise mismatch the sending IP.
Important distinction — SRS vs From header
This trips people up in interviews. SRS only rewrites the invisible envelope MAIL FROM. The visible From: header that bob sees in his inbox still shows alice@contoso.com, completely unchanged. Bob has no idea SRS happened. The email looks exactly as if alice sent it directly.
This is intentional, the purpose of SRS is purely technical SPF compliance, not changing the apparent sender identity.