SPF, DKIM, and DMARC explained (with the alignment rule everyone misses)

Three records, three jobs: SPF says which servers may send for your domain, DKIM proves a message was not altered, and DMARC ties both to the address your recipient actually sees. Most broken setups pass SPF and still fail DMARC — this guide explains why.

Updated July 31, 202616 min read
  • What each record does
  • Full syntax reference
  • The alignment rule
  • A rollout that will not break your mail

Key takeaways

  • SPF authenticates the envelope sender, not the From: header your recipient sees. That distinction is the source of most DMARC failures.
  • DKIM is the durable identifier: it survives forwarding, and the d= domain is what reputation systems attach to.
  • DMARC only passes if SPF or DKIM passes and the authenticated domain aligns with the From: domain.
  • SPF permits at most ten DNS-querying mechanisms. Exceeding the limit is a permanent error that fails SPF outright.
  • Roll out as p=nonep=quarantinep=reject, driven by aggregate reports, never by guesswork.
  • Authentication establishes identity, not trustworthiness. Passing all three earns you the right to be judged on reputation — it does not deliver the mail.

Email was designed without a way to verify who sent a message. Anyone can write anything in a From: header, and the protocol will carry it. SPF, DKIM, and DMARC are the three standards layered on afterwards to fix that, and since 2024 they are a precondition for delivery at every major consumer provider rather than an optimisation.

They are frequently described as "the three email authentication records," which makes them sound interchangeable. They are not. Each authenticates a different thing, two of them authenticate something the recipient never sees, and DMARC exists specifically to connect them to the identity that appears on screen.

Understanding that structure is the difference between a setup that passes checks and a setup that passes checks and still fails DMARC.

SPFDKIMDMARC
SpecificationRFC 7208RFC 6376RFC 7489
AuthenticatesThe sending IP against the envelope sender domainThe message content and headers, cryptographicallyThe relationship between the two and the From: header
Record locationyourdomain.com TXTselector._domainkey.yourdomain.com TXT_dmarc.yourdomain.com TXT
Survives forwardingNoUsually yesDepends on which passes
Tells receivers what to do on failureWeaklyNoYes — this is its purpose

SPF: which servers may send for your domain

SPF publishes a list of servers authorised to send mail on behalf of a domain. When a receiving server accepts a connection, it takes the domain from the SMTP envelope sender — the MAIL FROM address, also called the return path — looks up that domain’s SPF record, and checks whether the connecting IP is authorised.

The critical detail is that this is the envelope sender, not the From: header the recipient sees. Those are usually different. Most email providers rewrite the return path to their own bounce-handling domain so that bounces come back to them, which means SPF authenticates the provider’s domain, not yours — and that is exactly why SPF alone cannot satisfy DMARC.

SPF record anatomy

yourdomain.com.  TXT  "v=spf1 include:spf.supersendtx.com include:_spf.google.com -all"
                        │      │                          │                      │
                        │      │                          │                      └─ everything else fails
                        │      │                          └─ authorise Google Workspace
                        │      └─ authorise the SuperSend TX sending servers
                        └─ SPF version — must be first
  • · A domain may publish exactly one SPF record. Two records is a permanent error.
  • · Mechanisms are evaluated left to right; the first match wins.

The all mechanism and its qualifiers

QualifierResultUse
-allFailCorrect end state — unauthorised sources are rejected
~allSoftfailTransitional — receivers accept but mark; use while discovering your senders
?allNeutralEffectively no policy; avoid
+allPass everythingNever — this authorises the entire internet
  • Publish exactly one SPF record per domain — a second one is a permanent error, not a merge.
  • Do not use the ptr mechanism. It is deprecated, slow, and unreliable.
  • Subdomains do not inherit SPF. Each sending subdomain needs its own record.
  • A domain that sends no mail at all should publish v=spf1 -all.

DKIM: proving the message was not altered

DKIM attaches a cryptographic signature to each message. The sending server hashes a canonicalised copy of the body and a chosen set of headers, signs the hash with a private key, and adds a DKIM-Signature header. The receiver fetches the corresponding public key from DNS and verifies.

Because the signature travels inside the message, DKIM usually survives forwarding and mailing lists in a way SPF does not — a forwarded message arrives from a different IP, which breaks SPF, but the signature still verifies as long as the signed content was not modified. That durability is why DKIM is the identifier reputation systems lean on.

A DKIM signature and its DNS record

# In the message headers
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
    d=mail.yourdomain.com; s=ss1; t=1785000000;
    h=from:to:subject:date:message-id;
    bh=2jmj7l5rSw0yVb/vlWAYkK/YBwk=;
    b=dzdVyOfAKCd…

# The matching public key in DNS
ss1._domainkey.mail.yourdomain.com.  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQ…"
  • · d= is the signing domain — this is the identity reputation attaches to.
  • · s= is the selector, which lets one domain publish several keys at once.
  • · h= lists the headers covered by the signature; changing any of them breaks it.

Selectors are what make key rotation practical. Because the record name includes the selector, you can publish a second key under a new selector, switch signing to it, and remove the old record once no in-flight mail depends on it — all without a window where verification fails.

Use at least a 1024-bit RSA key; Yahoo requires that as a minimum and 2048-bit is the recommended default for new deployments. The constraint on longer keys is historical DNS TXT record limits rather than anything cryptographic, and modern providers handle 2048-bit keys without difficulty.

DMARC: connecting authentication to the visible sender

SPF and DKIM each authenticate a domain, but neither is required to be the domain the recipient sees. A spammer can pass both while displaying your brand in the From: header — authenticating their own domain perfectly while impersonating yours.

DMARC closes that gap with one rule: authentication only counts if the authenticated domain aligns with the domain in the From: header. It then lets the domain owner publish what receivers should do when nothing aligns, and asks receivers to report back on what they saw.

A DMARC record

_dmarc.yourdomain.com.  TXT  "v=DMARC1; p=reject; sp=quarantine; adkim=s; aspf=s; pct=100; rua=mailto:dmarc-reports@yourdomain.com; fo=1"
TagMeaningNotes
p=Policy for the organisational domainnone, quarantine, or reject
sp=Policy for subdomainsDefaults to the p= value; useful during rollouts
adkim=DKIM alignment moder relaxed (organisational domain match), s strict (exact match)
aspf=SPF alignment modeSame relaxed/strict semantics
pct=Percentage of failing mail the policy applies toA rollout throttle; pct=100 is the end state
rua=Where to send aggregate reportsThe single most useful tag — always set it
ruf=Where to send forensic reportsSparsely supported and carries message content; often omitted
fo=Which failures generate forensic reportsfo=1 reports any failure rather than only total failures

Alignment, precisely

This is the concept that breaks otherwise-correct configurations, so it is worth stating exactly. DMARC passes if either of these is true:

  1. SPF passes and the envelope sender domain aligns with the From: header domain.
  2. DKIM passes and the d= signing domain aligns with the From: header domain.

Under relaxed alignment, "aligns" means the two share an organisational domain — mail.yourdomain.com aligns with yourdomain.com. Under strict alignment, they must match exactly.

Now consider the common setup. Your From: is noreply@yourdomain.com. Your provider rewrites the return path to bounces@provider.example, so SPF passes for provider.example — which does not align. If DKIM signs with the provider’s domain rather than yours, that does not align either. Both checks pass individually, DMARC fails, and the sender is left insisting their SPF is correct. It is. It simply is not aligned.

Rolling out DMARC without blocking your own mail

Publishing p=reject on day one is the fastest way to discover, painfully, that your billing system sends from an unauthenticated source nobody remembered. The rollout exists to find those before they start failing.

  1. 1

    Publish `p=none` with a reporting address

    This changes nothing about how your mail is handled. It only asks receivers to send you aggregate reports. Point rua= at a mailbox or a report-parsing service.

  2. 2

    Read reports for two to four weeks

    Aggregate reports list every source sending as your domain, with pass and fail counts per authentication method. Expect to find legitimate senders you had forgotten: your CRM, your helpdesk, your invoicing tool.

  3. 3

    Authenticate every legitimate source

    For each one, add the SPF include and publish a DKIM key. Watch the reports until every legitimate source shows aligned passes.

  4. 4

    Move to `p=quarantine`, optionally with `pct=`

    Start at p=quarantine; pct=25 if you want a throttled rollout, then raise to 100. Failing mail now goes to spam rather than the inbox, which is recoverable if you missed something.

  5. 5

    Move to `p=reject`

    Once quarantine has run clean for several weeks, move to reject. Unaligned mail claiming to be from your domain is now refused outright, which is the point of the exercise.

  6. 6

    Tighten alignment last

    Switch adkim and aspf to s only after everything is aligned under relaxed mode and you are confident no legitimate source relies on organisational-domain matching.

Beyond the three records

StandardWhat it doesWorth doing?
MTA-STS (RFC 8461)Declares that your domain requires TLS for inbound mail, preventing downgrade attacksYes, if you receive mail on the domain
TLS-RPT (RFC 8460)Asks receivers to report TLS negotiation failures back to youYes — cheap, and pairs with MTA-STS
ARC (RFC 8617)Preserves authentication results across forwarders and listsHandled by intermediaries, not by you
BIMIDisplays your logo next to authenticated mail in supporting clientsOnly after p=quarantine or p=reject; needs an SVG Tiny PS logo and often a verified mark certificate

BIMI is worth a specific note because it is frequently sold as a deliverability feature. It is not — it does not improve placement. What it does is display your brand logo beside authenticated messages in supporting clients, which is a recognition and anti-phishing benefit rather than a filtering one. It also requires DMARC at enforcement, which means the work it depends on is the work that actually helps.

Authentication is identity, not reputation

It is worth being precise about what passing all three checks actually buys you, because the gap between the common expectation and the reality is where a lot of wasted debugging happens. SPF, DKIM, and DMARC establish who a message is from. They say nothing about whether that sender is worth trusting. A phishing campaign operated from a domain the attacker genuinely controls can pass SPF, DKIM, and DMARC with full alignment — that is not a flaw in the standards, it is the point of them. They make identity reliable so that reputation can be attached to something stable.

Which means authentication is a gate, not a score. Failing it gets you filtered regardless of everything else, so it is genuinely non-negotiable, and since Gmail and Yahoo began enforcing bulk sender requirements in February 2024 and Microsoft followed in May 2025, it is enforced rather than merely advisable. But passing it only earns you the right to be evaluated on the thing that actually decides placement: the sending history attached to your domain and to the IP addresses your mail leaves from.

Setting this up with SuperSend TX

Adding a sending domain generates the full record set: an ownership TXT record, a DKIM public key under a selector on your domain, a return-path CNAME so SPF aligns with your From: header, the SPF include, and a starter DMARC record. Signing happens under your domain rather than ours, so DKIM alignment works from the first message.

That covers the identity half. The reputation half is the infrastructure the mail leaves from, and it is the part you cannot fix with a DNS record — which is why we operate our own mail servers rather than reselling someone else’s. Production sending runs on a network that carries paying transactional customers only, with no free tier, no marketing blasts, and no cold outbound sharing your IP ranges. When isolation matters more than that, Dedicated gives you your own mail servers and addresses, which we provision, warm through the full ramp, and manage — so both halves of the problem are handled before your first production send.

Add and verify a sending domain

curl -X POST https://api.supersendtx.com/domains \
  -H "Authorization: Bearer stx_…" \
  -H "Content-Type: application/json" \
  -d '{ "name": "mail.yourdomain.com" }'

# Publish the returned records, then verify
curl -X POST https://api.supersendtx.com/domains/mail.yourdomain.com \
  -H "Authorization: Bearer stx_…" \
  -H "Content-Type: application/json" \
  -d '{ "action": "verify" }'
  • · One-click DNS apply is available for Cloudflare and GoDaddy.
  • · Domain detail responses include best-effort DMARC and BIMI analysis with guidance.
  • One SPF record per sending domain, under ten DNS lookups, ending in -all
  • DKIM signing under your own domain, 2048-bit, with a rotatable selector
  • Return-path CNAME published so SPF aligns with the From: header
  • DMARC published with a monitored rua= address
  • Every legitimate sending source visible and aligned in aggregate reports
  • Policy moved to p=quarantine, then p=reject, after reports are clean

Authentication is the half you can fix in DNS

We generate the full record set — DKIM under your own domain, an aligned return path, SPF, and a starter DMARC policy. The other half is the infrastructure underneath: mail servers and IPs we own, warm, and manage so authenticated mail actually lands.

Related reading

FAQ

Frequently asked questions

What is the difference between SPF, DKIM, and DMARC?

SPF lists which servers may send mail for your domain and is checked against the envelope sender. DKIM cryptographically signs the message so a receiver can verify it was not altered and identify the signing domain. DMARC ties both to the From header the recipient actually sees, requiring that whichever check passed also aligns with that domain, and tells receivers what to do when nothing aligns.

Why does DMARC fail when SPF passes?

Because SPF authenticates the envelope sender domain, not the From header. Most providers rewrite the return path to their own bounce domain, so SPF passes for the provider rather than for you — and an unaligned pass does not satisfy DMARC. Fix it by signing DKIM with your own domain and publishing a custom return path so the envelope domain aligns too.

What is the SPF 10 lookup limit?

SPF evaluation allows at most ten DNS-querying mechanisms, counting include, a, mx, ptr, exists, and redirect — including everything nested inside each include. Exceeding it returns a permanent error and SPF fails entirely. Audit with a checker that reports the count, remove unused vendors, and use separate sending subdomains so each record authorises only one provider.

Should I use -all or ~all in my SPF record?

Use ~all (softfail) while you are still discovering which sources send as your domain, then move to -all (fail) once aggregate reports show everything legitimate is authorised. -all is the correct end state; leaving a record permanently on ~all weakens the policy for no benefit.

What DKIM key length should I use?

At least 1024-bit, which Yahoo requires as a minimum, and 2048-bit for anything new. The old objection to longer keys was DNS TXT record length, not cryptographic cost, and modern providers publish 2048-bit keys without difficulty. Use selectors so you can rotate keys without a verification gap.

How long does DMARC rollout take?

Plan two to four weeks at p=none reading aggregate reports before changing anything, then several more weeks at p=quarantine before moving to p=reject. The elapsed time is dominated by discovering and authenticating legitimate sending sources you had forgotten about, which only aggregate reports will reveal.

Does BIMI improve deliverability?

No. BIMI displays your brand logo next to authenticated messages in supporting clients — a recognition and anti-phishing benefit, not a filtering one. It does require DMARC at quarantine or reject, so the prerequisite work genuinely helps placement even though BIMI itself does not.

My SPF, DKIM, and DMARC all pass but my email still goes to spam. Why?

Because authentication proves identity, not trustworthiness — it tells the receiver who you are, and reputation decides what happens next. A message that authenticates perfectly from an IP or domain with poor sending history still gets filtered. If every checker is green and placement is still bad, the variable is reputation: the history of the IP addresses you send from, who else sends from them, and your own bounce and complaint rates.

Critical email deserves infrastructure you can name

Start on Sandbox in minutes. Move to a transactional-only Pool for production, or to Dedicated servers and IPs that we build, warm, and manage for you.