SPF, DKIM, DMARC: Email Authentication Explained
Email authentication is the layer that tells inbox providers your mail is legitimate. If your domain doesn't have SPF, DKIM, and DMARC configured correctly, every email you send is treated as suspicious by default — landing in spam, getting silently dropped, or in worst cases being spoofed by attackers pretending to be you.
The good news: setting up all three is a one-time job that takes an hour, and the deliverability gain is enormous. This guide explains what each one does, how they fit together, and how to set them up correctly.
Why Email Authentication Matters
SMTP — the protocol email runs on — was designed in the 1980s with no built-in way to verify the sender. Anyone can send email claiming to be from any domain. SPF, DKIM, and DMARC are three separate standards that, layered together, let receiving servers cryptographically verify the sender and decide what to do if verification fails.
Without authentication:
- Gmail, Outlook, Yahoo, and Apple Mail aggressively filter or block your sends
- Attackers can spoof your domain to phish your customers or partners
- Your bounce rate appears higher than it really is
- Email warmup on a new domain becomes nearly impossible
Since 2024, Gmail and Yahoo require all bulk senders (5,000+ messages/day to their domains) to have SPF, DKIM, and DMARC configured. Without them, your mail simply doesn't arrive.
What each one actually proves
Each answers a different question, and each has a gap the others cover.
| What it checks | A pass proves | A pass does not prove | Where it breaks | |
|---|---|---|---|---|
| SPF | The IP that delivered the message, against a list published by the domain in the envelope sender (MAIL FROM) | The connecting server is one the envelope domain allows | Anything about the visible From header, or that the content is untouched | Forwarding, because the forwarder's IP is not on the list |
| DKIM | A signature over selected headers and the body, against a public key in the signing domain's DNS | Someone holding the domain's private key signed this exact content | That the signing domain is the one in the From header | Mailing lists and anything that rewrites the subject or body |
| DMARC | That SPF or DKIM passed and the domain that passed matches the From header domain | The From domain the reader sees is backed by a check that domain controls | That the message is wanted; spam from a domain with good DMARC still passes | Any sender that passes SPF and DKIM for its own domain rather than yours |
The last column of the DMARC row is the one that catches people: a service that signs and sends as its own domain passes SPF and DKIM, and still fails DMARC for yours.
SPF (Sender Policy Framework)
SPF is a list of authorized sending servers for your domain, published as a TXT record in your domain's DNS. When a receiving server gets an email claiming to be fromyou@yourdomain.com, it checks the IP address that delivered the message against your SPF record. If the IP isn't on the list, the mail is suspicious.
A typical SPF record looks like this:
v=spf1 include:_spf.google.com include:sendgrid.net ~allThis says: "Mail from this domain may come from Google Workspace and SendGrid. Anything else, soft-fail." Each part of the syntax is explained in what is an SPF record.
Common SPF mistakes
- Multiple SPF records. RFC 7208 allows only one TXT record per domain starting with
v=spf1. Multiple records is the most common SPF error and causes silent authentication failures. - Exceeding 10 DNS lookups. SPF resolves
include:mechanisms recursively. More than 10 lookups makes the record fail with a permanent error. Use SPF flatteners only as a last resort. The count is explained in SPF PermError: too many DNS lookups. - Using
+all. This tells receivers any server is authorized — effectively turning off SPF. Use~all(soft-fail) or-all(hard-fail) instead.
DKIM (DomainKeys Identified Mail)
DKIM is a cryptographic signature added to the headers of every email you send. The public key is published in your DNS as a TXT record; the private key is held by your ESP (or your own mail server). Receivers verify the signature against the public key — if it matches, they know the message wasn't modified in transit and was sent by someone who controls your domain's DKIM key.
SPF only checks the connecting IP. DKIM checks the message itself. That's why both are needed: SPF can fail when mail is forwarded (the forwarding server isn't on your SPF list), but DKIM survives forwarding because the signature travels with the message. See why email forwarding breaks SPF and DMARC for the detail.
Setting up DKIM
Most ESPs (SendGrid, Mailchimp, Brevo, Klaviyo) generate DKIM keys for you and provide the DNS records to add. You typically add a CNAME or TXT record at a subdomain like s1._domainkey.yourdomain.com. After publication, verify activation in your ESP's sender authentication panel. If the signature still fails, see DKIM fail: causes and fixes.
DMARC (Domain-based Message Authentication, Reporting & Conformance)
DMARC is the policy layer on top of SPF and DKIM. It tells receiving servers what to do when a message fails SPF or DKIM checks for your domain — and where to send reports about it.
A starter DMARC record:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.comThis says: "Don't change handling based on DMARC failures yet (p=none), but send aggregate reports to dmarc@yourdomain.com so I can see what's happening."
DMARC has three policy levels:
| Policy | What happens on failure | When to use |
|---|---|---|
p=none | Nothing — just reports | First 2–4 weeks while you fix gaps |
p=quarantine | Failed mail goes to spam | After reports show legitimate mail authenticates correctly |
p=reject | Failed mail is rejected outright | Once you're confident in your auth — strongest protection against spoofing |
Don't skip straight to p=reject. Run p=none for at least two weeks, review DMARC aggregate reports (forwarded by services like Postmark's DMARC Digests or Dmarcian), fix any legitimate sources that are failing, then move to p=quarantine and eventually p=reject. The week-by-week schedule is in DMARC policy: none, quarantine or reject.
Alignment: relaxed versus strict
Alignment is the rule DMARC uses to decide whether an SPF or DKIM pass counts. SPF authenticates the domain in the envelope sender, which the reader never sees. DKIM authenticates the domain in the d= tag of the signature. DMARC compares each of those to the domain in the visible From header. The record's aspf and adkim tags set how close the match has to be.
- Relaxed (
r, the default): the two must share the same organisational domain.bounce.example.comaligns withexample.com. - Strict (
s): the two must be identical.bounce.example.comdoes not align withexample.com.
Almost every third-party sender uses a subdomain for its envelope address so that bounces come back to it. Under relaxed alignment that still passes; under strict it fails. Leave both tags relaxed unless a subdomain you do not control is being abused. A message needs only one aligned pass, which is what the example below relies on.
A worked example: one message through all three checks
A receipt is sent through a transactional provider for example.com. The provider connects from its own IP, uses its own bounce domain in the envelope, and signs with a key you published for it. Gmail writes the results into a header:
From: Example Billing <billing@example.com>
Return-Path: <bounce+a81f@mail.esp-vendor.com>
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=esp1; ...
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of bounce+a81f@mail.esp-vendor.com
designates 203.0.113.25 as permitted sender)
smtp.mailfrom=mail.esp-vendor.com;
dkim=pass header.i=@example.com header.s=esp1;
dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=example.com- SPF. Gmail fetches the SPF record for the envelope domain,
mail.esp-vendor.com, and finds203.0.113.25in it:spf=pass. The domain that passed is the vendor's, so this pass is not aligned. - DKIM. Gmail fetches
esp1._domainkey.example.comand checks the signature:dkim=pass. The signing domain equals the From domain, so this pass is aligned. - DMARC. Gmail fetches
_dmarc.example.com. One aligned check passed, sodmarc=passand thep=quarantinepolicy is never applied (dis=NONE). The receipt is delivered normally.
Had the DKIM key never been added for this vendor, no check would align and DMARC would fail. At p=quarantine the receipt lands in spam. This is the most common way legitimate mail is lost after a DMARC rollout.
How They Work Together
Each one closes a different gap:
- SPF — "Did this come from an authorized server?"
- DKIM — "Was the message modified, and was it signed by the domain owner?"
- DMARC — "What should I do when SPF or DKIM fails, and how do I tell the domain owner?"
Inbox providers run all three checks. A message that passes all three is trusted. One that fails any of them is treated with suspicion — exactly how, depends on your DMARC policy.
Step-by-Step Setup Order
For a new domain, do these in order. Each step depends on the one before it.
- Inventory your sending sources. Every service that sends email on behalf of your domain — your ESP, your transactional provider, Google Workspace, support tools, billing platforms — needs to be authenticated. Write them down with the domain each one uses in the envelope sender.
- Configure SPF. Combine all your authorized sources into a single TXT record. The SPF generator builds it from the services you send with. Validate with the free SPF checker or another checker (MXToolbox, dmarcian). End with
~allwhile you are setting up and switch to-allonce everything passes. - Configure DKIM for each source. Each ESP has its own DKIM panel — add the DNS records they generate, verify activation in each one. Make sure the signing domain is yours, not the vendor's default, or the signature will not align. Step-by-step guides: SPF, DKIM and DMARC for Google Workspace, SPF, DKIM and DMARC for Microsoft 365 and setting up a branded sending domain in Klaviyo.
- Publish DMARC at
p=none. Add anruamailbox to receive aggregate reports. The DMARC generator writes the record. - Monitor reports for 2–4 weeks. Look for legitimate sending sources that are failing — usually older marketing tools or scripts you forgot about.
- Move to
p=quarantineafter a clean week of reports. Start withpct=25and raise it. RFC 9989, which replaced RFC 7489 as the DMARC specification in May 2026, removed thepcttag, so only receivers that still follow RFC 7489 may honour it; what DMARC is covers the change and thet=ytest mode RFC 9989 added. - Move to
p=rejectafter another clean week. You now have full domain protection.

How to verify each record
Each of the three can be checked from outside in a minute, without sending anything.
| Record | Where it lives | Check it with | What a good result looks like |
|---|---|---|---|
| SPF | TXT at yourdomain.com | SPF checker | One v=spf1 record, 10 or fewer lookups, ends in ~all or -all |
| DKIM | TXT or CNAME at selector._domainkey.yourdomain.com | DKIM checker, your ESP's verification button, then a test message | A test message shows dkim=pass header.i=@yourdomain.com |
| DMARC | TXT at _dmarc.yourdomain.com | DMARC checker | Record parses, p= and rua= are set, and a report arrives within a day or two |
Then send a test from every service to a Gmail mailbox you control and read the Authentication-Results header, as in the worked example above.

Common Mistakes
- Setting up SPF/DKIM but skipping DMARC. Without DMARC, receivers don't know what to do on failure — and you have no visibility into spoofing attempts.
- Jumping straight to
p=reject. One unauthenticated legitimate source and you lose mail you needed delivered. Always start atp=none. - Forgetting subdomains. A DMARC record at the organisational domain applies to subdomains too, unless
sp=says otherwise. Check that every subdomain which sends mail is aligned before the main policy goes strict, or setsp=separately while you fix them. RFC 9989 addsnp=, a separate policy for subdomains that do not exist in DNS; without it,sp=covers those too, orp=if there is nosp=. - Authenticating the envelope but not the visible from. DMARC checks alignment between the visible
From:address and the SPF/DKIM domain. Misalignment fails DMARC even when SPF and DKIM individually pass. See why DMARC fails when SPF and DKIM pass.
The Bottom Line
SPF, DKIM, and DMARC aren't optional anymore. They're table stakes for any domain that sends email at scale, and the gap between properly authenticated mail and unauthenticated mail in inbox placement is enormous. Spend the hour to set them up, spend two weeks at p=none watching the reports, then ratchet up the policy. Once they're live, deliverability gets noticeably better and stays that way — and attackers can't spoof your domain to phish your customers.
Frequently asked questions
Related reading
Ready to clean your email list?
Upload a CSV or XLSX and get every address marked deliverable, risky, undeliverable or unknown, with the reason. Free for lists of up to 50, no card. Nothing is sent to your contacts.