keltia / dmarc-cat

Small utility to decode the report sent by various email providers following the DMARC spec
Other
64 stars 13 forks source link

bad filename on XML file #2

Closed anarcat closed 5 years ago

anarcat commented 5 years ago

I'm getting an error while trying to make dmarc-cat parse an XML file from Google (as opposed to a ZIP) file:

anarcat@curie:Downloads(master)$ dmarc-cat 'google.com!orangeseeds.org!1548201600!1548287999.xml'
2019/01/24 15:28:14 error handling google.com!orangeseeds.org!1548201600!1548287999.xml: bad filename

I first thought it might not have liked the exclamation marks there, so I tried renaming the file:

anarcat@curie:Downloads(master)$ cp 'google.com!orangeseeds.org!1548201600!1548287999.xml' d.xml
anarcat@curie:Downloads(master)$ dmarc-cat d.xml
2019/01/24 15:28:24 error handling d.xml: bad filename

No luck there.

The README does say the usage is dmarc-cat -hvD <zipfile|xmlfile> - maybe that's an error and only ZIP files are supported? Those work correctly:

anarcat@curie:Downloads(master)$ dmarc-cat 'google.com!orangeseeds.org!1548201600!1548287999.zip'
dmarc-cat 0.9.1/j4 by Ollivier Robert

Reporting by: google.com — noreply-dmarc-support@google.com
From 2019-01-22 19:00:00 -0500 EST to 2019-01-23 18:59:59 -0500 EST

[...]

Thanks for the nice tool! It makes those reports much more useful...

keltia commented 5 years ago

Compress it, it will work. More seriously, it looks for .xml.gz or .xml.zip because that's what I've seen so far. I'll change the regex to match plain XML files as well. Classified as both bug and enhancement because the usage string says it is supported when in fact not.

keltia commented 5 years ago

Welcome v0.9.2 ;-)