DMARC Report Validator
The DMARC Report Validator is a Python tool for validating DMARC aggregate reports (RUA) against an XML Schema Definition (XSD). Its purpose is to identify syntax errors in aggregate reports.
- Validates a single report or a folder with reports against an XSD file.
- Supports compressed .gz or .zip reports.
- Supports .eml (RFC 5322) files with reports included in the body or as MIME multipart attachment.
- Adds a missing XML namespace declaration on the fly, which most reporters omit but which is necessary for XML Schema validation.
$ python3 rua-validator.py report.xml rua.xsd Validating report.xml ... OK
- DMARC RFC 7489 points to the XML target namespace http://dmarc.org/dmarc-xml/0.1, which contains a
rua.xsdfile. This is not the XML Schema from RFC 7489, but an older one. However, many reporters use the old schema. One of the most prominent differences is the lack of the
- The DMARC Report Validator ships with a
rfc7489.xsdfile, which (unsurprisingly) is the XML Schema from RFC 7489.
- Both schemata use an improper regex for IP addresses, which will trigger validation errors on valid IPv6 addresses. Use the fixed
- The RFC 7478 schema requires the field
<identifiers>section. This will trigger validation errors on reported bounces, because bounces are supposed to use a null reverse-path (i.e., no Envelope-From). Use
rfc7489_v6_envfrom.xsdto fix this issue.