Commit 0974f7bf authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(rmail-pop-password-error): New variable.

(rmail-insert-inbox-text): If there's an error getting mail from
the POP server, and the error matches rmail-pop-password-error or
we prompted for the POP password, assume that the password is
incorrect and erase it so that the user will be prompted again the
next time he gets mail.
parent 8248aeb5
......@@ -102,6 +102,11 @@
:type 'boolean
:group 'rmail-retrieve)
(defvar rmail-pop-password-error "invalid usercode or password"
"Regular expression matching incorrect-password POP server error messages.
If you get an incorrect-password error that this expression does not match,
please report it with \\[report-emacs-bug].")
(defcustom rmail-preserve-inbox nil
"*Non-nil if incoming mail should be left in the user's inbox,
rather than deleted, after it is retrieved."
......@@ -1183,7 +1188,7 @@ It returns t if it got any new messages."
(or (memq (file-locked-p buffer-file-name) '(nil t))
(error "RMAIL file %s is locked"
(file-name-nondirectory buffer-file-name)))
(let (file tofile delete-files movemail popmail)
(let (file tofile delete-files movemail popmail got-password)
(while files
(setq file (file-truename
(expand-file-name (substitute-in-file-name (car files))))
......@@ -1222,7 +1227,8 @@ It returns t if it got any new messages."
(setq rmail-pop-password
(format "Password for %s: "
(substring file (+ popmail 3))))))
(substring file (+ popmail 3))))
got-password t))
(if (eq system-type 'windows-nt)
;; cannot have "po:" in file name
(setq tofile
......@@ -1297,6 +1303,13 @@ It returns t if it got any new messages."
(message "movemail: %s"
(buffer-substring (point-min)
(if (or got-password
;; If the error was for an incorrect password,
;; arrange to try again to read the password.
(re-search-forward rmail-pop-password-error
nil t))
(setq rmail-pop-password nil))
(sit-for 3)
(if errors (kill-buffer errors))))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment