Forget credentials if the server says the password was wrong.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 27 Sep 2010 17:42:10 +0000 (19:42 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 27 Sep 2010 17:42:10 +0000 (19:42 +0200)
lisp/ChangeLog
lisp/nnimap.el

index bc979a6..4b07815 100644 (file)
@@ -2,6 +2,8 @@
 
        * nnimap.el (nnimap-request-accept-article): Remove the "." at the end,
        since some servers don't like it.
+       (nnimap-open-connection): Forget credentials if the server says the
+       password was wrong.
 
        * gnus-sum.el (gnus-summary-move-article): Add comment.
        (gnus-summary-insert-new-articles): Copy the old-high watermark so that
index bc3a047..830aa7d 100644 (file)
@@ -361,6 +361,14 @@ some servers.")
                                                   (car credentials)
                                                   (cadr credentials)))
                (unless (car login-result)
+                 ;; If the login failed, then forget the credentials
+                 ;; that are now possibly cached.
+                 (dolist (host (list (nnoo-current-server 'nnimap)
+                                     nnimap-address))
+                   (dolist (port ports)
+                     (dolist (element '("login" "password"))
+                       (auth-source-forget-user-or-password
+                        element host port))))
                  (delete-process (nnimap-process nnimap-object))
                  (setq nnimap-object nil))))
            (when nnimap-object