unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41951: 28.0.50; Automatically detect AUTH=ANONYMOUS in Gnus nnimap?
@ 2020-06-19 17:41 Eric Abrahamsen
  2020-07-19  1:07 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Abrahamsen @ 2020-06-19 17:41 UTC (permalink / raw)
  To: 41951

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]


IMAP servers that allow anonymous authentication advertise that fact in
their capabilities as AUTH=ANONYMOUS.

nnimap currently lets you take advantage of this explicitly, by setting
(nnimap-authenticator anonymous) in the server definition. But this
requires you to know in advance that the server allows anonymous
authentication, and decide to use it.

Gnus could figure this out itself and anonymously log in, using the
attached patch. It seems to work fine, but there might be further
consequences I haven't thought of. And possibly we'd simply prefer that
settings like this be a little more explicit for the user?

Does anyone have any opinions on this?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnimap-anonymous.diff --]
[-- Type: text/x-patch, Size: 1140 bytes --]

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-19  4:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 17:41 bug#41951: 28.0.50; Automatically detect AUTH=ANONYMOUS in Gnus nnimap? Eric Abrahamsen
2020-07-19  1:07 ` Lars Ingebrigtsen
2020-07-19  3:14   ` Eric Abrahamsen
2020-07-19  3:17     ` Lars Ingebrigtsen
2020-07-19  3:20       ` Eric Abrahamsen
2020-07-19  3:21         ` Lars Ingebrigtsen
2020-07-19  4:01           ` Eric Abrahamsen
2020-07-19  4:03             ` Lars Ingebrigtsen
2020-07-19  4:12               ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).