A common assumption in hosting support goes like this: "SPF passes, DKIM passes, so DMARC must pass too." It sounds logical. SPF and DKIM are the two authentication mechanisms DMARC relies on, so if both show pass in the headers, the message should sail through. In production, though, mail that passes both checks still gets rejected or junked because of DMARC. The missing piece is alignment, and it trips up experienced administrators more often than you might expect.
What DMARC actually checks
SPF verifies that the sending IP is authorized by the domain in the envelope sender (the MAIL FROM address used during the SMTP transaction, sometimes called the Return-Path). DKIM verifies that a cryptographic signature in the message header is valid and was produced by the private key belonging to the domain in the d= tag of the signature. Both of those checks answer a narrow question: "Is this message authorized by some domain?" Neither one, on its own, says anything about the domain the human recipient sees in the From: header.
DMARC closes that gap. It takes the domain visible in the From: header and asks: does at least one of the authenticated identifiers (SPF's domain or DKIM's d= domain) match it? That matching step is called identifier alignment. If neither identifier aligns with the From: domain, DMARC fails, regardless of whether SPF and DKIM individually passed. The DMARC specification is defined in RFC 7489.
How alignment breaks in practice
Consider a domain example.com. The owner sends mail through a third-party platform. The platform sends the message from its own infrastructure, so the envelope sender might be something like bounce.platform.net. SPF passes because platform.net has authorized that IP. The platform also signs the message with DKIM, but using its own domain: the signature carries d=platform.net. Both checks pass.
Now the receiving server evaluates DMARC for example.com (the domain in the From: header). It checks SPF alignment: the envelope sender domain is platform.net, not example.com. No match. It checks DKIM alignment: the d= domain is platform.net, not example.com. No match. DMARC fails. The mail gets handled according to the published DMARC policy, which might be none (just report), quarantine (spam folder), or reject (bounce).
This is the scenario that confuses people. Every individual check is green, but the umbrella policy still fails because none of those green results belong to the right domain.
Another common variant: mail sent from a subdomain like news.example.com where SPF and DKIM authenticate news.example.com, but the DMARC record uses strict alignment (aspf=s or adkim=s). Strict mode requires an exact domain match, so news.example.com would not align with a From: header showing example.com, or vice versa. Relaxed mode (the default when the aspf and adkim tags are omitted) only requires the organizational domain to match, meaning news.example.com and example.com share the same organizational domain and would align.
Reading the headers to confirm the problem
When mail lands in spam or gets rejected, the first step is reading the Authentication-Results header added by the receiving mail server. This header shows the verdict for each mechanism and, critically, whether alignment succeeded.
A header showing the alignment failure pattern typically looks something like this:
Authentication-Results: mx.receiver.example;
spf=pass (sender IP is authorized) smtp.mailfrom=bounce.platform.net;
dkim=pass header.d=platform.net header.s=selector1;
dmarc=fail (p=quarantine dis=quarantine) header.from=example.com
Notice: spf=pass with smtp.mailfrom=bounce.platform.net, dkim=pass with header.d=platform.net, but dmarc=fail with header.from=example.com. The authenticated domains do not match the From: domain. That is the alignment failure.
Compare that with a properly aligned result:
Authentication-Results: mx.receiver.example;
spf=pass smtp.mailfrom=example.com;
dkim=pass header.d=example.com header.s=default;
dmarc=pass header.from=example.com
Here, at least one authenticated domain matches example.com, so DMARC passes. You only need one mechanism to align, not both.
For a deeper walkthrough of parsing these headers field by field, there is a related article: Reading Authentication-Results Headers to Fix DMARC Alignment.
Fixing the alignment
The fix depends on which mechanism you want to align. You need at least one.
Aligning DKIM is usually the cleaner path when using third-party senders. Most reputable email platforms allow you to configure a custom DKIM signing domain. You publish a CNAME or TXT record in your DNS that points a DKIM selector to the platform's key, and the platform then signs outbound mail with d=example.com (your domain) instead of its own. Once the d= value matches your From: domain, DKIM alignment passes and DMARC succeeds.
The exact steps vary by platform. Look for settings labeled "domain authentication," "custom DKIM," or "sender authentication" in the platform's documentation. Typically you add one or more CNAME records under a selector subdomain, like s1._domainkey.example.com, pointing to a key hosted by the platform.
If you use a third-party sender that signs with its own domain rather than yours, that is a well-known source of DMARC alignment failures. The pattern and fix for one popular platform is covered in Mailchimp Mail Passes DKIM but Fails DMARC? Check the d= Domain in the Headers.
Aligning SPF means making the envelope sender (Return-Path) use your domain. Some platforms support custom return-path domains, where bounces go to something like bounces.example.com instead of bounce.platform.net. You set up the subdomain, add the platform's IP addresses to its SPF record, and the envelope sender now shares the organizational domain with your From: header. SPF alignment passes under relaxed mode.
If you control the mail server directly (Exim, Postfix, or similar), alignment is simpler because the envelope sender and DKIM signing domain are both under your control by default. Misalignment on self-hosted servers usually means a misconfigured envelope sender, often caused by scripts or applications that set the MAIL FROM to something unexpected, like the server's hostname instead of the domain.
Relaxed versus strict: pick the right mode
DMARC alignment has two modes, controlled by the aspf and adkim tags in your DMARC DNS record:
- Relaxed (
aspf=r,adkim=r): the authenticated domain and theFrom:domain must share the same organizational domain.mail.example.comaligns withexample.com. - Strict (
aspf=s,adkim=s): exact match required.mail.example.comdoes not align withexample.com.
When these tags are omitted, relaxed is the default. Strict mode is rarely needed unless you have a specific reason to prevent subdomains from aligning with the parent domain. Starting with relaxed is the safer choice for most setups.
A DMARC record with relaxed alignment and a quarantine policy looks like this:
v=DMARC1; p=quarantine; adkim=r; aspf=r; rua=mailto:dmarc-reports@example.com
The rua tag tells receiving servers where to send aggregate reports, which show you how mail from your domain is being authenticated across the internet. Those reports are essential for spotting alignment failures before you move to p=reject.
The mental model that prevents this mistake
Think of SPF and DKIM as ID cards. Each one proves identity for a specific domain. DMARC is the bouncer who checks whether the name on at least one ID card matches the name on the guest list, which is the From: header domain. Having a valid ID is not enough if it belongs to someone else.
When troubleshooting mail delivery, check three things in order: Does SPF pass? Does DKIM pass? Does at least one of those passing results align with the From: domain? If the answer to the third question is no, DMARC fails, and that is almost certainly why the mail is landing in spam or getting rejected. Fix alignment by configuring your sending platform to authenticate under your domain, not its own, and confirm the fix by reading the Authentication-Results header on a test message.