2

I am trying to configure emacs to fetch my mail from gmail and have got into some troubles. I am getting "NO" as answer from gmail server all the time. I have followed instructions offered at gnus manual, emacswiki and numerous other blogs and sites, but I don't seem to be able to get it to work. It should be fairly simple to set it up, but for some reason I dont' seem to be able. Here is my .gnus file:

(setq gnus-select-method
  '(nnimap "gmail"
       (nnimap-address "imap.gmail.com")
       (nnimap-server-port 993)
       (nnimap-stream ssl)))

Content of .authoinfo:

machine imap.gmail.com login "[email protected]" password "mypassword" port 993

Content of .profile file (as from emacswiki):

export EMAIL="[email protected]"
export NAME="myname"
export IMAPSERVER="imap.gmail.com"

I always get following error: Opening connection to imap.gmail.com via tls... nnimap ([email protected]) open error: 'NO (ALERT) Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure).

I am using gnutls 3.4.4 on Arch Linux. Emacs is vanilla arch 24.5.1 version. By now I have seen pretty much every blog on the planet that touches Gnus and gmail even at the slightest and it really drives me mad :). Hope somebody can help me with the issue.

2
  • When I try now to access Gmail through IMAP with (al)pine, I get a similar problem, too. Only the link that is shown me first is a longer one, so I have a suspicion that if it were complete, I could pass the secure authentification by folllowing without enabling "less secure" in Gmail. The problem is that it is cut by (al)pine and not shown completely: accounts.google.com/… I want to make (al)pine print it complete Commented Dec 11, 2015 at 13:29
  • Make sure you've also allowed POP or IMAP access (I think you want IMAP, judging from your settings) in your GMail account settings. Also make sure you don't have 2-step verification enabled for your account (it will show in My Account > Sign-in & Security.
    – wvxvw
    Commented Dec 15, 2015 at 8:13

1 Answer 1

1

I had the same problem. On the page: https://www.google.com/settings/security/lesssecureapps i turned on the option "Enable"

3
  • When I try now to access Gmail through IMAP with (al)pine, I get a similar problem, too. Only the link that is shown me first is a longer one, so I have a suspicion that if it were complete, I could pass the secure authentification by folllowing without enabling "less secure" in Gmail. The problem is that it is cut by (al)pine and not shown completely: accounts.google.com/… I want to make (al)pine print it complete Commented Dec 11, 2015 at 13:29
  • Tahnk you very much! I know it has been long time ago, but thanks :-). Commented Jan 5, 2017 at 21:51
  • This is the way. Other answers suggesting to use two-factor authentication just lead you down the path of Google's scam that will require from you to give them your phone (of course, it's possible to work around it, but the general idea of 2FA is a scam intended to get more private information about the user, it's not for protection). Their documentation also doesn't mention this setting. I have no idea how they still leave this door open, but it would've been a pain at this point to migrate to another email provider...)
    – wvxvw
    Commented Jun 15, 2021 at 6:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .