Back to Articles

Email Authentication in Practice: Getting to DMARC Reject Without Breaking Mail

Contents

Three Records, Three Different Claims

A mid-size manufacturer published p=reject on a Tuesday afternoon because a compliance questionnaire asked for it. By Thursday, accounts payable had stopped receiving remittance confirmations, the fire alarm panel's nightly test email had gone silent for two days, and a customer had escalated because their purchase orders were bouncing. Nothing was wrong with the DMARC record. The problem was that nobody had counted the senders first.

This is the normal outcome. DMARC enforcement is not a DNS change; it is an inventory project that ends in a DNS change. The technical mechanisms are simple enough to explain in a paragraph each. The work is finding the eleven systems in your environment that send mail on your behalf and that nobody remembers buying.

Start with what each mechanism actually proves, because the three are routinely described as if they were three strengths of the same thing. They are not.

SPF (RFC 7208) authorizes hosts. You publish a TXT record listing the IP addresses and includes permitted to send for your domain. The receiving mail server — the MTA, or mail transfer agent — takes the domain from the SMTP MAIL FROM envelope, which is the addressing information the two servers exchange during delivery and not the From header the user sees, and checks whether the connecting IP is in that list.[1] SPF says "this machine was allowed to hand you mail for this envelope domain." It says nothing about the content, and nothing about the From header.

DKIM (RFC 6376) authorizes content. The sending system signs a canonicalized selection of headers plus the body with a private key, and stamps a DKIM-Signature header naming a domain (d=) and a selector (s=). The receiver fetches the public key from DNS and verifies.[2] A valid signature proves the signing domain vouched for those specific bytes, and it survives being relayed through hosts that were never in your SPF record — as long as nothing modified the signed parts.

DMARC (RFC 7489) ties either of those back to the visible From header, and adds the two things the other two lack: a policy the receiver should apply on failure, and reporting.[3] A message passes DMARC if SPF passes and the envelope domain aligns with the From domain, or DKIM passes and the signing domain aligns with the From domain. One is enough. Neither SPF nor DKIM alone stops someone putting [email protected] in the From header — that is entirely DMARC's job.

SPF (RFC 7208) DKIM (RFC 6376) DMARC (RFC 7489)
What is validated Connecting IP against a published list, keyed on the envelope MAIL FROM domain Cryptographic signature over selected headers and the body That an SPF or DKIM pass is aligned with the From header domain
Protects the visible From header No No (only the domain in d=) Yes — this is its entire purpose
Survives forwarding No — the forwarder's IP is not yours Usually, unless headers or body are modified Inherits whichever of the two survived
Survives mailing lists No Often not — subject tags and footers break the signature Typically fails; ARC or From-munging is the workaround
Provides a failure policy Advisory only (-all is a hint) No Yes — none, quarantine, reject
Provides reporting No No Yes — aggregate (RUA) and forensic (RUF)
Hard operational limit 10 DNS-querying mechanisms DNS TXT record size for 2048-bit keys None technical; the limit is your sender inventory

Note: Because DMARC passes on either aligned SPF or aligned DKIM, aligned DKIM is the one worth investing in. It survives forwarding, it does not consume DNS lookups, and it lets a third-party platform send as your domain without you ever adding their IP ranges to your SPF record.

SPF: The Ten-Lookup Cliff

RFC 7208 caps the number of DNS-querying mechanisms and modifiers that may be evaluated while checking one SPF record at ten. That budget is consumed by include, a, mx, ptr, exists, and redirect — and it is consumed recursively. An include that itself contains three includes costs you four, not one. Exceed ten and the evaluation returns permerror, which under DMARC is not a pass.[1]

There is a second, quieter limit: two "void lookups" — queries returning NXDOMAIN or no answer — also produce permerror. Stale includes for a vendor you stopped using three years ago will do this to you.

Here is a realistic record for an organization on Microsoft 365 with a marketing platform and a transactional relay:

; Actual record on the zone apex
example.com.   3600  IN  TXT  "v=spf1 include:spf.protection.outlook.com include:_spf.salesforce.com include:sendgrid.net ip4:203.0.113.20 ip4:198.51.100.64/28 -all"

; Count the DNS-querying mechanisms:
;   include:spf.protection.outlook.com   -> 1 + 2 nested = 3
;   include:_spf.salesforce.com          -> 1 + 3 nested = 4
;   include:sendgrid.net                 -> 1 + 1 nested = 2
;   ip4: mechanisms                      -> 0 (no DNS query)
;   TOTAL = 9 of 10.  One more vendor and this record permerrors.

Nested counts change when vendors restructure their records, without any warning to you. Check the current count rather than trusting the arithmetic above.

The usual response is SPF flattening: resolve every include to literal IP addresses and publish those. It works, and it is a genuine trade-off rather than a best practice. Flattening converts a dynamic delegation into a static snapshot. When SendGrid or Microsoft adds an egress range, your mail from that range starts failing SPF and you find out from a customer. If you flatten, automate it — a scheduled job that re-resolves the includes, diffs, and updates the zone via the DNS provider's API, with alerting on drift. A hand-flattened record edited once in 2023 is a landmine.

The less clever alternatives are usually better. Move low-volume senders onto a subdomain with its own SPF record (notify.example.com for the alerting stack, mail.example.com for the marketing platform), which gives each its own ten-lookup budget. Or relay everything through one smarthost so the apex record only ever needs one include. Or lean on aligned DKIM and stop treating SPF as the primary path.

Rule of Thumb: If your apex SPF record is above 8 of 10 lookups, you have a capacity problem, not a syntax problem. Move senders to subdomains before you reach for a flattening service — subdomain delegation is free and self-maintaining; flattening is a subscription plus a monitoring obligation.

Also note that SPF fails on ordinary forwarding. A user who auto-forwards from their corporate mailbox to a personal Gmail account causes Gmail to see the corporate MTA's IP, which is not in the original sender's SPF record. This is not a bug; it is the documented consequence of validating a transport path.

DKIM: Keys, Selectors, and Rotation

A DKIM public key lives at <selector>._domainkey.<domain> as a TXT record. The selector is arbitrary and exists precisely so you can have several keys live at once — which is what makes rotation and multi-vendor signing possible.

; 2048-bit RSA public key, split into 255-char strings because a single
; character-string in a TXT record cannot exceed 255 octets.
s2026a._domainkey.example.com. 3600 IN TXT (
  "v=DKIM1; k=rsa; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0x8k"
  "Qm7pV3nR1hLd9c2sYbW6uJf4TzKpA5mNeXvHgD1oCqRtYw8ZsB2iL0kU7jNfP6aMcE3vXhS"
  "9dGyKlOtQrZbn4WuIxA1pTfHmC8eVjRsLdBoY2gKNzUq5wMvXaEhJt7PcFiSrDlZmOnQbTy"
  "AkUwIDAQAB" )

; Verify what a receiver will actually see:
$ dig +short TXT s2026a._domainkey.example.com
$ dig +short TXT _dmarc.example.com
$ dig +short TXT example.com | grep spf1

RFC 8301 deprecated rsa-sha1 outright, set 1024 bits as the floor for signing keys, and recommends 2048.[4] Use 2048. Anything below 1024 will be treated as invalid by major receivers; 4096-bit keys work but add DNS payload for no meaningful gain at typical key lifetimes. Ed25519 signing is defined in RFC 8463, but verifier support remains uneven, so publish it alongside RSA rather than instead of it.

Rotation is where selectors earn their keep. The safe sequence is: publish the new selector's public key, wait for DNS propagation and TTL expiry, switch the signer to the new selector, wait out the retention window during which anything still in flight might be verified, then remove the old TXT record. Never overwrite a live selector in place. A sensible cadence is annual for normal domains and semi-annual for high-value ones — and immediately if a key is ever exposed, which is a real risk for keys that live in a SaaS console.

Name selectors so a future administrator can reason about them. s2026a, m365-01, sendgrid-tx are all fine. default and key1 are how you end up afraid to delete a record. Keep a table mapping selector to system, key size, creation date, and who owns the private key — that document is the rotation plan.

One caveat on the l= tag, which limits how many body octets are signed: it permits an attacker to append arbitrary content to a message while keeping the signature valid. Do not enable it.

Alignment Is the Part DMARC Actually Adds

Alignment is the mechanism that makes the visible From header meaningful. DMARC compares the From header domain against the domain that SPF authenticated (the envelope) and against the domain in the DKIM d= tag. Two modes are available per mechanism, set with aspf and adkim:

  • Relaxed (r, the default): the organizational domains must match. A DKIM signature from mail.example.com aligns with a From of example.com.
  • Strict (s): the fully-qualified domains must be identical. mail.example.com does not align with example.com.

Relaxed is the right default for essentially everyone. Strict alignment mostly succeeds at breaking your own subdomain senders while providing no protection against an attacker, who does not control any of your subdomains anyway. Use strict only where you have a specific reason and complete control of the sending path.

This is where most third-party sending fails. A marketing platform that sends with a From of [email protected] but a bounce domain of bounces.vendor-esp.net gets an SPF pass that does not align. If the same platform signs with d=vendor-esp.net, DKIM does not align either. The message authenticates perfectly and fails DMARC. The fix is always the same: have the vendor sign with a key published under your domain (they will give you CNAMEs for a selector), and where supported, set a custom return-path under your domain too.

Step One: Inventory Every Sending Source

Before touching a policy tag, enumerate everything that emits mail with your domain in the From header. In practice the list is longer than IT expects and includes systems no one considers "email":

  • The mail platform itself — Microsoft 365 or Google Workspace, plus any on-premises Exchange left in hybrid.
  • Marketing and CRM platforms: Salesforce, HubSpot, Marketo, Mailchimp, Constant Contact.
  • Transactional relays: SendGrid, Postmark, Amazon SES, Mailgun.
  • Ticketing and ITSM: Jira Service Management, ServiceNow, Freshdesk, Zendesk.
  • ERP and finance: invoice and remittance mail out of NetSuite, SAP, Dynamics, or a bolted-on AP automation tool.
  • HR and recruiting: Workday, Greenhouse, BambooHR — these send to candidates who will never tell you a message vanished.
  • Monitoring and alerting: Nagios, Zabbix, PRTG, Veeam backup reports, UPS and environmental sensors, RMM agents.
  • Vulnerability and compliance scanners mailing scheduled reports.
  • Line-of-business applications on a server that quietly uses an internal SMTP relay.
  • Multifunction printers with scan-to-email — genuinely one of the most common surprises.
  • Building systems: access control, fire panel, BMS, elevator monitoring.

Build the list from three directions at once: interview department owners, pull sending IPs from your existing gateway logs, and — once p=none is live — read the aggregate reports, which will find the sources everyone forgot. The reports are the authoritative source; the interviews just get you started faster.

For each source, record the From domain used, whether it can be configured for aligned DKIM, whether it supports a custom return-path, and the business impact if its mail were silently discarded. That last column is what determines your rollout order.

The Phased Path to Enforcement

Enforcement is a ramp, not a switch. A workable schedule for a mid-size organization runs eight to twelve weeks; larger estates with heavy third-party sending take longer, and there is no prize for finishing early.

; Phase 1 — monitor only. Zero delivery impact. Publish this first.
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]; ruf=mailto:[email protected]; fo=1; adkim=r; aspf=r"

; Phase 2 — quarantine a slice while the long tail is still being fixed.
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=quarantine; pct=25; rua=mailto:[email protected]; adkim=r; aspf=r"

; Phase 3 — full quarantine, and lock down subdomains explicitly.
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=quarantine; pct=100; sp=quarantine; rua=mailto:[email protected]; adkim=r; aspf=r"

; Phase 4 — enforcement.
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject; sp=reject; rua=mailto:[email protected]; adkim=r; aspf=r"

Phase 1 runs for at least two full billing and reporting cycles. Monthly invoicing, quarterly compliance mailers, and the annual open-enrollment blast from HR only appear in the data when they actually run. Thirty days of reports will miss all three.

Phase 2 is where pct earns its place: it applies the policy to a pseudo-random share of failing messages, so problems surface as a trickle rather than an outage. Ramp 25 to 50 to 100, watching reports and the help desk queue at each step. Note that the DMARC revision work in progress (DMARCbis) removes pct and adds an np tag for non-existent subdomains; confirm current receiver behavior rather than assuming either tag is honored forever.

The sp tag deserves its own decision. Without it, subdomains inherit the parent policy — which is usually what you want at reject, but is exactly what surprises people who have an unauthenticated subdomain sender they never inventoried. Set sp explicitly at Phase 3 so the behavior is a choice rather than an inheritance.

Promotion criterion: advance only after every authorized sender in the inventory is aligned or has an approved remediation plan, and report data covers representative business cycles. Review low-volume senders separately so a critical monthly process is not hidden by aggregate volume.

There is also external pressure to finish. Since February 2024, Google has required bulk senders — those sending more than 5,000 messages a day to Gmail — to publish SPF, DKIM, and a DMARC record of at least p=none, offer one-click unsubscribe, and keep reported spam rates below 0.3%.[5] Microsoft applied comparable requirements to consumer Outlook.com domains in May 2025.[6] The floor is now p=none everywhere; reject is where the actual anti-spoofing value is.

Reading RUA and RUF Without Losing Your Mind

The rua address receives aggregate reports: gzipped XML, typically once every 24 hours per reporting receiver, summarizing message counts by source IP, authentication result, and disposition. It contains no message content. It is the entire feedback loop for the rollout, and it is unreadable by hand — a single day for a mid-size domain can be dozens of XML files across Google, Microsoft, Yahoo, Comcast, and a dozen smaller providers.

Use a parser. The commercial platforms (Dmarcian, Valimail, Red Sift OnDMARC, Proofpoint's Email Fraud Defense) resolve sending IPs to recognizable vendor names, which is most of the value — knowing that 198.51.100.7 is your ticketing system saves hours. Open-source options such as parsedmarc feeding Elasticsearch or Splunk work well if you already run that stack and want the data alongside your other logs. Either way, budget for a person to look at it weekly, not just a tool to collect it.

ruf — forensic or failure reports — is a different animal. Reports contain full or redacted copies of individual failing messages, which means they carry your users' content and personal data. Most large receivers do not send them at all, partly for that reason. Send RUF to a controlled mailbox with a short retention period, consider whether your privacy posture permits it, and treat it as an optional diagnostic rather than part of the pipeline. The fo=1 tag requests a report when any mechanism fails rather than only when all do, which is more useful when it works.

Note: If your RUA mailbox is on the domain you are enforcing, keep it excluded from aggressive quarantine rules. Losing the reports that tell you the rollout is failing is an avoidable way to fly blind.

How Mail Breaks During Rollout

Every failure below is common, and every one is preventable by not skipping Phase 1.

The low-volume critical sender. An alerting system or monthly invoicing run may not appear in a short sample but can still be business-critical. Review reports by distinct source as well as volume, and make the observation window cover monthly, quarterly, and seasonal sending patterns that matter to the organization.

SPF permerror from too many lookups. Adding one vendor tips the record from ten to eleven, evaluation returns permerror, and every message relying on SPF for its DMARC pass starts failing at once. It is invisible until you check, because nothing warns you. Monitor the lookup count as a scheduled check, and re-check after any vendor onboarding.

Reject before considering subdomain policy. Subdomains inherit the parent policy in the absence of sp. Organizations that enforce at the apex without auditing subdomain senders break the help-desk notifier at support.example.com and the app that mails from alerts.example.com. Decide sp explicitly.

Mailing lists breaking DKIM. A list manager that prepends a subject tag, appends an unsubscribe footer, or converts MIME structure invalidates the signature over those bytes. SPF was already failing because the list is now the sender. The message therefore fails DMARC, and at p=reject the list's other subscribers stop receiving your posts — some list managers will unsubscribe them for bouncing. The mitigations are ARC-aware receivers, or the list rewriting the From header (Mailman's DMARC mitigation actions), which is ugly but effective and largely how the ecosystem coped.

Third parties sending unaligned. A vendor authenticates with their own domain, passes SPF and DKIM cleanly, and still fails DMARC because neither result aligns with your From header. Reports will show this as a source with SPF pass, DKIM pass, and DMARC fail — which looks like a contradiction until you remember alignment is a separate check. The fix is vendor-side configuration, and some low-end platforms simply cannot do it. That is a procurement finding, not a DNS problem.

Two more worth watching for: mergers and acquisitions, where an acquired entity's mail flows under your domain with none of its senders inventoried; and a DNS TTL of 86400 on the DMARC record, which turns "roll it back" into a next-day operation. Drop the TTL to 300 before any policy change and raise it afterwards.

MTA-STS, TLS-RPT, ARC, and BIMI

DMARC covers authentication of the sender. Three adjacent controls cover things it does not.

MTA-STS (RFC 8461) addresses transport. SMTP's opportunistic TLS is trivially downgradeable by an active attacker who strips the STARTTLS capability. MTA-STS lets you publish a policy — over HTTPS at mta-sts.<domain>, advertised by a DNS TXT record — declaring that senders must use TLS with a valid certificate matching your MX hosts.[7] Publish it in testing mode first, pair it with TLS-RPT (RFC 8460) to receive reports on negotiation failures, then move to enforce. It requires you to run and monitor an HTTPS endpoint, which is the cost.

ARC (RFC 8617) addresses the forwarding problem directly. An intermediary that modifies a message can attach an Authentication-Results chain attesting to what the authentication results were when it received the message, letting the final receiver make an informed decision instead of a blind failure.[8] You do not deploy ARC so much as benefit from receivers and forwarders that implement it. It does not repair a broken DMARC result on its own — it gives a receiver grounds to override.

BIMI is the downstream benefit people ask for by name: your logo displayed next to authenticated messages in supporting mailboxes. It requires DMARC enforcement at quarantine or reject with no partial application, an SVG Tiny PS logo, and — for Gmail and Apple Mail — a Verified Mark Certificate from an authorized CA, which is a recurring cost of roughly a thousand dollars a year plus trademark registration. Treat it as a marketing outcome that pays for the security work, not a reason to do it.

The Inbound Side and What DMARC Does Not Solve

Publishing a policy protects other people from mail forged as you. Honoring other domains' policies on your inbound mail is a separate configuration, and it is the half that protects your own users.

In Microsoft 365, this means confirming that anti-phishing policies honor the sender's DMARC record and setting the actions for p=quarantine and p=reject senders explicitly rather than leaving defaults. On a Postfix or Exim gateway it means running an OpenDMARC or Rspamd milter and acting on the result. Whatever the platform: verify with a test message that a domain publishing p=reject and failing authentication is actually being rejected. Many environments collect the verdict and do nothing with it.

Now the limits, because DMARC is routinely oversold:

  • Display-name spoofing. A message From "Jane Doe, CEO" <[email protected]> passes DMARC perfectly — for gmail.com. Mobile clients show the display name and hide the address. DMARC has no view on this. You need anti-impersonation rules that flag messages whose display name matches an executive but whose domain is external.
  • Lookalike domains. yourcompany-billing.com, or an IDN homoglyph — an internationalized domain name registered with non-Latin characters that render almost identically to the real ones, so the address looks correct on screen — can publish its own perfectly valid SPF, DKIM, and DMARC. It authenticates because it is authentic — it just is not you. Countermeasures are domain monitoring, takedown processes, and inbound rules for newly-registered and typo-adjacent domains.
  • Compromised legitimate accounts. Mail sent from a real, hijacked mailbox in your tenant is fully authenticated and fully aligned. DMARC is the wrong control entirely; MFA, conditional access, and impossible-travel detection are the right ones.
  • Content. DMARC says who sent it, never whether it is malicious. It sits alongside your filtering, not in front of it.
DMARC answers exactly one question: is this message really from the domain it claims? Every threat that does not depend on lying about the domain passes straight through it.

Parked and Non-Sending Domains

Most organizations own more domains than they send from: defensive registrations, typo variants, the brand acquired in 2019, the country-code equivalents. Every one of them is a free identity for an attacker if left unconfigured, and they are attractive precisely because nobody watches them.

; Non-sending domain: no mail, ever, in either direction.
parked-example.com.        3600 IN TXT  "v=spf1 -all"
_dmarc.parked-example.com. 3600 IN TXT  "v=DMARC1; p=reject; sp=reject; rua=mailto:[email protected]"
*._domainkey.parked-example.com. 3600 IN TXT "v=DKIM1; p="

; Null MX (RFC 7505) — tells senders this domain accepts no mail at all,
; so they fail immediately instead of retrying for days.
parked-example.com.        3600 IN MX   0 .

The null MX record from RFC 7505 signals that a domain accepts no inbound mail, letting sending MTAs generate an immediate permanent failure rather than queueing and retrying.[9] The wildcard DKIM record with an empty p= tag revokes any selector, so no signature can validate. Together with v=spf1 -all and p=reject, that is four records per domain and perhaps ten minutes of work — the highest security-per-minute ratio in this entire article.

Rule of Thumb: Lock down parked domains first. They carry zero delivery risk because no legitimate mail exists to break, so they can go straight to p=reject on day one while the primary domain is still at p=none. Do these the same afternoon you start the inventory.

Finally, keep the whole thing under change control. The domains, selectors, key ages, sender inventory, and current policy tags belong in a document that outlives the person who ran the project. Email authentication does not stay correct on its own — every new SaaS purchase is a chance to quietly break it, and the failure mode is mail that silently does not arrive.

The Bottom Line

Inventory every system authorized to send mail for the domain. Publish one valid SPF record containing only required mechanisms, enable DKIM signing for each sender, and publish DMARC with aggregate reporting. Use the reports to find unrecognized or misconfigured senders, correct alignment problems, and then move from monitoring toward quarantine or rejection according to measured impact. Keep the inventory and records under change control so new mail services do not silently bypass the design.


References

  1. Kitterman, S. — "Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1." IETF RFC 7208, 2014.
  2. Crocker, D., Hansen, T., Kucherawy, M. (Eds.) — "DomainKeys Identified Mail (DKIM) Signatures." IETF RFC 6376, 2011.
  3. Kucherawy, M., Zwicky, E. (Eds.) — "Domain-based Message Authentication, Reporting, and Conformance (DMARC)." IETF RFC 7489, 2015.
  4. Kitterman, S. — "Cryptographic Algorithm and Key Usage Update to DomainKeys Identified Mail (DKIM)." IETF RFC 8301, 2018.
  5. Google — "Email sender guidelines." Google Workspace Admin Help, requirements effective February 2024.
  6. Microsoft — "Strengthening Email Ecosystem: Outlook's New Requirements for High-Volume Senders." Microsoft Community Hub, 2025.
  7. Margolis, D., Risher, M., Ramakrishnan, B., Brotman, A., Jones, J. — "SMTP MTA Strict Transport Security (MTA-STS)." IETF RFC 8461, 2018.
  8. Andersen, K., Long, B., Blank, S., Kucherawy, M. (Eds.) — "The Authenticated Received Chain (ARC) Protocol." IETF RFC 8617, 2019.
  9. Levine, J., Delany, M. — "A 'Null MX' No Service Resource Record for Domains That Accept No Mail." IETF RFC 7505, 2015.
← Back to Articles ← Previous: Network Access Control Next: Infrastructure as Code with Terraform →