reading gmail is failing with IMAP

Mourya Ch picture Mourya Ch · Oct 14, 2015 · Viewed 15.3k times · Source

I am running a cron job which executes the python script for reading gmail (2 min interval). I have used imaplib for reading the new mails. This was working fine until yesterday. Suddenly its throwing below error

imaplib.error: [AUTHENTICATIONFAILED] Invalid credentials (Failure)

and sometimes i am getting the below error

raise self.abort(bye[-1]) imaplib.abort: [UNAVAILABLE] Temporary System Error

When i run the same script on a different machine. Its working fine. I am assuming that the host has been blacklisted or something like that.

What are my options ?

I cant generate the Credentials (Gmail API) as this is under company domain account.

Answer

Joakin Montesinos picture Joakin Montesinos · Jan 26, 2020

try with:

1) https://myaccount.google.com/lesssecureapps?pli=1

2) Gmail Settings -> Forwarding and POP / IMAP -> IMAP Acess to Enable IMAP