Email Deliverability

SPF, DKIM, DMARC: Email Authentication Explained

InboxSure··Updated ·7 min read

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 checksA pass provesA pass does not proveWhere it breaks
SPFThe 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 allowsAnything about the visible From header, or that the content is untouchedForwarding, because the forwarder's IP is not on the list
DKIMA signature over selected headers and the body, against a public key in the signing domain's DNSSomeone holding the domain's private key signed this exact contentThat the signing domain is the one in the From headerMailing lists and anything that rewrites the subject or body
DMARCThat SPF or DKIM passed and the domain that passed matches the From header domainThe From domain the reader sees is backed by a check that domain controlsThat the message is wanted; spam from a domain with good DMARC still passesAny 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.

A message passing the SPF, DKIM and DMARC checks in turn and ending in the inbox, the spam folder or a rejection
SPF and DKIM run independently. DMARC reads both results and applies the policy.

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 ~all

This 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.com

This 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:

PolicyWhat happens on failureWhen to use
p=noneNothing — just reportsFirst 2–4 weeks while you fix gaps
p=quarantineFailed mail goes to spamAfter reports show legitimate mail authenticates correctly
p=rejectFailed mail is rejected outrightOnce 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.

Three cards for p=none, p=quarantine and p=reject showing what happens to failing mail under each, arranged in rollout order
Move through the policies in this order, and only after the reports are clean.

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.com aligns with example.com.
  • Strict (s): the two must be identical. bounce.example.com does not align with example.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
  1. SPF. Gmail fetches the SPF record for the envelope domain, mail.esp-vendor.com, and finds 203.0.113.25 in it: spf=pass. The domain that passed is the vendor's, so this pass is not aligned.
  2. DKIM. Gmail fetches esp1._domainkey.example.com and checks the signature: dkim=pass. The signing domain equals the From domain, so this pass is aligned.
  3. DMARC. Gmail fetches _dmarc.example.com. One aligned check passed, so dmarc=pass and the p=quarantine policy 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.

  1. 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.
  2. 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 ~all while you are setting up and switch to -all once everything passes.
  3. 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.
  4. Publish DMARC at p=none. Add an rua mailbox to receive aggregate reports. The DMARC generator writes the record.
  5. Monitor reports for 2–4 weeks. Look for legitimate sending sources that are failing — usually older marketing tools or scripts you forgot about.
  6. Move to p=quarantine after a clean week of reports. Start with pct=25 and raise it. RFC 9989, which replaced RFC 7489 as the DMARC specification in May 2026, removed the pct tag, so only receivers that still follow RFC 7489 may honour it; what DMARC is covers the change and the t=y test mode RFC 9989 added.
  7. Move to p=reject after another clean week. You now have full domain protection.
The free DMARC record generator with the policy and rua fields filled in and the resulting TXT record shown
Step 4: the generator produces the p=none record to publish at _dmarc.yourdomain.

How to verify each record

Each of the three can be checked from outside in a minute, without sending anything.

RecordWhere it livesCheck it withWhat a good result looks like
SPFTXT at yourdomain.comSPF checkerOne v=spf1 record, 10 or fewer lookups, ends in ~all or -all
DKIMTXT or CNAME at selector._domainkey.yourdomain.comDKIM checker, your ESP's verification button, then a test messageA test message shows dkim=pass header.i=@yourdomain.com
DMARCTXT at _dmarc.yourdomain.comDMARC checkerRecord 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.

The free SPF checker showing a record expanded into its includes with the lookup total against the limit of 10
The SPF checker resolves every include and reports the lookup total, the first thing to confirm after publishing.

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 at p=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 set sp= separately while you fix them. RFC 9989 adds np=, a separate policy for subdomains that do not exist in DNS; without it, sp= covers those too, or p= if there is no sp=.
  • 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



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.