domainaware / parsedmarc

A Python package and CLI for parsing aggregate and forensic DMARC reports
https://domainaware.github.io/parsedmarc/
Apache License 2.0
981 stars 212 forks source link

IMAP errors : authent with gmail, ssl wrong version with another domain #340

Open renoproc opened 2 years ago

renoproc commented 2 years ago

Hi, I've a fresh install on a ZorinOS 16 (Ubuntu 20.04) following this tuto https://www.linuxbabe.com/mail-server/parsedmarc-ubuntu-20-04, the service is working (out of a CRITICAL:cli.py:668:to setting missing from the smtp config section, even if all settings are filled in the parsedmarc.ini -host, port, ssl, user, password and from-).

I tried two different configuration, one with a gmail account

host = imap.gmail.com
port = 993
user = my_gmail_user@gmail.com
password = my_gmail_password

And a second one with another imap server, which is using port 143 over STARTTLS

host = imap.my-own-domain.com
port = 143
user = my_username
password = my_password

In each case I've an IMAP error both on logfile and with the cli command + debug option parsedmarc --debug -c /etc/parsedmarc.ini

With the gmail accound, I've
ERROR - [cli.py:884] - IMAP Error: [AUTHENTICATIONFAILED] Invalid credentials (Failure) With my own domain I've ERROR - [cli.py:884] - IMAP Error: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)

I do not understand what's wrong. I googlelized to find something, but out of solution as "the mail address had a dash in it and removing it makes it work" or "using port 143 does not work" I didn't find out neither a real explanation nor a valid solution.

Many thanks if you can put me in the picture.

jca1981 commented 2 months ago

i am running into the same problem with gmail.

NiceRath commented 1 day ago

For your own domain it might be an issue with the certificate (I'm guessing) => you could try skip_certificate_verification = True I've seen IMAPS (port 993) working

NiceRath commented 1 day ago

For gmail maybe look into the gmail_api settings - Google is restricting application access to mailboxes as they use password-authentication. Have had issues with other applications over gmail See also: https://support.google.com/mail/answer/185833?hl=en