No Gnus v0.3 GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2004-04-07 on raven, modified by Debian 200 myrkr.in-berlin.de InterNetNews server INN 2.4.2 (20040403 prerelease) ready I think I found a bug in the current gnus/nnimap code regarding the initialisation when using the compose-mail command. I did this test against the lasted CVS version of gnus as well as an earlier version (the version I'm currently using writing this report). *Setup* Here is my setup. The .emacs.d/init.el contains the following code to specify gnus for reading and writing mail: (setq mail-user-agent 'gnus-user-agent) (setq read-mail-command 'gnus) Here are some additional statements from the same file that might be related: (setq read-mail-command 'gnus) (autoload 'gnus-agent-possibly-save-gcc "gnus-agent") The .gnus file contains the following lines to specify the destination folder for archiving, sitting on my local IMAP server (cyrus imapd 2.1.x): (setq gnus-message-archive-group '((if (message-news-p) "nnimap+IMAP:Archiv/Sent-News" "nnimap+IMAP:Archiv/Sent-Mails"))) Here is the namespace setup of the IMAP server: * NAMESPACE (("" "/")) (("Other Users/" "/")) (("Shared Folders/" "/")) The archive method is given with the according "Gcc: nnimap+IMAP:Archiv/Sent-Mails" pseudo header during message composition. Here is my setup for the IMAP server: (setq gnus-secondary-select-methods '((nnml "") (nnimap "IMAP" (nnimap-address "localhost")))) The .authinfo file has the following contents (password replaced by xxx): machine localhost port imap login torsten password xxx *The bug* If I start gnus manually using M-x gnus before composing the mail everything works perfectly. However, running C-x m (compose-mail) before starting gnus results in the problem described in the following paragraphs. From the user POV gnus asks me about my username and password. Here is the part of *Messages* describing these inputs: Opening nnimap server on IMAP... imap: Connecting to IMAP... Waiting for response from IMAP...done imap: Connecting to IMAP...done imap: Authenticating to `IMAP' using `login'... imap: Plaintext authentication... IMAP password for torsten@IMAP (using authenticator `login'): Login failed... Quit trying to open server Quit gnus-check-server Opening nnimap server on IMAP...failed I had to press C-g here to abort gnus. Maybe you noticed, the server nnimap wants to connect to is "IMAP" instead of the expected "localhost". So it seems that the gnus-secondary-select-method is not honoured in that situation. I set debug-on-quit and debug-on-error to t and got this backtrace: Debugger entered--Lisp error: (error "Can't open server nnimap") signal(error ("Can't open server nnimap")) error("Can't open server %s" nnimap) gnus-inews-do-gcc() gnus-agent-possibly-do-gcc() run-hooks(message-sent-hook) message-send(nil) message-send-and-exit(nil) call-interactively(message-send-and-exit) I set the variabled imap-log and imap-debug to t and got the following output of nnimap trying to connect to my providers IMAP server (the one sitting behind the local imap address): * OK Messaging Multiplexor (iPlanet Messaging Server 5.2 HotFix 1.12 (built Feb 13 2003)) 1 CAPABILITY * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN LANGUAGE XSENDER X-NETSCAPE XSERVERINFO AUTH=PLAIN 1 OK CAPABILITY completed 2 CAPABILITY * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN LANGUAGE XSENDER X-NETSCAPE XSERVERINFO AUTH=PLAIN 2 OK CAPABILITY completed The strange thing is, nnimap also accesses the local (correct) IMAP server during the end-less loop I aborted with C-g. Here is a transcript of this session (the whole sequence is repeated ad infinitum): A000 LOGIN torsten xxx A000 OK A001 EXAMINE Mail * FLAGS (\Answered \Flagged \Draft \Deleted \Seen gnus-forward gnus-expire gnus-save) A002 CHECK A002 OK A003 SEARCH UNSEEN SEARCH 3337 3338 3339 A004 LOGOUT BYE LOGOUT received The folder "Mail" is my primary mail folder where new mail is expected to appear. nnimap didn't try to save the message at all to my local IMAP server. *Workaround* I found the following code to work around the problem, obviously by calling gnus at least once before composing new mail: (defadvice compose-mail (before nnimap-fix activate) (unless (gnus-alive-p) (gnus))) Information about Emacs and gnus are appended to this message. Torsten