tierpod / dmarc-report-converter

Convert dmarc reports from xml to human-readable formats
MIT License
241 stars 25 forks source link

Handle multiple auth results #51

Closed moorereason closed 6 months ago

moorereason commented 6 months ago

This PR attempts to resolve #45. From the main commit message:

The DMARC spec allows for zero or more DKIM results and one or more SPF results. Prior to this commit, we only allowed for a single result for each type. Update the dmarc.AuthResults struct to use a slice for each type.

For reference, see the definition of AuthResultType in Appendix C of RFC 7489.

This change in the data model required updates to the Go templates. The two HTML templates are almost exactly the same, so pull the common body out into a separate const variable to ease maintenance.

Additional comments to help evaluate the code changes:

moorereason commented 6 months ago

I forgot to mention that this PR is a breaking change for the JSON output since the data model changes. If anyone has automatic processing of the JSON output, they'll need to update their code.

tierpod commented 6 months ago

Great! Thank you

breaking change for the JSON output

I'll mention it in UPGRADING.md for the next release :+1: