<rewrite-list>
A line of two domains: a pattern and a replacement. It changes the domain in the From header — the only one of the two addresses the recipient sees in their mail program.
On the left is a domain pattern, on the right a specific name. from-domain *.port25.com bouncedomain.com turns foo@mail.port25.com into foo@bouncedomain.com: the local part is kept, the domain is replaced entirely.
This line does not touch the local part at all — unlike mail-from, where the whole address is rewritten.
On the left a domain pattern, on the right a specific name. What will have to be done along with the replacement:
| What | Why |
|---|---|
| a signing key for the new domain | otherwise DKIM is signed with the wrong domain, and DMARC will not align |
| an SPF record for the new domain | if the envelope is rewritten to it too |
| a DMARC record for the new domain | the policy is read by the domain in From |
The rule is simple: the domain the recipient sees must be a domain you are responsible for in DNS. Otherwise the replacement turns your own message into someone else’s.
# the recipient will see a different domain — with all the consequences for DMARC <rewrite-list foo> from-domain *.port25.com bouncedomain.com</rewrite-list>
what people get wrong and how it ends2 mistakes▶
our experience
§ 3.3.18.2
2 relations
dig TXT _dmarc.bouncedomain.com +short
3 articles
◇Do not send what will fail the check at the receiverThe node checks the SPF of its own mail before sending: if it fails, it bounces the message without waiting for someone else’s refusal.◇How the node signs messages and chooses a keyThe key is chosen by the sending domain from the headers, going through the declarations from top to bottom.◇A message header with which the submitting side adjusts the signatureFive parameters in X-DKIM-Options: selector, domain, signing identity, query method and key list.