reading gmail is failing with IMAP

白昼怎懂夜的黑 提交于 2020-12-03 14:48:25

问题


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.


回答1:


try with:

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

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




回答2:


Some apps and devices use less secure sign-in technology. So we need to enable Less secure app access option from gmail account.

Steps:

  1. Login into Gmail
  2. Go to Google Account
  3. Navigate to Security section
  4. Turn on access for Less secure app access

By following above steps, issue will be resolved.




回答3:


Thanks guys. Its working now. The issue was that the google blocked our network.. because of multiple attempts. I tried that unlock URL from a different URL and it didnt work. The catch is that, we have to run that URL in the machine where you are trying to run the script. Hope it may help someone :)




回答4:


Got the same error and it was fixed by getting the new google app password. Maybe this will work for someone



来源:https://stackoverflow.com/questions/33119667/reading-gmail-is-failing-with-imap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!