Blog · Dmarc
Why DMARC Fails When SPF Passes (And What to Do About It)
The confusion
You have SPF configured. Your DNS records are correct. A receiving server confirms SPF passed - and then your DMARC report shows your mail failed anyway.
That is not a bug in your setup. It is a gap between what SPF checks and what DMARC checks.
Understanding the difference closes that gap permanently.
What SPF actually checks
SPF validates the RFC5321.MailFrom domain - the envelope sender address that determines where bounce messages go. When a mail server receives your message, it looks up the SPF record for the domain in the envelope sender, and checks whether the IP address sending the mail is authorized for that domain.
If the IP is on the allowlist, SPF passes. If not, SPF fails.
The envelope sender is invisible to most email users. It is separate from the From header address that readers see in their email client. SPF only ever sees the envelope.
What DMARC actually checks
DMARC does two things SPF does not.
First, it runs SPF and DKIM as normal. That part is straightforward.
Second - and this is the part that trips people up - it checks whether the results align with the RFC5322.From domain. That is the header From address that recipients see.
Alignment means one of two things passes:
- SPF alignment: the RFC5321.MailFrom domain matches the RFC5322.From domain
- DKIM alignment: the domain in the DKIM signature header matches the RFC5322.From domain
DMARC requires at least one of these alignment paths to pass. SPF pass alone is not enough if the envelope sender domain does not match the From header domain.
This is why DMARC fails when SPF passes. SPF may be checking one domain, while the From header belongs to a different domain entirely.
Why the domains diverge in practice
The most common cause is third-party email infrastructure.
When you send transactional mail through a marketing platform, a CRM, a helpdesk system, or an internal relay, those systems typically use their own domain in the envelope sender. They are authorized to send mail - SPF passes for their domain - but the From header shows your domain. The two domains do not match. DMARC alignment fails.
This failure is silent in many aggregate reports if you are not looking at alignment specifically. SPF passes. DKIM passes or is absent. DMARC fails anyway because the domains do not align.
Diagnosing the failure with aggregate reports
Open your DMARC aggregate report and look at the auth_results section for the failing messages.
If you see:
- SPF pass on a domain that is not yours (the third-party sender's domain)
- DMARC fail with a reason of " SPF alignment" or " DKIM alignment"
Then you have confirmed the divergence. The sending infrastructure is using its own envelope domain, which SPF validates, but your From header uses your domain, which does not align.
If the report shows DKIM signature present and passing but DMARC still fails, the DKIM signature is signed by the third-party domain, not yours. That is a DKIM alignment failure, not an SPF one.
The distinction matters because the fix differs depending on which alignment path is broken.
Fixing SPF alignment failures
When the problem is SPF alignment, you need the envelope sender domain to match your From header domain.
The cleanest fix is direct sending: send from your own mail infrastructure with your own envelope domain. Your mail servers, your domain, aligned automatically.
If you must use a third-party sender, check whether they support custom envelope sender domains. Many transactional email providers allow you to set the RFC5321.MailFrom to your own domain rather than theirs, restoring alignment without changing the From header.
If you cannot change the third-party sender's envelope domain, some platforms offer Sender Rewriting Schemes (SRS) to wrap the original envelope sender in your domain while maintaining bounce handling. SRS adds complexity and some receivers do not like SRS-wrapped addresses, but it does restore SPF alignment in most cases.
Fixing DKIM alignment failures
When DKIM alignment is the problem, the fix is more straightforward.
Configure the third-party sender to sign DKIM using your domain, not theirs. Most major providers let you add your DKIM selector to their sending infrastructure. When they sign with _domainkey.yourdomain.com instead of _domainkey.theirdomain.com, DKIM alignment passes automatically, and DMARC passes regardless of the envelope sender.
If the provider does not support custom DKIM signing, you are back to SPF alignment as your only path - which means the envelope sender domain must match your From domain.
Reading aggregate reports for alignment failures
Most DMARC aggregate reports arrive as raw XML. The data you need is there, but it is easy to miss alignment failures if you are not sure what to look for.
In the auth_results section, each authentication attempt shows a domain. In the policy_evaluated section, each message shows a disposition and a reason for any failure. When the reason field says "SPF alignment" or "DKIM alignment," that tells you which path failed - and that tells you which fix applies.
The pattern to watch for: SPF pass on a domain you do not recognize, combined with a From header showing your domain, equals a third-party sender using their own envelope domain. That is the alignment gap.
DMARCFlow parses these fields automatically and surfaces alignment failures separately from pure authentication failures, so you do not have to read raw XML to find the diagnosis. If you are running p=none and moving toward p=reject, catching alignment failures in aggregate reports before you enforce stricter policy is how you avoid surprise rejections.
How DMARCFlow helps
Most DMARC aggregate reports are raw XML. Reading them requires knowing where to look for alignment failures versus pure authentication failures. The two failure types look similar in an unprocessed report but require different fixes.
DMARCFlow parses alignment results separately from authentication results, so you can immediately see whether a failure is an SPF issue, a DKIM issue, or an alignment issue. For mail sent through third-party infrastructure, that distinction is the whole diagnosis.
If you are moving toward p=reject and want to catch alignment failures before they cause hard rejections, aggregate report monitoring that surfaces alignment errors early is more useful than a tool that shows you raw pass/fail counts without context.
FAQ
Does SPF pass mean DMARC will pass?
No. SPF validates the envelope sender domain against the sending server's IP. DMARC additionally requires that the envelope sender domain or the DKIM signing domain aligns with the From header domain. SPF pass is necessary for the SPF alignment path but is not sufficient on its own.
Can DMARC pass with only SPF and no DKIM?
Yes, if the RFC5321.MailFrom domain matches the RFC5322.From domain (SPF alignment). DKIM alignment is an alternative path, not a required one. You need only one alignment path to pass.
Why do third-party email senders break DMARC alignment?
Most third-party senders use their own domain in the envelope sender and sometimes in the DKIM signature. When the From header shows your domain, those two domains do not align, and DMARC fails even though the mail is authenticated and legitimate.
How do I check which alignment method failed in my DMARC report?
Look at the auth_results section of your aggregate report. If the failing reason field says "SPF alignment" or "DKIM alignment," that tells you which path failed. If SPF passes on a domain you do not recognize, that is a clue that a third-party sender's infrastructure is handling your envelope.
Is p=none still useful if my mail fails alignment?
Yes. p=none does not reject or quarantine mail - it instructs receivers to take no action on failures. It is still useful for monitoring because it lets you see alignment failures in aggregate reports without risking mail disruption. Once you have fixed the alignment issues, you can move to p=quarantine or p=reject with confidence.
Does enabling DMARC reporting catch alignment failures automatically?
DMARC aggregate reports contain the data you need to diagnose alignment failures, but most report formats require manual interpretation. The auth_results section and the policy_evaluated section together show you which authentication method passed, which alignment path failed, and what action the receiver took. A reporting tool that surfaces these fields clearly makes diagnosis faster than reading raw XML.