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 "myuser@gmail.com" password "mypassword" port 993

Content of .profile file (as from emacswiki):

export EMAIL="mymail@gmail.com"
export NAME="myname"
export IMAPSERVER="imap.gmail.com"

I always get following error: Opening connection to imap.gmail.com via tls... nnimap (editedemail@gmail.com) 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.

  • 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: https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvkazpL7osHnvpxjyL0w3IAKZCOK_azLAtxay9eknxeejz1aD8mEd9Dg-tuXygGV2GdRn3jzhE_dhOKWvtkncD4gRU0rhWqaCfDHScRWQKrqSqU3chVhpYQATJnUaFz0qKBcUHHtY I want to make (al)pine print it complete – imz -- Ivan Zakharyaschev Dec 11 '15 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 Dec 15 '15 at 08:13

1 Answers1

1

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

securelord
  • 21
  • 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: https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvkazpL7osHnvpxjyL0w3IAKZCOK_azLAtxay9eknxeejz1aD8mEd9Dg-tuXygGV2GdRn3jzhE_dhOKWvtkncD4gRU0rhWqaCfDHScRWQKrqSqU3chVhpYQATJnUaFz0qKBcUHHtY I want to make (al)pine print it complete – imz -- Ivan Zakharyaschev Dec 11 '15 at 13:29
  • Tahnk you very much! I know it has been long time ago, but thanks :-). – user1648090 Jan 05 '17 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 Jun 15 '21 at 06:38