Subject: bug#20602: nnimap-address not passed to nnimap-open-server anymore

From: Reiner Steib <[email-masked]>
Date: Mon, 18 May 2015 17:44:06 +0200

Hi,

some change in the Gnus IMAP code between GNU Emacs 24.3.1 and Ma Gnus
v0.14 (from git, updated on 2015-05-13) broke my setup.

[ Ma Gnus v0.14
GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.10.7)
 of 2014-03-07 on toyol, modified by Debian ]

I add my IMAP providers as follows:

(add-to-list 'gnus-secondary-select-methods
	     '(nnimap "selname"
		      (nnimap-address "imap.my.example.com")
		      (nnimap-directory "~/Mail/var/nnimap/selname")
		      (nnimap-server-port 993)
		      (nnimap-stream tls)))

In Gnus bundled with GNU Emacs 24.3.1, I can enter/request e.g. my
INBOX nnimap+selname:INBOX fine.

In current Gnus, I get:

| Opening connection to selname via tls...
| open-network-stream: selname/993 Name or service not known

On edebugging `nnimap-open-server', I found that the argument `defs'
(which should contain `nnimap-address', IIUC), is nil.

(deffoo nnimap-open-server (server &optional defs no-reconnect)
  (if (nnimap-server-opened server)
      t
    (unless (assq 'nnimap-address defs)
      (setq defs (append defs (list (list 'nnimap-address server)))))
    (nnoo-change-server 'nnimap server defs)
    (if no-reconnect
	(nnimap-find-connection nntp-server-buffer)
      (or (nnimap-find-connection nntp-server-buffer)
	  (nnimap-open-connection nntp-server-buffer)))))

I didn't work with Emacs/Gnus code for some years, so I wasn't able to
figure out, what went wrong.

Attached are the debug logs after ...
- (require 'nnimap)
- on nnimap-open-server, do C-c C-M-x
- M-x gnus RET
- j nnimap+selname:INBOX RET
- M-g
- in the debug session, inspect `defs': e defs RET
- eval debug: e (debug)

(a) rs-imap-open-defs-ok.log --> Gnus bundled with GNU Emacs 24.3.1
(b) rs-imap-open-defs-failed.log --> Ma Gnus v0.14, 2015-05-13

Bye, Reiner.