Allow anonymous login.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 12:45:07 +0000 (14:45 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 12:45:07 +0000 (14:45 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 5d45055..a43eed9 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-authenticator): New variable.
+       (nnimap-open-connection): Allow anonymous login.
+
        * gnus-art.el (gnus-article-describe-briefly): Fix up typo in last
        patch, found by Knut Anders Hatlen.
 
index c27b3ec..ce9e9e3 100644 (file)
@@ -66,6 +66,10 @@ Values are `ssl' and `network'.")
 This is always done if the server supports UID EXPUNGE, but it's
 not done by default on servers that doesn't support that command.")
 
+(defvoo nnimap-authenticator nil
+  "How nnimap authenticate itself to the server.
+Possible choices are nil (use default methods) or `anonymous'.")
+
 (defvoo nnimap-connection-alist nil)
 
 (defvoo nnimap-current-infos nil)
@@ -254,7 +258,10 @@ not done by default on servers that doesn't support that command.")
        (when (setq connection-result (nnimap-wait-for-connection))
          (unless (equal connection-result "PREAUTH")
            (if (not (setq credentials
-                          (nnimap-credentials nnimap-address ports)))
+                          (if (eq nnimap-authenticator 'anonymous)
+                              (list "anonymous"
+                                    (message-make-address))
+                            (nnimap-credentials nnimap-address ports))))
                (setq nnimap-object nil)
              (setq login-result (nnimap-command "LOGIN %S %S"
                                                 (car credentials)