prbinu / dmarc-report-processor

Scripts to pull DMARC reports from your mailbox (imap client) and convert it to Splunk friendly comma-separated key-value format
Other
93 stars 24 forks source link

running dmarc-converter doesn't work #2

Closed lennyvaknine43 closed 7 years ago

lennyvaknine43 commented 7 years ago

Hi I have been trying to get this to work, by running dmarc-convertor, but running into errors saying: Step 1: Fetch dmarc reports from mailbox

usage: imap-client.py [-h] [-v] [--attachmentsonly] [--disablereadonly] [--quiet] -s HOST [-p PORT] -c CACERTS -u USER -f FOLDER -o OUTDIR [-S SEARCH] [-P PWDFILE] imap-client.py: error: argument -f/--folder: expected one argument Error: imap-client mail attachment fetch failed; exiting ...

prbinu commented 7 years ago

Seems like you are getting error with imap-client.py. Can you run imap-client.py separately and see if it works? From the error log, It seems like you are not passing valid -f flag argument.

lennyvaknine43 commented 7 years ago

I tried running imap-client.py

However it keeps wanting a cacert.pem and I spoke with google and they said there is no need for the cert. So I tried omitting that and commenting out the relevant code, but then I get a bunch of new errors:

Traceback (most recent call last): File "./imap-client.py", line 157, in main() File "./imap-client.py", line 137, in main mail = IMAP4_SSL_Ex(args.host, args.port) File "./imap-client.py", line 33, in init imaplib.IMAP4_SSL.init(self, host, port, keyfile = None, certfile = None) File "/usr/lib64/python2.7/imaplib.py", line 1160, in init IMAP4.init(self, host, port) File "/usr/lib64/python2.7/imaplib.py", line 172, in init self.open(host, port) File "./imap-client.py", line 42, in open ssl_version=self.ssl_version) File "/usr/lib64/python2.7/ssl.py", line 936, in wrap_socket ciphers=ciphers) File "/usr/lib64/python2.7/ssl.py", line 545, in init self._context.verify_mode = cert_reqs TypeError: an integer is required

prbinu commented 7 years ago

cacert.pem is the CA bundle file, and by default imap-client.py uses /etc/pki/tls/certs/ca-bundle.crt. If the file doesn't exist in your machine, program may fail.

We had cacert.pem as part of this repo, but got removed recently. Here is the file: https://raw.githubusercontent.com/prbinu/dmarc-report-processor/c025974903175298f5c68d5fb503c948734e52a9/cacert.pem

Try with the above file and see if it works.

prbinu commented 7 years ago

closing the ticket. please reopen if the issue is not resolved.