DKIM Alignment Explained — What Fails vs What Passes (Blue Canoe)
Last updated: 2025‑09‑09 • Owner: Blue Canoe
DKIM signs mail with a domain (d=) using a private key. Receivers fetch your public key via DNS and verify the signature. DMARC then checks whether that DKIM domain aligns with the visible From: domain.
1) Alignment basics
- Relaxed alignment (
adkim=r) —From: brand.comaligns with DKIMd=sub.brand.com(subdomains allowed). - Strict alignment (
adkim=s) — requires exact match betweenFrom:domain and DKIMd=(no subdomain drift).
Either SPF or DKIM can provide alignment for DMARC to pass. In practice, you want DKIM pass + alignment as the reliable path (SPF breaks on forwarding).
2) What to configure with vendors
When onboarding a sender (newsletters, CRM, helpdesk, etc.):
- Custom DKIM: Ask the vendor to sign with your domain (ideally the organizational domain, e.g.,
blue-canoe.com). They’ll give you one or moreselector._domainkey.blue-canoe.comCNAME/TXT records. - Envelope choices: Set the visible From: to a domain that you control and that matches your DKIM
d=policy (strict vs relaxed). - SPF (optional safety net): Include their envelope domain, but don’t rely on SPF for DMARC pass through forwarders.
- Subdomain strategy: If they can’t sign as
blue-canoe.com, use a subdomain likemail.blue-canoe.comand keepadkim=runtil you can consolidate.
Goal state: All vendors sign as
d=blue-canoe.com(or a small set of well‑known subdomains), using 2048‑bit keys and rotating selectors periodically.
3) Alignment pass/fail examples
Pass (relaxed):
- From:
hello@blue-canoe.com, DKIMd=mailer.blue-canoe.com,adkim=r→ aligns. - From:
alerts@mail.blue-canoe.com, DKIMd=mail.blue-canoe.com→ aligns.
Fail (strict):
- From:
hello@blue-canoe.com, DKIMd=mailer.blue-canoe.com,adkim=s→ fails (subdomain mismatch).
Fail (any mode):
- From:
hello@blue-canoe.com, DKIMd=vendor-mail.com→ fails (different org domain).
4) Testing & keys
- Use a throwaway alias at a major provider (e.g., Gmail) and inspect
Show original/headers. - Ensure selectors are 2048‑bit and published at
selector._domainkey.domain.tld. - Rotate keys annually or per vendor risk. Retire unused selectors to reduce attack surface.
- Keep body canonicalization stable (
relaxed/relaxedis typical), avoid ESPs that rewrite your From: mid‑flight.
5) Troubleshooting alignment
- Forwarding: SPF fails commonly; ensure DKIM pass + alignment.
- Multiple brands: Either split by subdomain or different From: domains with matching
d=per brand. - ESP “friendly from”: Some ESPs rewrite the friendly name; ensure the domain part remains your brand.
- DMARC at reject: Temporarily set
pct=to stage changes; useruato watch impact before 100% enforcement.
6) TL;DR rollout
- Ensure every sender signs with a DKIM
d=you control. - Keep DMARC
adkim=rduring migration. - Move to
adkim=sonce everything signs as the parent domain.