Eric Wong <e...@yhbt.net> writes:

> Kyle Meyer <k...@kyleam.com> wrote:
>> Eric Abrahamsen writes:
>> 
>> > Hey, that works great! It's a bit weird that it still asks for a
>> > username and password, I wonder if there's any way to skip that. I've
>> > never dealt with anonymous IMAP before -- is there anything in the
>> > connection process that explicitly tells us "you don't need to log on"?
>> 
>> The server advertises AUTH=ANONYMOUS as a capability [*], so Gnus could
>> detect that and send "AUTHENTICATE ANONYMOUS", I _think_.
>
> Fwiw, mutt detects AUTH=ANONYMOUS and uses it automatically,
> so I think it's reasonable for Gnus and others do the same.

Looks like it would be as simple as the attached diff. I have very
little confidence in my understanding of the potential ramifications,
though, so I'll open an Emacs bug and see what other people think.

Eric

diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index f306889a7f..ebb1236674 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -837,6 +837,7 @@ gnus-registry-find-keywords
                 (completing-read "Keyword: " (gnus-registry-keywords) nil t)))
   (registry-lookup-secondary-value gnus-registry-db 'keyword keyword))
 
+
 (defun gnus-registry-register-message-ids ()
   "Register the Message-ID of every article in the group."
   (unless (gnus-parameter-registry-ignore gnus-newsgroup-name)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 3c4e75ede8..18d3cba173 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -509,7 +509,8 @@ nnimap-open-connection-1
 			  (split-string capabilities)))
 	    (unless (string-match-p "[*.] PREAUTH" greeting)
 	      (if (not (setq credentials
-			     (if (eq nnimap-authenticator 'anonymous)
+			     (if (or (eq nnimap-authenticator 'anonymous)
+				     (nnimap-capability "AUTH=ANONYMOUS"))
 				 (list "anonymous"
 				       (message-make-address))
                                ;; Look for the credentials based on

Reply via email to