DMARC Aggregate Report 看不懂 XML 怎么解析?
DMARC 聚合报告(RUA)由接收方 MTA 每天或每批生成,XML 格式发送到 rua=mailto:dmarc@yourdomain.com。未经处理的原始 XML 嵌套复杂,手动阅读效率极低。
1. 在线解析(推荐):
— https://dmarcian.com/dmarc-report-parser/:拖入 XML 文件,可视化显示 SPF/DKIM/DMARC 通过率、IP 分布和失败原因。
— https://www.agari.com/tools/dmarc-report-analyzer/:同功能。
2. 命令行解析(适合批量):
安装 pip install opendmarc-parser 或 pip install parsedmarc,然后:parsedmarc -p report.xml -o output_dir
输出 CSV 和图形化摘要。
3. XML 关键字段速查:feedback/report_metadata/org_name → 报告来源(google.com、outlook.com 等)feedback/policy_published/p → 你发布的 DMARC 策略(none/quarantine/reject)feedback/record/row/source_ip → 发信源 IPfeedback/record/row/policy_evaluated/disposition → 实际处理:none/pass/quarantine/rejectfeedback/record/auth_results/dkim/domain 和 spf/domain → 认证结果
4. 自动化收集:用 parsedmarc 配置 parsedmarc.ini 自动拉取 IMAP 中的 RUA 报告、解析后存入 Elasticsearch 或 PostgreSQL,通过 Grafana 大屏监控。
RFC 7489 §7 (Aggregate Feedback Reports) · RFC 5965 (ARF) · DMARC.org specification §10.2 (Report Format)
