3

I'm in the process of configuring Gnus to retrieve emails from my gmail account via IMAP. I have done as recommended at https://www.emacswiki.org/emacs/GnusGmail, however I keep on getting errors from Gnus upon startup:

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

I have GnuTLS installed and gnutls-cli seems to work with imap.gmail.com:993, I'm getting "OK Gimap ready for requests".

Here's my ~/.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. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")

My ~/.authinfo looks like this:

machine imap.gmail.com login [email protected] password my_password port 993
machine smtp.gmail.com login [email protected] password my_password port 587

What could be the problem?

Mark
  • 1,763
  • 5
  • 25
  • 45

1 Answers1

5

Gmail does not allow IMAP access by default from clients that don't meet its nebulously-defined security standards - I ran into the same thing testing some scripts I was writing with Python's imaplib. You need to go to the website and enable connections from less secure apps.

Information page from Google (includes direct link to settings screen): https://support.google.com/accounts/answer/6010255

Random832
  • 10,476
  • 1
  • 34
  • 40
  • I wonder what is the definition of a "less secure app"? – Mark Mar 28 '16 at 21:38
  • @Mark What they mean by “less secure” is anything that doesn't use [two-factor authentication](https://en.wikipedia.org/wiki/Two-factor_authentication). It's only less secure if you use a weak password (i.e. not randomly generated with sufficient entropy). There's a genuine security concern, but Google overplays it, partly to keep things simple and partly to discourage people from using interfaces other than their own. – Gilles 'SO- stop being evil' Mar 28 '16 at 22:15
  • @Random832, thank you, it has helped. – Mark Mar 28 '16 at 22:38