✳ Field lesson E1a / 8 min

Email authentication: what SPF, DKIM, and DMARC prove (and what they do not)

Email authentication validates domain provenance, not message safety: SPF checks whether the sending server IP is authorized for the envelope return-path domain, DKIM verifies a cryptographic signature over message headers and body, and DMARC requires the visible From domain to align with a passing SPF or DKIM check.

Helpful first: Networks in one request: DNS, TCP, TLS, and HTTP

Key points

  • SPF checks a host against a DNS policy. DKIM checks signed bytes with a public key. DMARC checks alignment of the Author Domain. No check proves that the mail is safe. No check proves that a person wrote the message.
  • Distinguish the envelope RFC5321.MailFrom (bounce domain), the DKIM-Signature d= domain, and the human-visible RFC5322.From header domain
  • Explain why an attacker’s lookalike domain or a compromised partner mailbox can achieve a full DMARC pass while still delivering a phishing lure

One email message carries three different domain names

Why is email spoofing possible in the first place? Because base SMTP (RFC 5321) was designed in an era without built-in cryptographic identity. Every email message actually carries multiple domain identifiers that do not have to match by default: the SMTP envelope MAIL FROM (the bounce or return-path address used by mail servers), the visible From: header (RFC 5322, what the human recipient sees in their inbox UI), and, when signed, the DKIM signing domain (d=).

One email message carries three different domain names

SPF, DKIM, and DMARC close that gap by binding DNS policy and public-key cryptography to those three identifiers.

Without email authentication, anyone on the internet can connect to a mail gateway, announce MAIL FROM:<bounce@other.example>, and put From: sloane.sterling@chronos.orbital in the message headers. SPF, DKIM, and DMARC close that gap by binding DNS policy and public-key cryptography to those three identifiers.

Comparing SPF, DKIM, and DMARC mechanics, identifiers, and limits
ProtocolIdentifier CheckedMechanism in DNSWhat a Pass ProvesWhat a Pass Does NOT Prove
SPF (RFC 7208)SMTP Envelope MAIL FROM (and HELO)TXT record listing authorized sending IPv4/IPv6 ranges and include: mechanismsThe connecting mail server IP is authorized to send on behalf of the MAIL FROM domainDoes not protect the visible From: header; breaks when mail is auto-forwarded
DKIM (RFC 6376)DKIM-Signature header d= domain and s= selectorTXT record at <selector>._domainkey.<d> publishing the RSA/Ed25519 public keyThe signed headers and body hashes were signed by the holder of <d>’s private key and were not altered in transitDoes not prove <d> matches the visible From: header unless DMARC checks alignment
DMARC (RFC 7489 / 9989)Visible From: header (RFC5322.From)TXT record at _dmarc.<domain> specifying alignment (adkim, aspf), policy (p=none|quarantine|reject), and rua reportingAt least one of SPF or DKIM passed AND its domain aligns with the visible From: domainDoes not prove the sender is honest, cannot block lookalike domains, and cannot stop a compromised real mailbox

SPF authorizes a host to use the MAIL FROM domain

When a receiving mail gateway accepts an SMTP connection from IP 198.51.100.25 claiming MAIL FROM:<alerts@chronos.orbital>, the receiver runs Sender Policy Framework (SPF). It queries DNS for the TXT record on chronos.orbital (for example, v=spf1 ip4:198.51.100.0/24 -all) and checks whether 198.51.100.25 is on the authorized list.

If the IP matches, SPF returns pass. If the host at 203.0.113.7 connects instead, its IP is not in 198.51.100.0/24, so -all makes SPF return fail. However, notice the blind spot: SPF checks the hidden envelope MAIL FROM domain, not the visible From: header displayed to the user. By itself, an attacker could pass SPF for MAIL FROM:<bounce@attacker.example> while still displaying From: ceo@chronos.orbital in the inbox.

DKIM ties a signature to bytes

DomainKeys Identified Mail (DKIM) attaches a cryptographic digital signature in the DKIM-Signature header. The sending server hashes the message body and selected headers (From, Subject, Date) and signs that hash with its private key, naming the signing domain (d=chronos.orbital) and selector (s=orb2026).

The receiving mail server queries DNS for orb2026._domainkey.chronos.orbital, retrieves the public key, and verifies the signature. If a relay changes the signed body, the computed body hash does not match bh=, and DKIM fails. Unlike SPF, DKIM survives normal email forwarding as long as intermediate relays do not modify the signed headers or body bytes.

DMARC alignment, and a pass is not safe

Domain-based Message Authentication, Reporting, and Conformance (DMARC) ties SPF and DKIM to the human-visible From: header through Identifier Alignment. For DMARC to pass, the message must achieve an aligned SPF pass (where MAIL FROM matches the visible From: domain) OR an aligned DKIM pass (where the DKIM d= domain matches the visible From: domain), under either strict (exact FQDNs match) or relaxed (organizational domains match) alignment. For example, DKIM d=mail.chronos.orbital is in relaxed alignment with From: ceo@chronos.orbital because both have the organizational domain chronos.orbital.

The domain owner publishes a DMARC policy as a DNS TXT record at _dmarc.chronos.orbital. An example record has v=DMARC1, p=quarantine, aspf=r, and adkim=r. If DMARC fails, the receiver checks the policy, which is p=none to monitor, p=quarantine to route to spam, or p=reject to block delivery. The policy is a preference, and the receiver makes the final decision. Some receivers send aggregate reports to the rua= address. Those reports count mail that passes and mail that fails.

Why DMARC pass never means "safe email" or "verified human"

During incident triage at Meridian, Threat Hunter Nyx frequently hears: "How did this phishing email reach the inbox when SPF, DKIM, and DMARC all passed?" There are two simple reasons. First, if an attacker registers a lookalike domain such as chronos-support.com, sets up their own SPF record, signs mail with their own DKIM key, and publishes their own DMARC policy, then mail from admin@chronos-support.com will achieve a 100% legitimate DMARC pass for chronos-support.com.

Second, if a real vendor mailbox or an internal employee account is compromised via a stolen session token, the attacker sends mail through the real mail servers, which dutifully sign the message with the organization’s real DKIM key. Email authentication proves domain transport provenance, never human identity or payload safety.

A mailing list can cause an authorized message to fail these checks. A forwarder can cause an authorized message to fail these checks. The lesson "Monitor, then enforce" explains the watch before enforcement.

CHECK YOUR JUDGMENT

An engineer at Meridian Space & Robotics (chronos.orbital) receives an email from support@chronos-orbital-help.net asking them to download a diagnostic patch. The mail gateway logs show spf=pass, dkim=pass, and dmarc=pass for chronos-orbital-help.net. Which conclusion is accurate?

Put your learning to work ↗

Find your next idea.

Tip: press / to open search. Escape closes this window.