Sub topic 3
How receivers decide a message is really from you
This chapter gives you the working model behind every later chapter. It explains which identities a message carries, which checks a receiving server runs, and how those checks combine into a decision. It assumes you can read raw email headers, edit DNS TXT records, and know the basics of SMTP. SPF, DKIM, alignment, and DMARC each get their own chapter, so this one only shows how they fit together.
The problem: SMTP trusts what the sender says
SMTP was designed without sender verification. Any server can connect to a receiver and claim to be any domain. Spammers and phishers use this to forge the address people see in their mail client. Authentication standards were added afterward to let a domain owner publish rules in DNS and let receivers check messages against them.
The bulk sender rules from Gmail, Yahoo, and Microsoft depend on these checks. A receiver can only apply a domain's reputation or a domain's DMARC policy if it first knows the message really came from that domain.
A message carries several identities
A single message has more than one "from". Authentication works because each check looks at a different identity, and a later step compares them.
| Identity | Where it appears | Also called | Checked by |
|---|---|---|---|
| Connecting IP address | The TCP connection | Client IP | SPF, reverse DNS |
| HELO/EHLO name | The SMTP greeting | HELO domain | SPF (fallback), reverse DNS match |
| Envelope sender | The SMTP `MAIL FROM` command | Return-Path, bounce address, `smtp.mailfrom` | SPF |
| Signing domain | The `d=` tag in the DKIM-Signature header | DKIM domain, `header.d` | DKIM |
| Visible From domain | The `From:` header | RFC5322.From, `header.from` | DMARC (alignment) |
The visible From domain is the only one most recipients ever see. It is also the only one a forger fully controls without any technical barrier. That is why DMARC anchors on it.
The envelope sender is often a different domain from the From domain. Marketing platforms commonly use a bounce subdomain so they can process returned mail. You will see this in the sample header at the end of this chapter, where the SPF domain is bounce.example.com and the From domain is example.com.
The three building blocks
Receivers run three kinds of checks. Two of them verify a technical identity, and the third connects those results to the From domain.
- SPF checks whether the connecting IP address is authorized to send for the envelope sender's domain (or the HELO name when the envelope sender is empty). The domain owner publishes the authorized servers in a TXT record.
- DKIM checks a cryptographic signature added by the sending system. The signature names a domain (
d=) and a selector (s=). The receiver fetches the public key from DNS atselector._domainkey.domainand verifies that the signed headers and body were not altered. - DMARC reads the policy published at
_dmarc.<From domain>. It passes a message only if SPF or DKIM passed and the passing domain aligns with the visible From domain.
SPF and DKIM each answer a narrow question: "is this server allowed to use that bounce domain?" and "did the holder of that domain's key sign this content?" Neither one, alone, says anything about the From domain a person sees. DMARC closes that gap.
How the checks combine
The receiving server runs the checks during or just after the SMTP transaction and records the results. The following diagram shows the order and what each result feeds into.
Two points about this flow matter in practice.
First, DMARC needs only one aligned pass. If DKIM passes and aligns, SPF can fail or use a different domain and DMARC still passes. The sample header at the end of this chapter shows exactly that case.
Second, passing authentication does not mean delivery to the inbox. It only establishes who sent the message. Reputation, complaint rates, and content then decide placement, which later chapters cover.
What the receiver writes down: Authentication-Results
The receiving server records its verdicts in an Authentication-Results header (defined in RFC 8601). This is the first place to look when you diagnose a problem. Gmail also shows these results under "Show original", and Yahoo and Microsoft add similar headers to delivered mail.
Each result is a method name, a verdict, and the identity that was tested:
spf=pass smtp.mailfrom=bounce.example.commeans SPF passed for that envelope domain.dkim=pass header.d=example.com header.s=mail1means a signature fromexample.comwith selectormail1verified.dmarc=pass (p=NONE) header.from=example.commeans DMARC passed for that From domain, and the published policy wasnone.
Common verdicts you will meet are pass, fail, softfail, neutral, none (nothing published), temperror (a temporary DNS problem), and permerror (a broken record).
Read the identity next to each verdict, not only the verdict. A spf=pass for a domain that is not your From domain proves little for DMARC.
Sending infrastructure also gets checked
Besides the three message-level checks, receivers look at the connection itself. The chapter on sending infrastructure covers these in depth. In brief:
- Reverse DNS (PTR). The sending IP should have a PTR record, and the name it returns should resolve back to the same IP. Receivers treat a missing or mismatched record as a sign of a poorly run or compromised host.
- TLS. Large providers expect mail to be sent over an encrypted connection.
- Message format. Headers must follow the internet message standard, for example a valid
From:andDate:.
These checks do not tie the message to your domain, but a failure on any of them can hurt delivery on its own.
Common errors at this stage
These mistakes come from mixing up the identities in the table above.
- Assuming SPF protects the visible From address. SPF tests the envelope sender, not the
From:header. A message can pass SPF for a platform's bounce domain while the From domain is yours. - Assuming a DKIM pass means "my domain signed it". A DKIM signature can be valid for any domain. If the platform signs with its own domain (
d=esp.example.net), DKIM passes but does not align with your From domain. - Testing only one record. SPF, DKIM, and DMARC are separate DNS lookups. One can be correct while another is missing.
- Reading a pass as proof of inbox placement. Authentication results say who sent the message, and they say nothing about whether the receiver wants it.
- Ignoring
temperror. A DNS timeout can make a correct setup fail intermittently. Check that your DNS provider is reliable and your records are not oversized.
Reading a real result
Here is a sample header from a message that authenticates through DKIM alone.
Authentication-Results: mx.example.net;
spf=pass smtp.mailfrom=bounce.example.com;
dkim=pass header.d=example.com header.s=mail1;
dmarc=pass (p=NONE) header.from=example.comWork through it in order:
- SPF passed, but for
bounce.example.com. That differs from the From domainexample.com, so SPF does not give DMARC an aligned pass here. (Whether it counts depends on the alignment mode, which a later chapter explains.) - DKIM passed with
header.d=example.com. That matches the From domain exactly. - DMARC therefore passes through DKIM, and the receiver applied no enforcement because the policy is
none.
If you want to check the DNS side yourself, these commands look up the records a receiver would fetch.
dig +short TXT example.com
dig +short TXT mail1._domainkey.example.com
dig +short TXT _dmarc.example.com
dig +short -x 203.0.113.25The first three return the SPF, DKIM key, and DMARC policy. The last returns the PTR name for the sending IP.
Exercise
A marketing platform sends your newsletter with From: [email protected]. The Authentication-Results header shows spf=pass smtp.mailfrom=mailer.platform.example, dkim=pass header.d=platform.example, and dmarc=fail header.from=example.com. Which identity is responsible for the DMARC failure, and what would you ask the platform to change?
Show answer
Neither SPF nor DKIM is aligned with the From domain. SPF passed for mailer.platform.example and DKIM passed for platform.example, but the From domain is example.com, so DMARC has no aligned pass. Ask the platform to sign with your own domain by publishing a DKIM key under a selector at example.com (for example mail1._domainkey.example.com) and signing with d=example.com. Optionally, set up a custom bounce domain under example.com so SPF aligns as well.