Strip XML namespaces from DMARC reports before parsing - #53
Closed
max-dau wants to merge 2 commits into
Closed
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.