Subject: bug#41951: 28.0.50; Automatically detect AUTH=ANONYMOUS in Gnus nnimap?

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 19 Jul 2020 05:17:18 +0200

Eric Abrahamsen <[email-masked]> writes:

> I think if we did it this way:
>
> (if (or (eq nnimap-authenticator 'anonymous)
> 	(and (null nnimap-authenticator)
> 	     (nnimap-capability "AUTH=ANONYMOUS")))
>     (list "anonymous"
> 	  (message-make-address))
>   ;; normal log in process
>   )
>
> Then we only fall back on anonymous if the user hasn't specified
> anything explicitly. I haven't yet verified that (null
> nnimap-authenticator) does the right thing in this case, though.

The code now is:

	      (if (not (setq credentials
			     (if (eq nnimap-authenticator 'anonymous)
				 (list "anonymous"
				       (message-make-address))
                               ;; Look for the credentials based on
                               ;; the virtual server name and the address
                               (nnimap-credentials
				(gnus-delete-duplicates
				 (list server nnimap-address))
                                ports
                                nnimap-user))))

That call to nnimap-credentials looks into the .authinfo file, and if
the password is present there, it uses it.

So at the very least, the auto-anonymous thing would have to be reversed
in priority -- after the call to nnimap-credentials.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no