GNU Emacs Gnus 无法连接到 gmail IMAP

Mar*_*ark 3 emacs email imap google

我正在配置 Gnus 以通过 IMAP 从我的 gmail 帐户中检索电子邮件。我已经按照https://www.emacswiki.org/emacs/GnusGmail 的建议做了,但是我在启动时不断收到来自 Gnus 的错误:

Opening connection to imap.gmail.com via tls...
nnimap (gmail) open error: 'NO (ALERT) Please log in via your web browser:
https://support.google.com/mail/accounts/answer/78754 (Failure)'.  Continue? (y
or n)  y
Saving file /home/mark/.newsrc-dribble...
Wrote /home/mark/.newsrc-dribble [2 times]
Gnus auto-save file exists.  Do you want to read it? (y or n)  y
Opening nnimap server on gmail...
Server nnimap+gmail previously determined to be down; not retrying
Opening nnimap server on gmail...failed: NO (ALERT) Please log in via your web
browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
Checking new news...
Reading active file from gmail via nnimap...
Opening nnimap server on gmail...
Server nnimap+gmail previously determined to be down; not retrying
Opening nnimap server on gmail...failed: NO (ALERT) Please log in via your web
browser: https://support.google.com/mail/accounts/answer/78754 (Failure)
Reading active file via nndraft...done
Checking new news...done
No news is good news
Warning: Opening nnimap server on gmail...failed: NO (ALERT) Please log in via
your web browser: https://support.google.com/mail/accounts/answer/78754
(Failure); Server nnimap+gmail previously determined to be down; not retry\
ing; Opening nnimap server on gmail...failed: NO (ALERT) Please log in via your
web browser: https://support.google.com/mail/accounts/answer/78754 (Failure);
Server nnimap+gmail previously determined to be down; not retrying
gnus-group-read-group: No group on current line
Run Code Online (Sandbox Code Playgroud)

我安装了 GnuTLS 并且 gnutls-cli 似乎可以与 imap.gmail.com:993 一起使用,我得到“OK Gimap 准备好接受请求”。

这是我的 ~/.gnus:

(setq gnus-select-method
      '(nnimap "gmail"
          (nnimap-address "imap.gmail.com")
          (nnimap-server-port 993)
          (nnimap-stream ssl)
          (nnir-search-engine imap)
          (nnimap-authinfo-file "~/.authinfo")))

(setq smtpmail-smtp-service 587
      gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")
Run Code Online (Sandbox Code Playgroud)

我的 ~/.authinfo 看起来像这样:

machine imap.gmail.com login mark@mydomain.com password my_password port 993
machine smtp.gmail.com login mark@mydomain.com password my_password port 587
Run Code Online (Sandbox Code Playgroud)

可能是什么问题呢?

Ran*_*832 5

默认情况下,Gmail 不允许从不符合其模糊定义的安全标准的客户端访问 IMAP - 我在测试我用 Python 的 imaplib 编写的一些脚本时遇到了同样的事情。您需要访问该网站并启用来自不太安全的应用程序的连接。

来自 Google 的信息页面(包括指向设置屏幕的直接链接):https : //support.google.com/accounts/answer/6010255