1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Rmail can fetch email from several inboxes with different passwords

* lisp/mail/rmail.el (rmail--remote-password-host)
(rmail--remote-password-user): New variables.
(rmail-get-remote-password): Use them to ask for the password
whenever we need to fetch email from an inbox whose user or host
are different from the last ones.  (Bug#79214)
This commit is contained in:
Eli Zaretskii 2025-08-23 14:55:09 +03:00
parent aae9eddb58
commit 45bc42bddf

View file

@ -4515,6 +4515,11 @@ TEXT and INDENT are not used."
;; to "prying eyes." Obviously, this encoding isn't "real security,"
;; nor is it meant to be.
(defvar rmail--remote-password-host nil
"Last recorded value of the HOST argument to `rmail-get-remote-password'.")
(defvar rmail--remote-password-user nil
"Last recorded value of the USER argument to `rmail-get-remote-password'.")
;;;###autoload
(defun rmail-set-remote-password (password)
"Set PASSWORD to be used for retrieving mail from a POP or IMAP server."
@ -4535,7 +4540,12 @@ machine mymachine login myloginname password mypassword
If auth-source search yields no result, prompt the user for the
password."
(when (not rmail-encoded-remote-password)
(when (or (not rmail-encoded-remote-password)
(not (equal user rmail--remote-password-user))
(not (equal host rmail--remote-password-host)))
;; Record the values we will be using from now on.
(setq rmail--remote-password-host host
rmail--remote-password-user user)
(if (not rmail-remote-password)
(setq rmail-remote-password
(let ((found (nth 0 (auth-source-search