Skip to main content
LearnGuides

SPF, DKIM and DMARC Explained: How Email Authentication Works

Rahul Lakhaney
By Rahul LakhaneyPublished on: Mar 31, 2026 · Updated: Sep 6, 2026 · 9 min read · Last reviewed: Sep 2026

TL;DR

SPF says which servers may send for your domain, DKIM proves the message was not altered, and DMARC tells receivers what to do when either check fails. Here is how each works, which ones you need, and how to check them.

SPF, DKIM and DMARC at a glance

SPF, DKIM and DMARC are three DNS records that let a receiving mail server verify who sent a message and whether it arrived unchanged. SPF (Sender Policy Framework) lists the servers allowed to send for a domain. DKIM (DomainKeys Identified Mail) signs each message so the receiver can prove it was not altered in transit. DMARC (Domain-based Message Authentication, Reporting and Conformance) tells the receiver what to do when SPF or DKIM fails and sends the domain owner reports about who is sending as them.

ProtocolWhat it provesWhere it livesStandard
SPFThis server is allowed to send for this domainTXT record at the domain rootRFC 7208
DKIMThis message was not modified after it was signedTXT record at selector._domainkey.domainRFC 6376
DMARCWhat to do on failure, and who to report toTXT record at _dmarc.domainRFC 7489

They are layers, not alternatives. SPF checks the sending server, DKIM checks the message, and DMARC checks that whichever one passed actually belongs to the domain shown in the From line. Since February 2024, Google and Yahoo require all three from anyone sending bulk mail, and Gmail rejects unauthenticated messages outright.

InboxKit publishes all three when you add a domain, so on InboxKit-managed domains this guide explains what is already there. On domains you manage yourself, use it to set the records up in the right order and to read what the SPF checker, DKIM checker and DMARC checker report back.

SPF: which servers may send for your domain

SPF is a TXT record at your domain root that lists the IP addresses and mail systems allowed to send email with your domain in the envelope sender (the return path). A receiving server looks up the record, checks whether the connecting server's IP is on the list, and records a pass, fail or soft fail.

Example records:

ProviderSPF record
Google Workspacev=spf1 include:_spf.google.com ~all
Microsoft 365v=spf1 include:spf.protection.outlook.com ~all
Both on one domainv=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all

The all qualifier decides what happens to everyone not on the list:

QualifierMeaningUse
-allHard fail: rejectOnce every sender is listed
~allSoft fail: accept but markDuring setup and for the first weeks
?allNeutralNot recommended
+allAllow everyoneNever; it disables SPF

The ten-lookup limit. Every include:, a, mx and redirect term costs a DNS lookup, and the receiver stops evaluating after ten (RFC 7208, section 4.6.4). Past ten the record returns a permanent error and SPF fails for every message. Google's include alone uses three lookups, so a domain that also lists a CRM, a helpdesk and a sequencer can hit the limit without noticing. The SPF checker counts the lookups for you; the SPF setup guide covers flattening when you are over.

One record per domain. Two TXT records starting with v=spf1 on the same name is a permanent error, the same as exceeding the lookup limit. Merge the includes into a single record instead.

DKIM: proof the message was not altered

DKIM adds a cryptographic signature to each message. Your mail server signs selected headers and the body with a private key and adds the result as a DKIM-Signature header. The receiver fetches the matching public key from DNS and verifies the signature. If anything covered by the signature changed on the way, verification fails.

Where the key lives:

selector._domainkey.yourdomain.com  TXT  "v=DKIM1; k=rsa; p=MIIBIjAN..."

The selector is a label chosen by the sending system, so one domain can publish several keys. Google Workspace uses google by default; Microsoft 365 uses selector1 and selector2 and rotates between them. A sequencer or CRM that sends on your behalf usually asks for its own selector.

Key sizes:

Key sizeStatus
1024-bitMinimum accepted by Google; being phased out
2048-bitRecommended; the default at Google and Microsoft
4096-bitWorks, but some DNS providers cannot store the record in one string

What DKIM does not do. It does not say who is allowed to send, only that this message carries a valid signature for the domain in the d= tag. That is why DKIM alone does not stop spoofing of the visible From address; DMARC alignment closes that gap.

The DKIM checker fetches the key for a selector and reports its size and validity. The DKIM setup guide walks through enabling it for Google Workspace and Microsoft 365.

DMARC: what happens when a check fails

DMARC sits on top of SPF and DKIM. It adds two things neither of them has: a policy that tells receivers what to do with mail that fails, and reports that tell you who is sending with your domain.

Policies:

PolicyAction on failureWhen to use it
p=noneDeliver anyway, just reportThe first two to four weeks, while you read reports
p=quarantineSend to spamOnce reports show only your own senders failing, if any
p=rejectRefuse deliveryWhen every legitimate source passes

Example records:

StageRecord
Monitorv=DMARC1; p=none; rua=mailto:[email protected]
Rampv=DMARC1; p=quarantine; pct=50; rua=mailto:[email protected]
Enforcev=DMARC1; p=reject; rua=mailto:[email protected]

pct applies the policy to a share of failing mail, which lets you move to quarantine or reject gradually. rua is where aggregate reports go; expect one XML report per receiving provider per day.

Alignment is the part people miss. A message passes DMARC only if SPF or DKIM passes and the domain that passed matches the domain in the visible From header. In relaxed mode (the default) a subdomain counts as a match; in strict mode (aspf=s or adkim=s) it must be identical. This is the check that breaks when a sequencer sends from its own return-path domain, or when a tracking domain signs with a different d=: SPF and DKIM can both pass while DMARC fails.

Google requires at least p=none from bulk senders; it does not require quarantine or reject. Cold email domains should still move to p=quarantine once reports are clean, because an unenforced policy does nothing to stop someone else sending as you.

The DMARC checker shows the policy, the pct value and the alignment modes for any domain; the DMARC setup guide covers reading the reports.

How the three work together

A receiving server runs the checks in this order:

StepCheckQuestionIf it fails
1SPFIs the connecting server allowed to send for the return-path domain?Counted as an SPF failure
2DKIMDoes the signature verify against the published key?Counted as a DKIM failure
3DMARC alignmentDoes the domain that passed match the From domain?Message fails DMARC
4DMARC policyWhat did the domain owner ask us to do?none, quarantine or reject

A message passes DMARC when SPF passes and aligns, or DKIM passes and aligns. Both do not have to pass, which is deliberate: forwarding breaks SPF (the forwarder's server is not in your record) but leaves DKIM intact, so a correctly signed message survives forwarding.

You can see the result of all four steps on any message you have received. Open the raw source and read the Authentication-Results header, or paste it into the email header analyzer.

Which ones do you need?

All three, if you send cold email or any volume of outbound. The requirements are not a best practice any more; they are the entry conditions at the two largest mailbox providers.

Sender typeRequired since February 2024
Anyone sending to Gmail or YahooSPF or DKIM passing for the sending domain
Bulk senders (about 5,000 messages a day to Gmail)SPF and DKIM, DMARC at p=none or stronger, and DMARC alignment

Cold email crosses the bulk threshold sooner than it looks: 50 mailboxes at 30 messages a day is 1,500 a day per domain, and Google counts across the whole domain. Set up all three on every sending domain before the first campaign, not after the first bounce.

Set them up in this order:

  1. 1SPF first, with ~all, listing every system that sends for the domain. Setup guide.
  2. 2DKIM next, one selector per sending system, 2048-bit keys. Setup guide.
  3. 3DMARC last, at p=none with a rua address, and read the reports for two to four weeks before moving to quarantine. Setup guide.
  4. 4Verify with the DNS checker, then send yourself a message and confirm three passes in the Authentication-Results header.

On InboxKit, steps 1 to 3 happen automatically when a domain is connected, and the dashboard shows each record's status. The DNS setup guide shows what that looks like.

Common failures and how to fix them

SymptomUsual causeFix
SPF shows permerrorMore than ten DNS lookups, or two v=spf1 recordsMerge into one record; remove unused includes; flatten if still over ten
SPF passes on your tests but fails in reportsA tool sends from its own return pathAdd that tool's include, or make it sign with DKIM on your domain
DKIM fail or neutralSelector not published, key rotated, or the record split across DNS strings incorrectlyRe-publish the key from the sending system; check the exact selector name
SPF and DKIM pass, DMARC failsNeither passing domain aligns with the From domainSend from the same domain you sign with; set the sequencer's custom return-path and DKIM to your domain
Forwarded mail failsSPF breaks on forwardingExpected; DKIM keeps the message passing DMARC, so make sure DKIM is signing
Everything passes but mail still lands in spamAuthentication is necessary, not sufficientCheck reputation and blacklists, content with the spam checker, and warmup for new domains

Frequently Asked Questions

SPF checks the server: is the machine that connected allowed to send for this domain? DKIM checks the message: does its signature verify against the domain's published key, proving it was not altered? SPF breaks when mail is forwarded; DKIM survives forwarding. Gmail and Yahoo require at least one of the two for every sender and both for bulk senders.

Yes, for two reasons. Google requires a DMARC record from bulk senders, and without DMARC nothing stops someone else from sending mail with your domain in the From line, because SPF and DKIM on their own do not check the visible From address. Start with p=none; it costs nothing and gives you reports.

The message can still pass DMARC, as long as the DKIM signature's domain aligns with the From domain. This is by design so that forwarded mail, which always fails SPF, is not thrown away. If neither passes and aligns, the DMARC policy applies.

p=none with a rua reporting address. Read the aggregate reports for two to four weeks to find any legitimate sender that fails, fix those, then move to p=quarantine, optionally with pct to ramp up. Go to p=reject once every legitimate source passes. Google only requires p=none, but an unenforced policy does not protect the domain.

Yes. Put both includes in a single record: v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all. That uses four of the ten lookups. Never publish two separate v=spf1 records; that is a permanent error.

As long as the record's TTL, usually five minutes to an hour on modern DNS providers. Receivers cache records, so a fix can take up to the old TTL to be seen everywhere. Check with the DNS checker after the TTL has passed rather than immediately.

Authentication proves who you are; it does not vouch for what you send or how you have behaved. Filters also weigh sender reputation (bounce rate, complaints, blacklists, domain age) and content. New domains need warmup, and cold email copy should be checked before it goes out.

Ready to set up your infrastructure?

Plans from $39/mo with 10 mailboxes included. Automated DNS, warmup, and InfraGuard monitoring included.