I am trying to set up Gnus (on Emacs 24.5) on Windows to access Gmail through IMAP and it seems like the connection is choking when it attempt to connect to the IMAP server. (Seems like Gnus is not attempting to send authentication data, either.)

It basically hangs while showing "Opening TLS connection to `imap.googlemail.com'...done" and I will have to Ctrl-G to stop it. (I left it for an hour and still didn't work, either.) For both situations where I tried to use gnutls-cli or openssl, it seems to be hanging in exactly the same places, where it seems to be the server is waiting for the client to talk to it, but Gnus never talks to it.

* OK Gimap ready for requests from e203mb4768837ita

I thought it was something to do with .authfile being encrypted, but it seems like Gnus is not even trying to touch it, and didn't work when I tried it with the plain text outfield.

(setq tls-program '("c:/Progra~2/Git/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof -CAfile c:/full/path/to/ca-bundle.crt"))

The odd thing is same configuration works on Linux and Mac on the same network, just Windows machine that's having issues.

(setq gnus-secondary-select-methods
  '((nnimap "server"
            (nnimap-address "imap.googlemail.com")
            (nnimap-server-port 993)
            (nnimap-stream ssl)
            (nnimap-authinfo-file "~/.authinfo"))))

If there something I can try to fix this, and/or suggestions/insights will be highly appreciated!

Thank you.

  • I'd suggest trying the native GnuTLS support in Emacs instead of an external TLS program. I wrote about how to enable that on Windows.
    – legoscia
    Commented Jun 11, 2015 at 9:59
  • Yes, looks like this solved the issue. Thank you! Commented Jun 11, 2015 at 19:39
  • Can you share your setup in detail? I tried in many ways, but none of them was successful.
    – Leu_Grady
    Commented Aug 23, 2015 at 11:12
  • I've pretty much followed instruction on the parent comment. I didn't actually have to change a single line of lisp I had in my original question. Make sure to use the gnutls from the site mentioned, as some other gnutls distribution seems to be incompatible. Commented Sep 17, 2015 at 1:53
  • @legoscia perhaps you may be able to help me: I followed the procedure described on your website. However, when I extract gnutls and copy the .DLL files of its bin/ directory to emacs' bin/ directory, the command (gnutls-available-p) is not recognized. I wonder what I may have missed? Thanks for your time.
    – Blitzkoder
    Commented Oct 8, 2015 at 10:18

2 Answers 2


Thanks to comments posted by legoscia, it is functioning!

Mainly, I had to remove tls-program definition.

 (setq tls-program '("c:/Progra~2/Git/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof -CAfile c:/full/path/to/ca-bundle.crt"))

And make sure the OpenSSL DLL is present in the same directory as Emacs.

It is also noted that some OpenSSL distribution seems to have different signature, however, the one provided through the link on the article worked.

  • Could you please expand on this post to make it a complete answer by describing what you did to fix the problem? It's good to cite @legoscia's comment and work, but an answer should be self-contained.
    – Dan
    Commented Sep 29, 2015 at 20:19

This answer helped me a lot if you want getting Gnus work on Windows. By the way, I prefer mu4e above Gnus.

  • Please consider expanding the answer to detail what you did rather than providing little more than a link. Commented Nov 23, 2015 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.