DMARC Identifier Alignment Explained: SPF Pass + DKIM Pass Can Still Fail DMARC!
Why emails with spf=pass and dkim=pass still bounce with dmarc=fail when Return-Path or DKIM d= domains don't align with From:, plus aspf=r/s and adkim=r/s rules.
Incident Symptom & RFC 7489 Root Cause
Authentication & Policy Symptom
Inspecting a bounced message's Authentication-Results header shows BOTH spf=pass AND dkim=pass—yet right below them sits dmarc=fail (p=reject dis=reject)! Engineers stare at two green 'pass' results unable to figure out why DMARC rejected the email.
Alignment & Policy Discovery Mechanics
Raw SPF Pass and DKIM Pass only prove the sender authorized the envelope/signing domain (such as sendgrid.net or amazonses.com)! DMARC requires IDENTIFIER ALIGNMENT: the authenticated SPF Return-Path domain OR at least one valid DKIM d= signing domain MUST match the visible RFC 5322 'From:' header domain (exactly under Strict 's' mode, or sharing the same PSL organizational root under default Relaxed 'r' mode)!
Broken vs Verified Policy & Header Configuration
# Visible Header seen by human recipient:
From: Billing <billing@example.com>
# Default unconfigured ESP SMTP Envelope & Shared DKIM Signature:
Return-Path: <0100018f-uuid@us-west-2.amazonses.com> # spf=pass (amazonses.com != example.com!)
DKIM-Signature: v=1; a=rsa-sha256; d=amazonses.com; ... # dkim=pass (amazonses.com != example.com!)
# Result: SPF Aligned = FALSE, DKIM Aligned = FALSE -> DMARC = FAIL (Rejected under p=reject!)# Visible Header:
From: Billing <billing@example.com>
# 1. Custom MAIL FROM / Return-Path subdomain on example.com (Passes Relaxed aspf=r!):
Return-Path: <0100018f-uuid@bounces.example.com>
# 2. Custom 2048-bit DKIM CNAMEs signing directly with d=example.com (Passes BOTH adkim=r & adkim=s!):
DKIM-Signature: v=1; a=rsa-sha256; s=pm2026; d=example.com; ...
# _dmarc.example.com (keep default relaxed alignment aspf=r; adkim=r unless strict is verified!):
# "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"Protocol Mechanics & Operational Deep Dive
Without Identifier Alignment, SPF and DKIM would provide zero protection against display-From spoofing! Imagine an attacker registers evil-mailer.net, sets up clean SPF and DKIM for evil-mailer.net, and sends an email with envelope MAIL FROM:<bot@evil-mailer.net>, DKIM-Signature: d=evil-mailer.net, and visible header From: CEO <ceo@yourcompany.com>. Both raw spf=pass (evil-mailer.net) and dkim=pass (evil-mailer.net) succeed! DMARC closes that loophole by comparing the authenticated domain against RFC5322.From (yourcompany.com).
DMARC passes as soon as EITHER aligned SPF passes OR aligned DKIM passes (only 1 of the 2 is required by RFC 7489 §4.2, though configuring both gives resilience!). Compare Relaxed (r, the default when aspf/adkim are omitted) against Strict (s): under Relaxed (r), any subdomain sharing the same Public Suffix List organizational domain aligns (bounces.example.com aligns with From: @example.com, and mail.uk.example.com aligns with From: @billing.example.com!). Under Strict (s), the strings must match label-for-label (bounces.example.com FAILS strict alignment against From: @example.com!).
That single distinction explains why setting aspf=s on a modern SaaS company's DMARC record almost always breaks SPF alignment for transactional ESPs! Amazon SES, Postmark, Mailgun, SendGrid, and HubSpot all require a dedicated subdomain (like em.example.com or pm-bounces.example.com) for custom Return-Path bounce routing because your root example.com MX points to Google Workspace or Microsoft 365! Keep aspf=r (relaxed) so bounce subdomains align cleanly with @example.com, and verify custom DKIM (d=example.com) on every ESP.
DMARC Alignment Truth Table (Visible From: user@example.com)
| Policy / Scenario | RFC 7489 Evaluation | Production Remediation |
|---|---|---|
| Return-Path: @sendgrid.net / d=sendgrid.net | Different organizational domain; fails BOTH Relaxed (r) and Strict (s) alignment! | Complete 'Domain Authentication' (custom DKIM CNAMEs + custom Return-Path) in ESP settings. |
| Return-Path: @bounces.example.com | PASSES Relaxed (aspf=r) alignment; FAILS Strict (aspf=s) alignment against @example.com! | Keep default aspf=r so custom bounce subdomains pass SPF alignment. |
| DKIM-Signature: d=example.com | Exact organizational & hostname match; PASSES both Relaxed (adkim=r) and Strict (adkim=s)! | Configure 2048-bit custom DKIM signing on every authorized email platform. |
| DSN / Auto-reply with empty MAIL FROM:<> | RFC 7489 §3.1.1 checks SPF alignment against the SMTP HELO/EHLO hostname! | Name outbound MTAs under your domain (smtp1.example.com) so HELO aligns under aspf=r. |
Edge Cases & Engineering FAQs
Does DMARC require BOTH SPF alignment AND DKIM alignment to pass?
No! Per RFC 7489 §4.2, DMARC evaluates as PASS if (SPF=Pass AND SPF-Aligned) OR (DKIM=Pass AND DKIM-Aligned). However, configuring BOTH on every stream ensures forwarded mail (where SPF breaks) passes via DKIM, while messages whose body got re-wrapped by a footer gateway (where DKIM breaks) can still pass via SPF!
Wait: if Amazon SES sends with default Return-Path @amazonses.com BUT signs custom DKIM d=example.com, does DMARC pass?
Yes! Because DKIM (d=example.com) passes AND aligns with From: @example.com, DMARC passes even when Return-Path stays on @amazonses.com! Setting up SES Custom MAIL FROM (bounces.example.com) in addition gives you dual SPF+DKIM alignment.
Does DKIM 'i=' (Agent or User Identifier) affect DMARC alignment, or only 'd='?
RFC 7489 §3.1.2 aligns strictly against the DKIM 'd=' (Signing Domain Identifier) tag, NOT 'i='.
Aggregate RUA Report Analytics
Automated XML aggregate report ingestion and dynamic SPF flattening to stay under the 10-lookup ceiling without stale netblocks.