From: Andrew G Cohen Date: Sun, 20 Mar 2022 05:49:37 +0000 (+0800) Subject: Fix imap fetching multiple mailboxes (bug#54158) X-Git-Tag: emacs-29.0.90~1931^2~1021 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=01336a2582269040a05bca4376285b1b1c8e3449;p=emacs.git 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. --- 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