3

Setup:

GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-10-05

Compiled from EmacsW64.

Gnus, using the latest version of Emacs development branch 25.05

Windows 7 x64 bit.

Situation:

Summary: I had quite serious headaches with trying Gnus to getting working. I haven't found a solution for the problem yet. Any assistance/ideas/guesses will be appreciated. I have followed this manual to set up Gnus with Gmail: http://www.emacswiki.org/emacs/GnusGmail

What follows are my experiments and results.

When connecting I get the following messages in the minibuffer:

Opening connection to imap.gmail.com via tls...
Unable to open server nnimap+gmail due to: Unknown service: 993
nnimap (gmail) open error: ‘’.  Continue? (y or n) n
Couldn’t open server on gmail
Warning: Unable to open server nnimap+gmail due to: Unknown service: 993

And when continue

Opening connection to imap.gmail.com via tls...
Unable to open server nnimap+gmail due to: Unknown service: 993
nnimap (gmail) open error: ‘’.  Continue? (y or n) y
Reading c:/Users/ReneFroger/AppData/Roaming/.newsrc.eld...
Generating the cache active file...done
Opening nnimap server on gmail...
Server nnimap+gmail previously determined to be down; not retrying
Opening nnimap server on gmail...failed: 
Checking new news...
gnus-setup-news: Wrong type argument: listp, nnimap

Connecting to the same IMAP server with Opera on the same computer succeeds (so there should be no firewall issues).

The nnimap server is defined as a secondary select method:

(setq gnus-secondary-select-methods '(nnimap "gmail"
(nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
(nnimap-server-port "imaps")
(nnimap-stream ssl)))

I found this thread which looked more promising:
http://thread.gmane.org/gmane.emacs.gnus.user/14695

From that thread it looked like the cause of the error message, might be a SSL certificate issue. So I found the certificates SSL in the cygwin. So I pointed it to there with:

(eval-after-load "gnutls"
'(progn
(setq gnutls-trustfiles '("c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.trust.crt" "c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.crt"))))

I then tried to start gnus, but I got the same issue. I also read this stackoverflow topic which is not helping me, unfortunately.

I have tried the log levels 1 and 2 by evaluating

(setq gnutls-log-level 1)

and then tried M-x gnus, and when that didn't give anything meaningful,
I evaluated

(setq gnutls-log-level 2)

and then tried M-x gnus, and that didn't give anything meaningful.

This is my full configuration for Gnus, following the manual for setting up with Gmail (http://www.emacswiki.org/emacs/GnusGmail) and trying to solve this issue with Windows

(setq tls-program '("C:/Dropbox/Sys/cygwin_2/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof"))

(setq gnus-select-method
'(nnimap "gmail"
(nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
(nnimap-server-port "imaps")
(nnimap-stream ssl)))


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


(eval-after-load "gnutls"
'(progn
(setq gnutls-trustfiles '("c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.trust.crt" "c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.crt"))))


(setq gnus-secondary-select-methods '(nnimap "gmail"
(nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
(nnimap-server-port "imaps")
(nnimap-stream ssl)))

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

Note that .profile and .authinfo are already in my home folder, which is also in my path. Any suggestion to debug this further would be appreciated.

  • If you evaluate the expression (gnutls-available-p), do you get t or nil? – lawlist Oct 24 '15 at 17:14
  • I get t after evaluating (gnutls-available-p). – ReneFroger Oct 24 '15 at 17:19
  • Here is a link to someone's config who says he spent hours Googling, etc. to come up with a working configuration: emacswiki.org/emacs/AlessandroPiras#toc2 – lawlist Oct 25 '15 at 3:44
  • @lawlist Thanks for your reply, I removed my configuration, and added his configuration, and changed the paths to the right ones. After evaluating the configuration, I still got the same error after starting gnus, unfortunately. – ReneFroger Oct 25 '15 at 12:47
4

The problem is

(nnimap-server-port "imaps")

on Windows it should be

(nnimap-server-port 993)

The former works on GNU/Linux because /etc/services provides a known port to work with, whereas Windows doesn't have a similar mechanism.

  • This answer helped me! – Ominus Nov 16 '16 at 19:09
2

If your Emacs is compiled with gnutls support, I think Gnus automatically does StartTLS by itself, and you don't need any special configuration.

I don't use Windows, so take it with a pinch of salt, but I am configuring gnus-secondary-select-methods to include:

    (nnimap "gmail"
            (nnimap-address "imap.gmail.com"))

and in my ~/.authinfo.gpg I have:

machine gmail login USERNAME@gmail.com password "PASSWORD" port imap

and it Just Works™. (This is on Debian GNU/Linux, GNU Emacs 24.5.1, Ma Gnus v0.14)

Update A quick search brings up this suggestion, try adding:

(nnimap-server-port 993)

to your configuration of the gmail server.

  • It's already included in my code, as you could notice it in the opening post. – ReneFroger Oct 24 '15 at 17:20
  • You are trying to use (nnimap-stream ssl) on the imaps port (993). That is different from StartTLS, which means connecting to the imap port, issuing the STARTTLS command, and then switching to TLS. Anyway, I was wrong, Gnus tries imaps first automatically. I would still try removing the (nnimap-stream ssl) and (nnimap-server-port) from your configuration and see what happens. – asjo Oct 24 '15 at 18:35
  • Thanks for your reply, I really appreciate it. I removed (nnimap-stream ssl) and (nnimap-server-port) from my configuration, and I get the same error after restarting, unfortunately. – ReneFroger Oct 24 '15 at 19:01
  • I found a discussion on the Gnus mailing list mentioning the exact error message you get, on Windows. I have updated the answer with the suggestion from the thread. – asjo Oct 24 '15 at 21:22
  • Thanks for your update. I added it, evaluated it, but I still got the same error after starting gnus – ReneFroger Oct 25 '15 at 12:46
1

I'm replying to my own question. With the setup in the opening post, I couldn't get it working. But this answer helped me a lot if you want getting Gnus work on Windows.

This is with Windows 7 and Emacs 24.5. I'm not sure about the other versions.

By the way, I prefer mu4e above Gnus. Notice you need to install some binaries in the path first, as explained in the tutorial from Sacha Chua.

  • 4
    Please consider expanding the answer to detail what you did rather than providing little more than a link. – Jonathan Leech-Pepin Nov 23 '15 at 20:15
  • @JonathanLeech-Pepin you're right, I expanded my answer more in detail. – ReneFroger Nov 23 '15 at 21:22
  • @ReneFroger Can you explain exactly what configuration you added from that answer in order to stop causing that error? Most of the other configurations in that answer are related to SMTP, and the error you described in your question is related to IMAP. I did change "imaps" to 993 and tried the gnus-secondary-select-methods as in that answer to no avail... – Armfoot Jul 19 '17 at 12:30
  • Armfoot, I wished I could help you, but I don't use Gnus anmyore and I switched over to Linux. So I don't remember my configuration at all :-( – ReneFroger Jul 21 '17 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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