Skip to content

Strip XML namespaces from DMARC reports before parsing - #53

Closed
max-dau wants to merge 2 commits into
jgosmann:mainfrom
max-dau:strip-xml-namespaces
Closed

Strip XML namespaces from DMARC reports before parsing#53
max-dau wants to merge 2 commits into
jgosmann:mainfrom
max-dau:strip-xml-namespaces

Conversation

@max-dau

@max-dau max-dau commented Apr 4, 2026

Copy link
Copy Markdown

First of all, thanks for the great work, this tool is very handy!

Some email providers use XML namespaces in their DMARC reports. One example of this is german email provider GMX. Their DMARC reports use <feedback xmlns="urn:ietf:params:xml:ns:dmarc-2.0">. The current version of this project cannot handle such reports (or any reports using an XML namespace). However, these reports do not require specific logic to process because they otherwise look identical to reports from e.g. Google, which do not use an XML namespace. The current version of this project produces an empty result on reports with a namespace.

This PR adds a test to check whether DMARC reports with an additional XML namespace are processed correctly. Before parsing any report, this commit adds a step to strip any XML namespaces from the report. With this change, DMARC reports from e.g. GMX are parsed successfully.

Generative AI was used in writing this pull request.

Please let me know if you would like me to make any changes or adjustments to this PR before merging, I am happy to improve it.

@jgosmann

Copy link
Copy Markdown
Owner

Those DMARC reports seem to follow a new draft standard and their XSD is not exactly identical to the XSD from the RFC 7489. While the overlap might be large enough for dmarc-metrics-exporter to not matter much in practice, a proper implementation would use a parser based on the new XSD instead of simply removing the namespace. I implemented this approach in #54.

@jgosmann jgosmann closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants