From 01336a2582269040a05bca4376285b1b1c8e3449 Mon Sep 17 00:00:00 2001 From: Andrew G Cohen Date: Sun, 20 Mar 2022 13:49:37 +0800 Subject: [PATCH] Fix imap fetching multiple mailboxes (bug#54158) * lisp/gnus/mail-source.el (mail-source-fetch-imap): Variables mailbox-source-string and remove should be reset for each mailbox. --- lisp/gnus/mail-source.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 04de70bf0f1..320bc9c3b0e 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -1065,9 +1065,7 @@ This only works when `display-time' is enabled." (let ((from (format "%s:%s:%s" server user port)) (found 0) (buf (generate-new-buffer " *imap source*")) - (mail-source-string (format "imap:%s:%s" server mailbox)) - (imap-shell-program (or (list program) imap-shell-program)) - remove) + (imap-shell-program (or (list program) imap-shell-program))) (if (and (imap-open server port stream authentication buf) (imap-authenticate user (or (cdr (assoc from mail-source-password-cache)) @@ -1076,8 +1074,10 @@ This only works when `display-time' is enabled." (let ((mailbox-list (if (listp mailbox) mailbox (list mailbox)))) (dolist (mailbox mailbox-list) (when (imap-mailbox-select mailbox nil buf) - (let ((coding-system-for-write mail-source-imap-file-coding-system) - str) + (let ((coding-system-for-write + mail-source-imap-file-coding-system) + (mail-source-string (format "imap:%s:%s" server mailbox)) + str remove) (message "Fetching from %s..." mailbox) (with-temp-file mail-source-crash-box ;; Avoid converting 8-bit chars from inserted strings to -- 2.39.2