GNU bug report logs - #54158
28.0.91; duplicate mail downloads in Gnus (IMAP)

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Fri, 25 Feb 2022 16:44:01 UTC

Severity: normal

Found in version 28.0.91

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 54158 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Cohen <acohen <at> ust.hk>
To: 54158 <at> debbugs.gnu.org
Subject: Re: bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP)
Date: Sat, 19 Mar 2022 12:53:52 +0800
(I sent this to Roland directly since I'm a bit shy about communicating
on public lists, but here goes anyway)

I think the problem is that the code in mail-source-fetch-imap doesn't
handle a list of mailboxes properly (I don't know why it would have
worked in emacs-27 though). Adam added a loop over a list of mailboxes
way back in 2015, but it seems to me that some of the variables bound
outside the loop should be bound inside (imap usually works on a per
mailbox basis)

So I think this might fix it (although I don't have a setup available to
test it).

Of course I might be totally off-base. If so, sorry in advance. 

diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index 5d0c0e2654..01cca831f2 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -1066,9 +1066,7 @@ mail-source-fetch-imap
     (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))
@@ -1078,7 +1076,8 @@ mail-source-fetch-imap
             (dolist (mailbox mailbox-list)
               (when (imap-mailbox-select mailbox nil buf)
 	  (let ((coding-system-for-write mail-source-imap-file-coding-system)
-		str)
+                (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


-- 
Andrew Cohen




This bug report was last modified 3 years and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.