Domain-based Message Authentication, Reporting and Conformance (DMARC)

DMARC ties SPF and DKIM to the From: header the recipient actually sees, tells receiving servers what to do when neither authenticates, and sends the domain owner reports about who is sending mail as their domain.

It is defined in RFC 7489. Without it, SPF and DKIM authenticate identifiers a recipient never looks at, and a message can pass both while displaying any sender address at all.

What does a DMARC record look like?

A TXT record at the _dmarc subdomain:

$ dig +short TXT _dmarc.example.com
"v=DMARC1; p=reject; rua=mailto:dmarc@example.com; adkim=s; aspf=s"
Tag Meaning
p= policy: none, quarantine or reject
sp= a different policy for subdomains
rua= where to send aggregate reports
ruf= where to send forensic reports, rarely supported
pct= apply the policy to only this percentage of mail
adkim= / aspf= alignment mode, r relaxed (default) or s strict

What is alignment, and why does it matter?

Alignment is the entire point of DMARC. A message passes DMARC when at least one of the following holds:

Without alignment, an attacker registers attacker.example, publishes a valid SPF record and signs with a valid DKIM key for it, then sends mail with From: billing@yourbank.example. Both checks pass — for the wrong domain. Alignment is what makes that fail.

Relaxed alignment (r) accepts an organisational-domain match, so mail.example.com aligns with example.com. Strict (s) requires an exact match, which is more rigorous and more likely to break a third-party sender.

What do the policies do?

Only p=reject actually stops someone spoofing your domain. A record with p=none that has sat unchanged for three years is a very common state and provides no defence against the attack vector it was published to address.

How do you roll DMARC out safely?

The order matters, because going straight to p=reject will block your own mail from services you have forgotten about:

  1. Publish p=none with a rua= address. Change nothing else.
  2. Read the aggregate reports for a few weeks. They will list every source sending as your domain — including the CRM, the invoicing system and the monitoring host nobody documented.
  3. Fix each legitimate source so it either passes aligned SPF or is signed with an aligned DKIM key. Sources you do not recognise are the ones DMARC exists to stop.
  4. Move to p=quarantine, optionally with pct= to ramp gradually.
  5. Move to p=reject once the reports show no legitimate failures.

Steps 2 and 3 are the work. Steps 1, 4 and 5 are DNS edits.

What are aggregate reports?

Receiving providers send a daily XML summary to the rua= address, grouped by source IP:

<record>
  <row>
    <source_ip>192.0.2.25</source_ip>
    <count>184</count>
    <policy_evaluated>
      <disposition>none</disposition>
      <dkim>pass</dkim>
      <spf>fail</spf>
    </policy_evaluated>
  </row>
  <identifiers>
    <header_from>example.com</header_from>
  </identifiers>
</record>

These are the most useful inventory of your own sending infrastructure you will ever get, and they arrive whether or not you asked for the inventory. Reading them raw is unpleasant at volume, so most operators feed them into a parser.

What DMARC does not solve

Howto block Google Groups spam in Rspamd is worth reading alongside this page. The spam described there passes DMARC, because it is sent by the infrastructure the domain authorised. DMARC answers “is this domain really the sender”, never “is this message wanted”.