DMARC alignment explained (and how to fix it)
Last updated: October 27, 2026
DMARC does not ask 'did SPF or DKIM pass?' — it asks 'did SPF or DKIM pass for a domain that matches the From header?' That matching is called alignment, and misunderstanding it is the single most common reason legitimate senders see dmarc=fail with all-green SPF and DKIM.
Here is the trap in one example. You send through an ESP. The ESP's bounce address is bounces.esp.com, so SPF authenticates esp.com — pass. The ESP signs DKIM with d=esp.com — pass. Your visible From is you@yourcompany.com. DMARC compares yourcompany.com against esp.com and esp.com: no match, no alignment, DMARC fails. Every individual check was green.
Alignment comes in two flavors. Strict requires an exact domain match. Relaxed (the DMARC default) allows subdomains of the From domain's organizational domain — mail.yourcompany.com aligns with yourcompany.com. For SPF, DMARC looks at the Return-Path (MAIL FROM) domain, or HELO if the Return-Path is empty. For DKIM, it looks at the d= domain of a passing signature. You only need one of the two to align.
Not sure if this affects you? Send one test email and see exactly which checks fail.
Send a free test emailStep by step
Diagnose first
- Send a test email and open the Authentication category: compare From domain, SPF domain and DKIM domain side by side.
- If the SPF domain is the ESP's (esp.com, sendgrid.net, mailgun.org): SPF alignment is broken — fix with a custom return path (below) or rely on DKIM alignment.
- If there is no DKIM signature with d=yourdomain: DKIM alignment is missing — set up domain authentication at your ESP.
- Decide your strategy: DKIM alignment is the durable one (survives forwarding); SPF alignment is the supporting one.
Fix DKIM alignment (recommended, per ESP)
- Google Workspace: enable DKIM in Admin console — Gmail signs with d=yourdomain.com automatically.
- Microsoft 365: enable DKIM signing in Defender; Microsoft signs with your domain after you publish the two selector CNAMEs.
- SendGrid: complete Sender Authentication for your domain — SendGrid switches its signature to d=yourdomain.com.
- Mailgun: add the domain and publish its DKIM TXT — signatures then carry d=yourdomain.
- Amazon SES: enable Easy DKIM on the verified identity (three CNAMEs) — SES signs with your domain.
- Self-hosted: sign with OpenDKIM using d=yourdomain.com, not the server's hostname.
Fix SPF alignment (custom return path)
- Most ESPs let you set a custom bounce/return-path domain, typically a subdomain: bounces.yourdomain.com or em.yourdomain.com.
- Publish the CNAME or MX/SPF records the ESP asks for on that subdomain.
- Because relaxed alignment allows subdomains, bounces.yourdomain.com now aligns with From: yourdomain.com — SPF alignment restored.
Copy-paste examples
em.example.com CNAME u123.wl.sendgrid.net em.example.com TXT "v=spf1 include:sendgrid.net -all" (often managed by the ESP)
From: Newsletter <news@example.com> DKIM-Signature: d=example.com; s=s1; ... ← aligned (exact match)
From: news@example.com Return-Path: <bounce-42@em.example.com> ← SPF aligns under relaxed mode
Common mistakes
- Celebrating green SPF/DKIM while DMARC fails — always check the domains, not just the pass/fail.
- Setting DMARC to strict mode (aspf=s / adkim=s) without reason — subdomains stop aligning; the relaxed default is right for almost everyone.
- Fixing only SPF alignment, then wondering why forwarded mail fails DMARC — forwarding breaks SPF; you need DKIM alignment as the reliable leg.
- Multiple DKIM signatures where the passing one is the ESP's — receivers verify all signatures; make sure YOUR domain's signature is present and passing.
- Sending transactional mail from a bare ESP domain while marketing uses your domain — inconsistent alignment confuses reputation systems; align everything.
FAQ
Do I need both SPF and DKIM aligned?
No — DMARC passes when either one passes AND aligns. In practice, aim for DKIM alignment as primary (it survives forwarding) and SPF alignment as a bonus that also improves the raw SPF story.
What is relaxed vs strict alignment?
Relaxed (default): the authenticated domain may be the From domain or any subdomain of the same organizational domain. Strict (aspf=s/adkim=s): exact match required. Strict buys little and breaks subdomain sending; keep relaxed.
My ESP says SPF alignment is impossible with them. Is that OK?
Yes, if they sign DKIM with your domain — DKIM alignment alone makes DMARC pass. SPF alignment becomes optional. If they can do neither, change ESP.
Why did my DMARC start failing only on forwarded mail?
Forwarding breaks SPF (the forwarder's IP is not in your record) and sometimes modifies the body (breaking DKIM body hash). Aligned DKIM with relaxed canonicalization is the best defense; some breakage on mailing lists is unavoidable and expected.
Can I see alignment without reading raw headers?
Yes — send a test email to our tester; the report shows From domain, SPF domain and DKIM domain side by side with explicit aligns/misaligns badges, plus the DMARC result.
Does alignment apply per message or per domain?
Per message. Each email is evaluated on its own: the same ESP can produce aligned mail for one stream and unaligned for another if only one stream has DKIM domain authentication enabled. That is why fixing alignment means checking every sending tool and stream, not flipping one global switch — and why a single 'it passed yesterday' test does not prove tomorrow's campaign will pass.
Fixed it? Prove it.
Send a test email and watch every check go green.
Send a test email to verify the fix