techsneeze/dmarcts-report-parser

Fails with DMARC reports from every Mailbox Provider with no error detail

davidfavor opened this issue · 2 comments

For example...
{{{

dmarcts-report-parser -x /dmarc/2019/11/08/1573224396.M356010P333496.net14-hivelocity,S=5425,W=5540:2,a

Unable to recognise encoding of this document at /usr/local/share/perl/5.26.1/XML/SAX/PurePerl/EncodingDetect.pm line 100.
The xml file </dmarc/2019/11/08/1573224396.M356010P333496.net14-hivelocity,S=5425,W=5540:2,a> does not seem to contain a valid DMARC report. Skipped.
}}}
Likely this is because this tool can't actually parse real DMARC reports, which normally arrive as base64 encoded messages.

This means there's an extra step which must be done, which is... missing from docs...

If a file is an email message, the message must be decoded into the actual .xml file, rather than just be a mail file.

It's working fine for me with my Dovecot IMAP server. I'm receiving RUA reports from Google and Comcast.

Your example is telling the script that you're passing an XML file, but the filename is that of an email in a Maildir folder. I think you want -e, not -x. The script should then extract the attachment and process it.

Based on your description, you seem to be looking for something more like what John had done in : https://www.taugh.com/rddmarc/
That script is intended to point to a local Linux mail folder to parse reports.
His script inspired this project, which wanted to accomplish something similar, but from an IMAP server. There is the ability to point our parser at an XML file as well, but not at the whole mail message. In an effort to not duplicate efforts, you'd want to look at the script above. I hope that clarifies things!