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

Accept files on STDIN #14

Closed kostecke closed 3 years ago

kostecke commented 3 years ago

It would be useful if dmac-cat accepted input on STDIN so that it could be used in a pipe.

This would allow dmarc reports to be read directly from an e-mail message without having to perform busy work with temporary files.

I'd like to be able to do this:

mhstore -noverbose -outfile - | funzip | dmarc-cat

keltia commented 3 years ago

You can use stdin mode, specify - as the file name and -t for the file type.

kostecke commented 3 years ago

Thanks for the tip!

anarcat commented 1 year ago

could this also be tweaked so that ZIP files are handled as well? right now if you pipe a ZIP file into dmarc-cat, it fails:

    $ cat report.zip | dmarc-cat -t .zip -
    2022/11/09 12:34:38 Error: file -:: unmarshall: XML syntax error on line 2: illegal character code U+0003

dixit https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=999578#24