AUTHENTICATIONFAILED - 登录无效凭据

AUTHENTICATIONFAILED - LOGIN Invalid credentials

我正在尝试将我的 python-scrip 与 Thunderbird 连接起来。 Thunderbird 使用我的雅虎邮箱。

使用以下代码我应该能够连接到 Thunderbird:

M = imaplib.IMAP4_SSL(config.server)
M.login(config.user, config.passwd)
M.select("inbox")

但我有以下问题:

Loaded classifier and label encoder with tag 'productive'
Traceback (most recent call last):
File "main.py", line 51, in <module>
M.login(config.user, config.passwd)
File 
"C:\AppData\Local\Continuum\ anaconda3\envs\nn_dev\lib\imaplib.py", line 
593, in login
raise self.error(dat[-1])
imaplib.error: b'[AUTHENTICATIONFAILED] LOGIN Invalid credentials'

我该如何解决这个问题?

如果您可以使用 Thunderbird 连接到 Yahoo,那么您应该可以使用 Python 直接连接到 Yahoo:只需使用您在 Thunderbird 中使用的相同登录数据。

否则,Yahoo 端可能存在某种类型的阻止(例如,如果您激活了 two-step authentication