skip to content

Why does SPF fail for mail forwarded through an alias, such as an alumni address, when the original sender's record is correct?

level: middleimportance: must knowfreq 45%

answer

  1. which IP does the receiver see?
  2. SPF is judged one hop at a time
  3. the alias keeps the envelope sender
  4. forwarder not in the sender's record

basics

~20 s

SPF checks the IP of the server that connected last. A plain forwarder resends from its own IP but keeps the original MAIL FROM, so the receiver checks the sender's record, which never listed the forwarder.

solid answer

~50 s

SPF is evaluated hop by hop: the receiver takes the IP address of the client connected to it and the domain in `MAIL FROM`, and asks whether that domain authorizes that IP. When `[email protected]` writes to an alumni address that forwards to a personal mailbox, the second hop comes from the forwarder's IP, but a plain alias keeps `MAIL FROM:<[email protected]>`. The final mailbox therefore checks example.com's record against an address example.com never listed, and gets `fail` if the record ends `-all` or `softfail` if it ends `~all`. Nothing is wrong in anyone's DNS; the forwarder simply sits outside the sender's authorized infrastructure. The fixes all move the check: the forwarder rewrites the envelope sender into its own domain, the receiver exempts forwarders it trusts, or the receiver leans on another identity that survived the hop.

go deeper

for a junior

Recall the core fact: SPF checks the IP of whichever server connects, and a forwarder connects from its own address while keeping the original envelope sender.

for a middle

Walk through both hops with the client IP and MAIL FROM domain at each, and say why the result is fail or softfail depending on the sender's record.

for a senior

Name the mitigations by who applies them, explain why checking against Received fields is unreliable, and note that secondary MX hosts must do the SPF check themselves.

for a principal

Weigh who should carry the cost of forwarding: senders weakening records, forwarders rewriting envelopes, or receivers maintaining trusted-forwarder lists, and what each choice does to protection.

## SPF is a per-hop check An SPF check (RFC 7208, April 2014) answers one narrow question: **is the host that is connected to me right now allowed to use this envelope domain?** The inputs are the IP address of the SMTP client in the current session, the domain in `MAIL FROM` (or in `HELO`/`EHLO`), and the domain's `v=spf1` record. RFC 7208 places the check during the receiving transaction, at the time of the `MAIL` command (section 2.5), at the boundary MTAs of the receiving domain (Appendix F). Section 10.3 states the consequence directly: because evaluation is based on the IP address of the "last" sending SMTP server, a mediator's address is used, not the address of the server that sent the message to the mediator. If the mediator keeps the original envelope address, the SPF evaluation fails unless one of the mitigations in Appendix D is used. ## Walking through the alumni alias A university runs forwarding addresses for its alumni under `alumni.example.org`. One alumna's address forwards to her personal mailbox at `example.net`. 1. `[email protected]` sends from `192.0.2.10` to `[email protected]`. The university's MX checks example.com's record; `192.0.2.10` is listed, so the result is `pass`. 2. The alias expands to `[email protected]`. The university's outbound server at `203.0.113.25` opens a **new SMTP session** to example.net's MX and, as a plain alias does, sends `MAIL FROM:<[email protected]>` unchanged. 3. example.net checks example.com's record against `203.0.113.25`. That address is not listed, so the result is `fail` under `-all`, or `softfail` under `~all`. 4. If example.net's policy rejects SPF `fail`, the refusal lands on the university's server, which is now holding a message it cannot deliver. What happens to that bounce is covered with bounces and delivery status notifications. | Hop | Client IP seen | `MAIL FROM` domain | Record consulted | Result | |---|---|---|---|---| | Sender to university | `192.0.2.10` | example.com | example.com | `pass` | | University to personal mailbox | `203.0.113.25` | example.com | example.com | `fail` or `softfail` | Both results are correct. RFC 7208 section 10.2 lists exactly this case, legitimate mail that has traversed a mail alias, as a known way for SPF to return `fail` for good mail. ## What changes the outcome: Appendix D's three places RFC 7208 Appendix D groups the mitigations by who applies them. **At the originating domain** - Return `neutral` rather than `fail` for addresses that might be forwarders, based on a list someone else maintains. This hands part of the sender's policy to the list's maintainer and weakens the record for everyone. **At the forwarder (the mediator)** - Rewrite `MAIL FROM` into the forwarder's own domain, so the next hop checks the forwarder's record. Mail rejected later must then be routed back to the original sender by the forwarder. The Sender Rewriting Scheme is the widely described way to do this. - Switch the alias from alias semantics to mailing-list semantics with an additional `owner-` alias, so the MTA resends with a new, local envelope sender as a mailing list does. Postfix's `owner_request_special` (default `yes`) enables that special treatment of `owner-` entries in its aliases file. - Refuse the forward with `551 User not local`, naming the address the sender should use instead. **At the receiving domain** - Skip SPF tests when the client host belongs to a forwarder the mailbox owner trusts. - Let a test against another identity, such as the `HELO` identity, override a failed `MAIL FROM` test. - For large domains, allow forwarding services that are generally recognised. ## Related cases worth knowing - **Secondary MX hosts.** RFC 7208 Appendix F says the check belongs at the boundary MTAs, including all secondary MXs; checking further in means guessing the original client from header fields that can be forged. RFC 7960 adds that a primary should not SPF-check its own external secondaries; the secondary should check and pass the results on by a trusted mechanism. - **Header-based re-checks are unreliable.** Re-running SPF against an address dug out of a `Received` field fails for the same reason: those fields can be forged or malformed, and there is no standard way to find the true boundary host. - **DKIM usually survives a plain alias.** RFC 7960 notes that an alias that preserves content may leave DKIM signatures valid while carrying the message outside the sender's SPF record. Why that matters for a DMARC verdict is covered with DMARC alignment and rollout. ## What the person running the forwarder checks - The final receiver's recorded SPF result names the client IP and the domain it checked; seeing the forwarder's address paired with the original sender's domain is the signature of this failure. - The failure rate follows the senders' records: domains ending `-all` produce `fail` and those ending `~all` produce `softfail`, so complaints cluster around the strictest senders. - Changing the forwarder's own SPF record cannot help a plain alias, because the receiver never consults it while `MAIL FROM` still names the original domain.

  • Would switching the sending domain from -all to ~all make forwarded mail pass SPF?
    No. The forwarder's IP is still absent from the record, so the result changes from `fail` to `softfail`, not to `pass`. What changes is the receiver's likely handling: RFC 7208 says a receiver SHOULD NOT reject on `softfail` alone, so fewer forwarded messages are refused outright, but the check still does not pass.
  • Why can't the final receiver simply check SPF against the first sender's IP from the Received header fields?
    RFC 7208 Appendix F warns that testing anywhere but the boundary is unreliable: header fields can be forged or malformed, and there is no standard way to find which host first handed the message to the receiving domain. A receiver that trusts a particular forwarder can instead exempt that forwarder's hosts from SPF, which Appendix D lists as a receiving-side option.
  • Does a mailing list break SPF the same way as an alias?
    It depends on the envelope sender it uses. RFC 7208 section 10.3 notes that some mediators keep the original address and some use a new one. A list that sends with its own envelope address, such as a bounce-handling address in its domain, is checked against its own record and can pass; an alias that keeps the original address fails.

A building's front desk checks the courier at the door against the list of couriers the sending company has published. If the recipient has moved and the parcel is re-sent by a forwarding service, a different courier arrives, one the sender never listed, so the desk turns it away although nothing is wrong. Putting the forwarding service's own return label on the parcel, with a coded reference to the original sender, makes the desk check the forwarder's list instead, and returns still find their way back.

  • Forwarding fails SPF because the forwarder modifies the message body.
  • The final receiver checks the IP in the first Received header field.
  • The original sender's SPF record must be misconfigured.
  • Adding the forwarder's IP to its own SPF record fixes plain forwarding.
  • Switching the sender from -all to ~all makes forwarded mail pass SPF.