diff options
| author | Eli Zaretskii | 2025-08-23 14:55:09 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2025-08-23 14:55:09 +0300 |
| commit | 45bc42bddfe8d9376ede6e71e4ddccb02c3d45a3 (patch) | |
| tree | c04bdd8e633aab7e2d7ff41647b0a462478c93c2 | |
| parent | aae9eddb58a618d9a90dcd4232688b31b0df9f81 (diff) | |
| download | emacs-45bc42bddfe8d9376ede6e71e4ddccb02c3d45a3.tar.gz emacs-45bc42bddfe8d9376ede6e71e4ddccb02c3d45a3.zip | |
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)
| -rw-r--r-- | lisp/mail/rmail.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 41b0813707f..b8aa937aec2 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -4515,6 +4515,11 @@ TEXT and INDENT are not used." | |||
| 4515 | ;; to "prying eyes." Obviously, this encoding isn't "real security," | 4515 | ;; to "prying eyes." Obviously, this encoding isn't "real security," |
| 4516 | ;; nor is it meant to be. | 4516 | ;; nor is it meant to be. |
| 4517 | 4517 | ||
| 4518 | (defvar rmail--remote-password-host nil | ||
| 4519 | "Last recorded value of the HOST argument to `rmail-get-remote-password'.") | ||
| 4520 | (defvar rmail--remote-password-user nil | ||
| 4521 | "Last recorded value of the USER argument to `rmail-get-remote-password'.") | ||
| 4522 | |||
| 4518 | ;;;###autoload | 4523 | ;;;###autoload |
| 4519 | (defun rmail-set-remote-password (password) | 4524 | (defun rmail-set-remote-password (password) |
| 4520 | "Set PASSWORD to be used for retrieving mail from a POP or IMAP server." | 4525 | "Set PASSWORD to be used for retrieving mail from a POP or IMAP server." |
| @@ -4535,7 +4540,12 @@ machine mymachine login myloginname password mypassword | |||
| 4535 | 4540 | ||
| 4536 | If auth-source search yields no result, prompt the user for the | 4541 | If auth-source search yields no result, prompt the user for the |
| 4537 | password." | 4542 | password." |
| 4538 | (when (not rmail-encoded-remote-password) | 4543 | (when (or (not rmail-encoded-remote-password) |
| 4544 | (not (equal user rmail--remote-password-user)) | ||
| 4545 | (not (equal host rmail--remote-password-host))) | ||
| 4546 | ;; Record the values we will be using from now on. | ||
| 4547 | (setq rmail--remote-password-host host | ||
| 4548 | rmail--remote-password-user user) | ||
| 4539 | (if (not rmail-remote-password) | 4549 | (if (not rmail-remote-password) |
| 4540 | (setq rmail-remote-password | 4550 | (setq rmail-remote-password |
| 4541 | (let ((found (nth 0 (auth-source-search | 4551 | (let ((found (nth 0 (auth-source-search |