Email was designed without any way to prove who sent a message. SPF, DKIM and DMARC are the three records that add that proof. Together they decide whether a business's email is trusted, delivered and protected from impersonation. This guide explains each one, how they fit together, and how to roll them out for a client without breaking anything.
The problem they solve
Every email has two "from" addresses. The envelope sender (also called Return-Path or MAIL FROM) is used by servers for bounces. The header From is what the reader sees. Neither is verified by default, so anyone can send a message that displays accounts@yourclient.com. That is how fake invoices and password-reset scams work.
SPF: which servers may send
SPF (Sender Policy Framework, RFC 7208) is a TXT record on the domain that lists the servers allowed to send its email.
v=spf1 include:spf.protection.outlook.com include:sendgrid.net -allWhen a message arrives, the receiving server looks up SPF for the envelope sender's domain and checks whether the sending IP is listed. Key points:
- Exactly one SPF record per domain. Two records make SPF fail.
- At most 10 DNS lookups, counted recursively. See the SPF 10-lookup limit.
- The ending matters:
-all(fail),~all(softfail),?all(neutral) or+all(allow everyone, which defeats the purpose). See SPF ~all vs -all. - SPF breaks on forwarding, because the forwarding server is not in the original domain's list.
DKIM: a signature on each message
DKIM (DomainKeys Identified Mail, RFC 6376) adds a cryptographic signature to each message. The sending service signs with a private key; the public key is published in DNS under a selector:
selector1._domainkey.example.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh..."The signature header names the signing domain (d=) and selector (s=), so the receiver knows where to fetch the key. Key points:
- DKIM survives forwarding, as long as the message is not modified.
- Each sending service has its own selector and key. A domain can have many.
- Selectors cannot be listed from outside, which is why no tool can prove DKIM is "missing". See how to find a DKIM selector.
- Use 2048-bit RSA keys where the provider supports them.
DMARC: the policy that ties them together
DMARC (RFC 7489) is a TXT record at _dmarc. plus the domain:
_dmarc.example.com TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"It does two things. First, it requires alignment: SPF or DKIM must pass for the same domain the reader sees in the From address. Second, it tells receivers what to do when a message fails: nothing (p=none), spam folder (p=quarantine) or reject (p=reject). It also asks receivers to send daily aggregate reports to the rua address.
Alignment, the part most people miss
A message passes DMARC if either of these is true:
- SPF passes, and the envelope sender's domain matches the From domain.
- DKIM passes, and the signing domain (
d=) matches the From domain.
"Matches" is relaxed by default: mail.example.com aligns with example.com. Strict mode (aspf=s, adkim=s) requires an exact match.
This is why a newsletter tool can "pass SPF" and still fail DMARC: it passed SPF for its own bounce domain, not yours. The fix is to set up a custom return-path or, more often, DKIM signing with your domain in that tool.
| Scenario | SPF | DKIM | DMARC |
|---|---|---|---|
| Microsoft 365, DKIM enabled for the domain | Pass, aligned | Pass, aligned | Pass |
| Newsletter tool, default settings | Pass, not aligned | Pass, not aligned | Fail |
| Newsletter tool with custom DKIM | Pass, not aligned | Pass, aligned | Pass |
| Message forwarded by a mailing list that edits the subject | Fail | Fail (body changed) | Fail |
| Spoofer using your domain | Fail | None | Fail |
A safe rollout plan
- Inventory senders. Ask the client which tools send email as their domain: mail platform, CRM, invoicing, newsletters, booking, help desk, website forms.
- Publish DMARC at
p=nonewithrua. Nothing changes for delivery; reports start arriving within a day or two. - Fix SPF. One record, under 10 lookups, retired tools removed. Check with the SPF lookup counter.
- Enable aligned DKIM for every sender, starting with the main mail platform: Microsoft 365 or Google Workspace.
- Read the reports for two to four weeks until every legitimate source passes.
- Move to
p=quarantine, watch for a week or two, thenp=reject. Some teams usepct=to phase this in. - Set a subdomain policy with
sp=if needed. See DMARC for subdomains. - Keep watching. New tools get added. Re-check monthly or watch the domain.
Common mistakes
- Two SPF records, often one added by a web host and one by the mail provider.
- DMARC stuck at
p=nonefor years. Our local study found far more domains atnonethan enforcing. - A
ruamailbox nobody reads, or one on another domain without the authorisation record that external reporting needs. - Forgetting parked domains. A domain that never sends email should publish
v=spf1 -allandv=DMARC1; p=reject. - Enforcing before checking reports, and blocking the client's own invoices.
Where MTA-STS fits
SPF, DKIM and DMARC protect the identity of the sender. They say nothing about whether the message travels encrypted. That is MTA-STS (with TLS-RPT for reporting), covered in MTA-STS in 10 minutes. Check any domain with the free MTA-STS checker.
Explaining it to the client
Most clients need one sentence per record: SPF is the guest list, DKIM is the signature, DMARC is the instruction to the bouncer. The longer version, with the questions they will ask, is in how to explain DMARC in two minutes.
Frequently asked questions
Do I need SPF, DKIM and DMARC, or just one?
All three. SPF and DKIM are the two ways a message can prove it is legitimate. DMARC checks that at least one of them passes for the domain in the From address, and tells receivers what to do when neither does.
What does DMARC alignment mean?
Alignment means the domain SPF or DKIM authenticated matches the domain in the visible From address. A message can pass SPF for a provider's domain and still fail DMARC because that domain is not yours.
Can DMARC break my email?
Only if you enforce it before every legitimate sender passes. Start with p=none and reports, fix each sender, then move to quarantine and reject.
How long does a DMARC rollout take?
For a small business with a handful of senders, typically two to six weeks of elapsed time, most of it waiting for reports. The hands-on work is often a few hours.
Keep reading
DMARC p=none vs reject · 5 min read
DMARC p=none vs quarantine vs reject, in plain English
What each DMARC policy does to fake email, and a safe path from p=none to p=reject.
find DKIM selector · 6 min read
How to find a domain's DKIM selector (and why you can't list them all)
Three reliable ways to find the selector, the common defaults by provider, and why "DKIM missing" is a claim no outside tool can make.
DMARC aggregate report explained · 7 min read
DMARC aggregate (rua) reports explained, with a worked example
A worked example of one report, what each field means, and how to use the reports to move a domain safely to p=reject.