使用IMAP读取gmail失败 [英] reading gmail is failing with IMAP

查看:130
本文介绍了使用IMAP读取gmail失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一项cron作业,该作业执行python脚本以读取gmail(2分钟间隔).我已经使用imaplib来阅读新邮件.到昨天为止,一切正常.突然将其抛出错误以下

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]无效的凭据(失败)

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

有时我会遇到以下错误

提高self.abort(bye [-1])imaplib.abort:[不可用]临时系统错误

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.

我有什么选择?

我无法生成凭据(Gmail API),因为该凭据位于公司域帐户下.

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

推荐答案

尝试使用:

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

2)Gmail设置->转发和POP/IMAP-> IMAP启用IMAP的权限

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

这篇关于使用IMAP读取gmail失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆