Skip to content

Lesson 4 of 9 · 28m

SPF, DKIM, and DMARC Enforcement

What each email authentication protocol proves, how to deploy them without breaking legitimate mail, and why DMARC enforcement is a business control.

SPF, DKIM, and DMARC are not interchangeable acronyms. They answer different questions, and confusing them is why organizations either leave spoofing open or break half their outsourced mail when they finally enforce. SPF asks which servers may send for the domain. DKIM asks whether a message was signed by a domain taking responsibility. DMARC asks whether the domain visible to the user aligns with one of those proofs — and what to do when it does not.

SPF: path authorization, not message integrity

SPF publishes a list of senders authorized for the envelope MAIL FROM domain.

v=spf1 ip4:203.0.113.10 include:_spf.google.com include:sendgrid.net -all

-all is hard fail; ~all is soft fail and often becomes a permanent excuse. SPF breaks when mail is forwarded because the forwarding server is not in the original sender's list. It also has a ten-DNS-lookup limit; bloated includes silently invalidate evaluation.

DKIM: cryptographic responsibility

DKIM signs selected headers and body content with a private key; receivers fetch the public key from DNS.

selector1._domainkey.example.com TXT   "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A..."

DKIM survives simple forwarding better than SPF, but the signer must be aligned with the visible From domain to satisfy DMARC. Rotate keys, use selectors per sending platform, and audit which third parties can sign as you.

DMARC: alignment plus policy plus reporting

_dmarc.example.com TXT   "v=DMARC1; p=reject; rua=mailto:dmarc@example.com; ruf=mailto:forensics@example.com; fo=1; adkim=s; aspf=s"

Deployment should be staged, but do not camp at monitoring forever:

  1. p=none with reporting to inventory legitimate senders.
  2. Fix unauthorized vendors by configuring SPF include or DKIM signing alignment.
  3. Move to p=quarantine; pct=25, then pct=100.
  4. Move to p=reject, keeping aggregate reports monitored.

Reports are XML and voluminous; use a parser or service. The real work is sender inventory: marketing platforms, ticketing systems, payroll providers, scanners, CRM, and that one ancient application server nobody owns.

Enforcement boundaries

DMARC protects the exact organizational domain and, depending on sp, subdomains. It does not stop cousin domains such as examp1e.com, display-name impersonation, or compromised legitimate accounts. You still need inbound controls, user judgment, and brand monitoring.

Field notes

  • A sending service can pass DKIM for its own domain while DMARC fails because alignment is absent.
  • Do not publish multiple SPF TXT records for the same hostname; receivers treat that as broken.
  • p=none is telemetry, not protection.
  • Mailing lists and forwarders can rewrite messages; DKIM replay and SPF failure patterns matter during troubleshooting.

Was this lesson helpful?

Sign in to rate