Skip to content

Security operations

How to Read a DMARC XML Report: Records, Alignment and Fixes

Read a DMARC aggregate XML report line by line: source IPs, SPF and DKIM alignment, dispositions and the fixes for each failing sender, with real commands.

By Asad Ali, IT Support EngineerSC-200 · ISC2 CCPublished 7 min read
DMARC Aggregate Report Flow: Zip or Gz Attachment Unpacked to XML, Records Grouped by Source IP, Aligned SPF and DKIM Results and a Fix for Each Failing Sender
DMARC Aggregate Report Flow: Zip or Gz Attachment Unpacked to XML, Records Grouped by Source IP, Aligned SPF and DKIM Results and a Fix for Each Failing Sender

You published a DMARC record with a rua= address, and now an inbox fills with files named like google.com!example.com!1795132800!1795219199.zip. Each one is a DMARC aggregate report: an XML summary of every message a receiver saw that claimed to be from your domain. This guide reads one report from top to bottom, explains each field, and turns the failing rows into concrete DNS and sender fixes.

The fastest way to read one is to drop the .zip, .gz or .xml into the DMARC Report Analyzer, which unpacks and parses it in your browser, so the report never reaches a third-party dashboard. Knowing what the XML says is still what lets you act on it, so we read it by hand first.

How do you get the XML out of a DMARC report attachment?

Google sends .zip files, Microsoft and Yahoo send .xml.gz, and a few small providers send plain .xml. Unzip or gunzip the attachment, then pretty-print the XML.

Linux / macOS
unzip -p 'google.com!example.com!1795132800!1795219199.zip' > google.xml
gunzip -c 'enterprise.protection.outlook.com!example.com!1795132800!1795219199.xml.gz' > microsoft.xml

# Pretty-print so the structure is readable
xmllint --format google.xml | less

On Windows, Expand-Archive handles the .zip. For .gz, use 7-Zip, Git Bash's gunzip, or drop the file into the analyzer.

What do report_metadata and policy_published mean?

report_metadata says which receiver sent the report and which UTC day it covers; policy_published is your DMARC record exactly as that receiver resolved it.

The first two blocks of every report
<report_metadata>
  <org_name>google.com</org_name>
  <email>noreply-dmarc-support@google.com</email>
  <report_id>13379526540218311822</report_id>
  <date_range><begin>1795132800</begin><end>1795219199</end></date_range>
</report_metadata>
<policy_published>
  <domain>example.com</domain>
  <adkim>r</adkim><aspf>r</aspf>
  <p>quarantine</p><sp>quarantine</sp><pct>100</pct>
</policy_published>
  • `date_range` is in Unix seconds, UTC. date -u -d @1795132800 prints Fri Nov 20 00:00:00 UTC 2026 (on macOS use date -u -r 1795132800). One report covers one day.
  • `policy_published` should match what you think you published. If it doesn't, check DNS before anything else: dig +short TXT _dmarc.example.com.
  • `adkim` and `aspf` are the alignment modes. r (relaxed, the default) accepts any subdomain of the same organizational domain; s (strict) needs an exact match.
  • `pct` is the share of failing mail the policy applies to. p=quarantine; pct=25 quarantines a quarter of failures and delivers the rest.

How do you read a DMARC record row?

Read source_ip and count, then the aligned results in policy_evaluated, then the raw results in auth_results, then the disposition. DMARC passes when either aligned result is pass.

One record: 310 messages from one IP
<record>
  <row>
    <source_ip>198.51.100.24</source_ip>
    <count>310</count>
    <policy_evaluated>
      <disposition>none</disposition>
      <dkim>pass</dkim>
      <spf>fail</spf>
    </policy_evaluated>
  </row>
  <identifiers>
    <header_from>example.com</header_from>
    <envelope_from>bounces.mailer.example.net</envelope_from>
  </identifiers>
  <auth_results>
    <dkim><domain>example.com</domain><selector>s1</selector><result>pass</result></dkim>
    <spf><domain>bounces.mailer.example.net</domain><scope>mfrom</scope><result>pass</result></spf>
  </auth_results>
</record>
  1. `source_ip` and `count`: 310 messages from one IP that day.
  2. `policy_evaluated/dkim` and `/spf`: the aligned results DMARC used.
  3. `auth_results`: the raw results. SPF passed, but for bounces.mailer.example.net, which is not example.com, so aligned SPF is fail. DKIM passed with d=example.com, so the message passes DMARC anyway.
  4. `disposition`: what the receiver did (none, quarantine or reject). It can differ from your policy because of pct, a local override, or a forwarding exception listed in <reason>.

"SPF pass" in auth_results and "SPF fail" in policy_evaluated mean the same mail was authenticated for someone else's domain. That gap explains most failing DMARC rollouts.

How do you turn records into a sender table?

Group records by source IP and count messages, aligned results and dispositions. Failing sources go to the top, because those are the ones to fix or block.

One day of Google reports for example.com (documentation IP ranges)
Source IPMessagesDKIM alignedSPF alignedDispositionVerdict
203.0.113.101,240passpassnoneYour own mail server, healthy
198.51.100.24310passfail (vendor envelope)noneNewsletter platform, passes on DKIM only
192.0.2.7742failfailquarantineUnknown sender using your domain
203.0.113.2009failfailquarantineUnknown sender using your domain

Totals: 1,601 messages, 1,550 passed DMARC (96.8%), 51 quarantined. The DMARC Report Analyzer builds exactly this view with failing sources first, combines a week of reports from several receivers, and Copy output gives you the rows as CSV for a spreadsheet or SIEM.

Totals and failing IPs with xmllint
xmllint --xpath 'sum(//record/row/count)' google.xml
xmllint --xpath '//record[row/policy_evaluated/dkim="fail" and row/policy_evaluated/spf="fail"]/row/source_ip/text()' google.xml

How do you fix each failing source?

Identify who owns the IP, then match the pattern: SaaS senders need custom DKIM, your own servers need SPF and signing, forwarding needs nothing, and spoofing is what enforcement blocks.

Look up the owner first with dig +short -x 192.0.2.77 for the PTR name, then compare it with the vendors you know send mail for you.

Failing patterns and their fixes
Pattern in the reportMost likely causeFix
DKIM fail, raw SPF pass for a vendor domainSaaS sender (CRM, helpdesk, billing) not set up for your domainEnable custom DKIM in the vendor (usually CNAMEs such as s1._domainkey) and a custom return-path if offered
DKIM pass, but d= is the vendor domainVendor signs with its own keyConfigure DKIM with d=yourdomain
Raw SPF fail, DKIM pass, reason forwardedForwarding or a mailing listNothing for SPF; DKIM carries the pass unless the list modifies the body
Both fail, unknown IP and PTR, small countsSpoofingNothing to fix; enforce p=quarantine or p=reject
Both fail, your own IPServer not in SPF and not signingAdd the IP or include to SPF and enable DKIM signing
Check DNS before and after each fix
dig +short TXT example.com | grep spf1          # the SPF record
dig +short TXT s1._domainkey.example.com        # a DKIM public key (selector s1)
dig +short TXT _dmarc.example.com               # the DMARC record
nslookup -type=TXT _dmarc.example.com           # Windows
Resolve-DnsName -Type TXT _dmarc.example.com | Select-Object -ExpandProperty Strings   # PowerShell

When you add vendors to SPF, count DNS lookups: every include, a, mx, ptr, exists and redirect costs one, and more than 10 makes SPF return permerror, which turns every SPF result into a fail. The SPF and DMARC generator counts lookups as you build the record and lints the DMARC tags.

When is it safe to tighten the DMARC policy?

After two to four weeks of reports in which every legitimate source passes through DKIM or SPF alignment and the only failures are unknown IPs and forwarders.

  1. Every legitimate source passes DMARC through DKIM or SPF alignment. Rare senders such as quarterly invoices need the longer window.
  2. Remaining failures are unknown IPs, forwarders, or both.
  3. Move p=none to p=quarantine, optionally with pct=25, then 50 and 100.
  4. Keep reading reports for another two to four weeks, then move to p=reject.

Since February 2024, Gmail and Yahoo require a DMARC record from anyone sending more than about 5,000 messages a day to their users, so p=none is the floor for bulk senders. Enforcement is what actually stops spoofing.

Why do DMARC reports look wrong?

Missing reports usually mean an unauthorized external rua mailbox; unexpected dispositions are explained by the reason element; mismatched counts come from per-receiver, per-day reporting.

  • No reports arrive. Reports take 24 to 48 hours to start. If your rua mailbox is on another domain (for example dmarc@reports.example.net), that domain must publish v=DMARC1 at example.com._report._dmarc.reports.example.net, or receivers silently drop the reports.
  • Reports for a subdomain you don't use. Spoofers like billing.example.com. If no subdomain sends mail, sp=reject closes the gap while you keep p lower.
  • The same IP appears twice. A record is one IP plus one combination of results, so a relay that signs some messages and not others produces two records. Group by IP to see the total.
  • `count` doesn't match your sending logs. Each report covers only mail that one receiver evaluated in one UTC day. Mail sent to other providers isn't in Google's report.
  • `disposition` is `none` despite `quarantine`. Check <reason><type>: forwarded, sampled_out (from pct), trusted_forwarder, mailing_list and local_policy all explain an override.
  • The XML has a namespace prefix such as <dmarc:record>. Parsers matching exact tag names miss everything. The analyzer accepts prefixed tags; in xmllint, use //*[local-name()="record"].

Aggregate reports never contain message content. If a failing source worries you, find a sample in your own mail and open it in the email header analyzer: its Authentication-Results header shows the same verdicts for that single message, with the full relay path. The EML and MSG guide walks through reading it.

Frequently asked questions

Most receivers send one report per day per reporting domain, covering a UTC day. You can request another interval with the ri tag, but large receivers usually ignore it and keep sending daily.

Try it in your browser

About the author: Asad Ali

IT Support Engineer and SOC analyst · Microsoft SC-200 & ISC2 CC certified

Asad Ali is an IT Support Engineer and SOC analyst with a Computer Science degree from UET Lahore. He holds the Microsoft SC-200 Security Operations Analyst and ISC2 Certified in Cybersecurity (CC) certifications, works on threat detection, network analysis and Linux administration, and builds and maintains every tool on LocalSecTools.

  • Microsoft Certified: Security Operations Analyst (SC-200)
  • ISC2 Certified in Cybersecurity (CC)

Every guide is written and technically reviewed by Asad Ali, and the commands and numbers are checked against the LocalSecTools calculators. Read more about his work at asadali.tech.

More engineering guides