DMARC · SPF · DKIM · Alignment
DMARC fails but SPF and DKIM pass: the alignment fix
spf=pass · dkim=pass · dmarc=fail
DMARC does not ask “did anything pass?” It asks “did something pass for the domain your customers see in the From address?” If the answer is no, DMARC fails however green the other two lines look.
The fast answer
Do not change anything yet. Open the message headers and compare three domains: the From domain, the SPF domain (smtp.mailfrom=) and the DKIM signing domain (header.d=). The fix is whichever of those two you can make match the From domain most cheaply — usually custom DKIM signing for your sending service, or a custom Return-Path (bounce) domain. Relaxing strict mode is the last resort, not the first move.
What you are looking at, in plain words
SPF and DKIM each answer a narrow question about their own domain. SPF checks whether the sending server is authorised for the domain in the envelope Return-Path (the MAIL FROM), which your recipients never see. DKIM checks a signature made by the domain in the signature’s d= tag. DMARC then adds one rule on top: at least one of those passing checks must be aligned with the visible From domain — the same domain, or, in relaxed mode, the same organisational domain (a subdomain of it counts). A newsletter tool that passes SPF for its own bounce domain and signs DKIM with its own domain has therefore authenticated perfectly and aligned not at all. That is the whole mystery, and it is the single most common “DMARC fails for no reason” report.
| What you see | What it means |
|---|---|
spf=pass but smtp.mailfrom=senderservice.example | SPF passed — for someone else’s domain. It cannot count for your DMARC. |
dkim=pass but header.d=senderservice.example | DKIM passed — for someone else’s domain. It cannot count for your DMARC. |
dmarc=fail with either of the above | Neither aligned leg passed, so your DMARC policy applies — including p=reject. |
Step 0 — Prove which part is failing
- Open a failed message’s full headers and find the
Authentication-Resultsblock. Write down the From domain, thesmtp.mailfrom=domain and everyheader.d=value, with pass or fail against each. - Do the same for one message from each service that sends as your domain (mailbox, shop, newsletter, invoicing). The pattern is usually per-service, not per-domain: your mailbox aligns fine while one tool does not.
- Check your DMARC record’s
aspfandadkimtags. If either iss(strict), only an exact domain match counts — a legitimate subdomain sender that would pass in relaxed mode fails in strict mode. Note which tag, if any, is strict before changing anything.
p=none to make the red line go away. That removes your spoofing protection for every sender, including the ones that were already fine, and it teaches you nothing about which service is misaligned. Fix the alignment; leave the policy alone until the headers are green.Fix 1 — Give the sending service a DKIM signature in your domain
For most services this is the cheapest fix, because it needs no change to mail routing. In the service’s sending-domain settings, complete its custom-DKIM (sometimes called domain authentication) setup: it will give you DNS records, usually CNAMEs, to publish in your domain, after which it signs with d=yourdomain instead of its own domain. Publish exactly the records it shows you, wait for propagation, and re-test. Once dkim=pass header.d=yourdomain appears, DMARC passes on the DKIM leg even if SPF still uses the service’s bounce domain.
Fix 2 — Or give it a custom Return-Path in your domain
Some services instead (or additionally) offer a custom bounce / Return-Path domain: you publish a CNAME or MX for a subdomain such as bounces.yourdomain pointing at the service, and its envelope sender becomes that subdomain. SPF then passes for a subdomain of your domain, which aligns in relaxed mode. This is the right fix when the service cannot sign DKIM with your domain, or when you need the SPF leg specifically (for example, a receiver that weighs SPF heavily). Do not do both fixes blindly for every service — one aligned leg is enough for DMARC, and every extra record is a future maintenance burden.
Fix 3 — If strict mode is breaking a legitimate subdomain sender, relax it deliberately
If Step 0 showed aspf=s or adkim=s and the failing sender is a genuine subdomain of your domain (for example, mail from news.yourdomain while From is yourdomain), change that tag to r (relaxed) or remove it — relaxed is the default when the tag is absent. Edit the single TXT record at _dmarc.yourdomain; never publish a second DMARC record. Relaxing a tag is a considered policy change, not a workaround: note why you did it, and re-check after the next sender change.
Fix 4 — Send the unfixable senders from a subdomain you authenticate separately
If a service cannot sign with your domain and cannot use a custom Return-Path, stop letting it send from your main domain. Give it a subdomain (for example updates.yourdomain), authenticate that subdomain properly, and send from it. The From domain changes, so tell your readers — but a subdomain that passes DMARC beats a main domain that fails it, and it protects your main domain’s reputation from that service’s behaviour.
Prove it worked
- Send a test message from each fixed service to an outside mailbox, open its headers, and confirm
dmarc=passwith at least one ofsmtp.mailfromorheader.dshowing your domain (or a subdomain of it in relaxed mode). - Confirm the other services still pass too — a fix for one service must never be checked in isolation.
- Watch your next DMARC aggregate reports (see our guide to reading DMARC aggregate reports) for the fixed service moving from fail to pass.
Still not working? Work this ladder in order
- DKIM now passes but with the service’s domain. Custom DKIM is not finished: the records are unpublished, unpublished in the wrong place, or the service has not been told to use them. Re-check its status page before touching DNS again.
- SPF passes for your subdomain but DMARC still fails. Your record is in strict mode (
aspf=s). Relax it as in Fix 3, or align exactly. - Everything passes for one service, fails for another. That is normal: alignment is per-service. Work through Step 0 separately for each sender.
- DMARC passes but mail still lands in spam. That is no longer an alignment problem — look at content, list hygiene and complaint rates, not at DNS.
Mistakes that make it worse
- Adding the service’s servers to your SPF record and expecting DMARC to pass — SPF authorisation is not SPF alignment.
- Publishing a second DMARC record instead of editing the existing one.
- Dropping to p=none instead of fixing the misaligned service.
- Assuming a green DKIM pass anywhere means a green DMARC pass.
FAQ
Why does DMARC fail when both SPF and DKIM pass?
Because neither passing check used your From domain. DMARC requires at least one aligned pass: the SPF domain or the DKIM signing domain must match the From domain (exactly in strict mode, or at the organisational-domain level in relaxed mode).
Is fixing DKIM or fixing SPF better?
Whichever your service supports cleanly. Custom DKIM is usually simplest because it does not change mail routing. One aligned leg is enough — you do not need both.
What do aspf and adkim do?
They set strict (s) or relaxed (r) alignment for SPF and DKIM respectively. Relaxed, the default, allows a subdomain to align with its parent domain; strict requires an exact match.
Sources
RFC 7489 (DMARC, as superseded by RFC 9989) — identifier alignment, aspf/adkim tags · Google Email Sender Guidelines — bulk-sender authentication and alignment requirements · Merroway — How to read a DMARC aggregate report.
Did this fix work for you?
Your reaction is stored only in your own browser — it is not sent to us.