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.
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.
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 | lessOn 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.
<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 @1795132800printsFri Nov 20 00:00:00 UTC 2026(on macOS usedate -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=25quarantines 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.
<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>- `source_ip` and `count`: 310 messages from one IP that day.
- `policy_evaluated/dkim` and `/spf`: the aligned results DMARC used.
- `auth_results`: the raw results. SPF passed, but for
bounces.mailer.example.net, which is notexample.com, so aligned SPF isfail. DKIM passed withd=example.com, so the message passes DMARC anyway. - `disposition`: what the receiver did (
none,quarantineorreject). It can differ from your policy because ofpct, 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.
| Source IP | Messages | DKIM aligned | SPF aligned | Disposition | Verdict |
|---|---|---|---|---|---|
| 203.0.113.10 | 1,240 | pass | pass | none | Your own mail server, healthy |
| 198.51.100.24 | 310 | pass | fail (vendor envelope) | none | Newsletter platform, passes on DKIM only |
| 192.0.2.77 | 42 | fail | fail | quarantine | Unknown sender using your domain |
| 203.0.113.200 | 9 | fail | fail | quarantine | Unknown 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.
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.xmlHow 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.
| Pattern in the report | Most likely cause | Fix |
|---|---|---|
| DKIM fail, raw SPF pass for a vendor domain | SaaS sender (CRM, helpdesk, billing) not set up for your domain | Enable 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 domain | Vendor signs with its own key | Configure DKIM with d=yourdomain |
Raw SPF fail, DKIM pass, reason forwarded | Forwarding or a mailing list | Nothing for SPF; DKIM carries the pass unless the list modifies the body |
| Both fail, unknown IP and PTR, small counts | Spoofing | Nothing to fix; enforce p=quarantine or p=reject |
| Both fail, your own IP | Server not in SPF and not signing | Add the IP or include to SPF and enable DKIM signing |
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 # PowerShellWhen 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.
- Every legitimate source passes DMARC through DKIM or SPF alignment. Rare senders such as quarterly invoices need the longer window.
- Remaining failures are unknown IPs, forwarders, or both.
- Move
p=nonetop=quarantine, optionally withpct=25, then 50 and 100. - 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
ruamailbox is on another domain (for exampledmarc@reports.example.net), that domain must publishv=DMARC1atexample.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=rejectcloses the gap while you keepplower. - 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(frompct),trusted_forwarder,mailing_listandlocal_policyall 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; inxmllint, 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
- DMARC Report AnalyzerDrop DMARC aggregate XML, .gz or .zip reports to see sending IPs, DKIM/SPF alignment, pass rates and dispositions.
- SPF & DMARC GeneratorBuild SPF and DMARC TXT records visually and diagnose common DMARC policy errors.
- EML & MSG ViewerOpen .eml and Outlook .msg files locally: routing hops, SPF/DKIM/DMARC, sender anomalies, links and attachment hashes.
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.