Guide · Authentication: SPF, DKIM, DMARC
SPF vs DKIM vs DMARC: what each one checks
SPF checks whether the server that connected may send for the envelope sender's domain. DKIM checks whether a domain signed the message and the signed parts still verify. DMARC checks whether at least one of those passes belongs to the domain in the visible From address, and lets that domain's owner ask receivers how to treat mail that fails and send reports. So SPF and DKIM can both pass while DMARC fails: they passed for a domain that is not yours.
- Reading time
- 7 min
The three checks at a glance
| Item | SPF | DKIM | DMARC |
|---|---|---|---|
| Question it answers | May this server send for this envelope domain? | Did this domain sign the message, unchanged? | Does a pass match the visible From domain? |
| Domain it checks | The SMTP MAIL FROM domain (or HELO) | The signing domain, d= in the signature | The From header's domain |
| Where it lives in DNS | A TXT record at that domain | A key at <selector>._domainkey.<domain> | A TXT record at _dmarc.<domain> |
| What breaks it | Forwarding; more than 10 DNS lookups | Edits to signed parts, such as a list footer | No aligned SPF or DKIM pass |
| Standard | RFC 7208 | RFC 6376 | RFC 9989 (May 2026) |
| Check yours | SPF checker | DKIM checker | DMARC checker |
One message, three domains
A receipt can carry three different domains, and each check looks at a different one:
| Field | Example | Checked by |
|---|---|---|
| Visible From | receipts@example.com | DMARC (the author domain) |
| Envelope sender (MAIL FROM, Return-Path) | bounce@bounce.example.com | SPF |
| DKIM signature | d=example.com; s=receipts | DKIM |
The visible From is what the reader sees. The envelope sender is part of the SMTP conversation and receives bounces (envelope sender vs From). The signing domain can be yours, your sending service's, or one you set up for one mail stream.
SPF: may this server send for the envelope domain?
- The receiver takes the connecting IP and checks it against the SPF record of the MAIL FROM domain. When the envelope sender is empty (a bounce), SPF uses
postmasterat the HELO domain instead. The visible From is not an SPF input. - Publish one SPF record per domain. If several services share the envelope domain, list them all in that one record: two records make SPF fail with a permanent error.
- Evaluation may use at most 10 terms that cause DNS lookups (
include,a,mx,ptr,exists,redirect). Going over is a permanent error, not a warning (the SPF lookup limit). - A subdomain does not inherit its parent's SPF record. Each envelope domain needs its own (subdomain authentication).
DKIM: who signed, and does it still verify?
- The sending service signs with a private key. The signature names the signing domain in
d=and the selector ins=; withd=example.comands=receipts, the public key is atreceipts._domainkey.example.com. Some services ask you to publish a CNAME there so they can rotate the key (selectors and rotation). - A valid signature means the signed parts are unchanged and the signing domain takes some responsibility for the message. It does not encrypt anything, and it does not prove who wrote it. The From header must always be signed.
- RFC 8301 says signers should use RSA keys of at least 2048 bits, must use at least 1024, and must not use
rsa-sha1. - Your sending service's own signature can pass without naming your domain at all.
DMARC: does a pass match the visible From?
- DMARC compares the From domain with the domain of a passing SPF check and of each valid DKIM signature. One aligned pass is enough.
- Relaxed alignment (the default) accepts the same organizational domain:
bounce.example.comaligns withexample.com. Strict alignment needs the exact domain (DMARC alignment). - For DMARC, SPF counts only for the MAIL FROM identity, never for HELO.
- The policy (
p=none,quarantineorreject) is a request. The receiver decides what it does with mail that fails.
Why SPF and DKIM pass but DMARC fails
A synthetic Authentication-Results header, the kind a receiver adds to a message it accepted:
Authentication-Results: mx.receiver.example;
spf=pass smtp.mailfrom=bounce.vendor.example;
dkim=pass header.d=vendor.example;
dmarc=fail header.from=example.comBoth passes belong to the vendor. Neither vendor.example domain aligns with example.com, so DMARC fails. The fix is a custom envelope domain or DKIM signing domain under example.com, set up as your sending service explains. Weakening the DMARC policy does not fix alignment.
| What the receiver saw | DMARC | What to do |
|---|---|---|
SPF pass for bounce.example.com, DKIM fails | Pass (relaxed SPF) | Fix DKIM, so forwarding cannot break it |
SPF fails after forwarding, DKIM pass for example.com | Pass (aligned DKIM) | Nothing urgent: aligned DKIM carried it |
SPF and DKIM pass only for vendor.example | Fail | Set up an aligned envelope or signing domain |
SPF pass for bounce.example.com with aspf=s, no aligned DKIM | Fail | Use relaxed alignment, or the exact domain |
These assume a valid DMARC record and no other aligned signature. Whether a message passes DMARC and what the receiver then does with it are separate decisions.
Check DNS, then a real message
DNS shows what you published, not which domains a given message used. Check both:
- List every sender: office mail, receipts, password resets, support desk, marketing, and each outside service, including rare mail such as a yearly reminder.
- Check what is published for each envelope domain, selector and From domain with the SPF, DKIM and DMARC checkers.
- Send a real message through each route to a test mailbox you control at another provider.
- Read the receiver's
Authentication-Resultsheader in the original message. Comparesmtp.mailfrom,header.dand the From domain. Trust only the header your receiving system added: RFC 8601 tells receivers to remove copies that claim to be theirs but came from outside. - Test forwarded and list mail separately. Forwarding usually breaks SPF; a list footer or subject tag can break DKIM; ARC lets a receiver see earlier results, but does not turn a fail into a pass (ARC and forwarded mail).
- Write down which route you tested and which aligned domain passed, then repeat the same checks after any change.
Roll out DMARC after you know your senders
- Start with
p=noneand arua=address for aggregate reports. Monitoring asks for no action; it does not make failing mail pass. - Fix alignment for every legitimate sender the reports and your tests show.
- Move to
quarantine, thenreject, once your own mail passes (from p=none to p=reject).
Older advice may be out of date. RFC 9989 (May 2026) replaced RFC 7489 and RFC 9091. It finds the policy and the organizational domain by a DNS tree walk instead of the Public Suffix List, removes the pct tag, and adds t (test mode, a yes-or-no flag rather than a percentage: with t=y receivers do not apply the policy as written) and np (policy for subdomains that do not exist). RFC 9990 covers aggregate reports and RFC 9991 failure reports.
What none of the three checks
SPF, DKIM and DMARC say who may send as a domain. They do not say a recipient's mailbox exists, that the person asked for your mail, or that a message reaches the inbox. A lookalike domain or a compromised real account can send mail that passes all three. Checking recipient addresses is a separate job (what email verification checks).
Questions
Do I need all three?
Set up all three for every domain you send from. DMARC needs only one aligned pass, but mailbox providers set their own rules: Gmail asks every sender for SPF or DKIM and bulk senders for SPF, DKIM and DMARC (Gmail and Yahoo sender requirements).
Can DKIM carry DMARC when SPF fails?
Yes. One valid DKIM signature whose domain aligns with the From domain is enough, which is why aligned DKIM keeps forwarded mail passing.
Does p=none make DMARC pass?
No. p=none says the domain owner expresses no handling preference. The DMARC result is still pass or fail.
Do subdomains inherit SPF?
No. SPF is checked at the exact envelope domain. DMARC is different: a subdomain without its own record uses the policy found by the tree walk, which the sp and np tags can tune.
What RSA key size should DKIM use?
At least 2048 bits, as RFC 8301 recommends; 1024 is the minimum it allows. Check which sizes your sending service supports.
Try it
Look up your domain's records with the free SPF, DKIM and DMARC checkers. To check the recipients instead, use the free email checker or bulk email verification.
Related
- SPF, DKIM and DMARC in the glossary: the short definitions.
- Envelope sender vs From: which address SPF checks.
- Microsoft 365 SPF, DKIM and DMARC: the same setup on one platform.
Related guides
- SMTP envelope sender vs. From header: which address goes where?
- Moving DMARC from p=none to p=reject
- The SPF 10-lookup limit explained
- DKIM selectors and key rotation
- What does ARC-Seal mean in a forwarded email?
- All guides
Sources
- RFC 7208: Sender Policy Framework (checked 4 December 2026): sections 2.3 and 2.4 (identities checked), 3 and 3.2 (one record per name, no inheritance), 4.6.4 (10 lookups).
- RFC 6376: DomainKeys Identified Mail (checked 4 December 2026): sections 1 (purpose, no encryption), 3.6.2.1 (key location) and 5.4 (From must be signed).
- RFC 8301: DKIM cryptographic algorithm and key usage update (checked 4 December 2026): sections 3.1 and 3.2 (no
rsa-sha1, key sizes). - RFC 9989: DMARC (May 2026; checked 4 December 2026): sections 3.2.4 (SPF uses MAIL FROM only), 4.4 (alignment), 4.7 (tags
p,t,np,adkim,aspf) and Appendix C (changes since RFC 7489). - RFC 9990: DMARC aggregate reporting and RFC 9991: DMARC failure reporting (May 2026).
- RFC 8601: Authentication-Results header field (checked 4 December 2026): section 2.7 (
smtp.mailfrom,header.d) and section 5 (removing forged copies). - Google: Email sender guidelines (checked 4 December 2026): SPF or DKIM for all senders; SPF, DKIM and DMARC for bulk senders.
How we wrote this: drafted by the email-validation.org team with the help of AI writing tools, from our product documentation and the sources linked in the text.