GNU bug report logs -
#54158
28.0.91; duplicate mail downloads in Gnus (IMAP)
Previous Next
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
View this message in rfc822 format
Roland Winkler <winkler <at> gnu.org> writes:
> On Fri, Feb 25 2022, Eric Abrahamsen wrote:
>> You're using the IMAP server as a mail source, right? Can you post
>> your value of `mail-sources'?
>
> mail-sources is
>
> ((imap :server "localhost"
> :port 1143
> :user "winkler <at> foo.com"
> :authentication 'login
> :predicate "1:*"
> :mailbox ("INBOX" "JUNK EMAIL"))
I went down a bit of a rabbit hole here, and my best guess is that
commit daa4e0120 (which is in emacs-28 but not emacs-27) might have
resulted in a bug in the dynamic binding of your imap mail-source
definition data.
More specifically, the body of `mail-source-fetch-imap' is wrapped in
`mail-source-bind', which perpetuates some voodoo to locally bind all of
the data in your definition to local variables (e.g. :mailbox turns into
the variable `mailbox'). `mail-source-fetch-imap' hasn't changed much,
but `mail-source-bind' has, so maybe something's going wrong in the
binding of imap source data?
Something to try would be to edebug `mail-source-fetch-imap' and make
sure that the dynamic variables `dontexpunge' and `fetchflag' are what
you'd expect them to be, ie nil and "\Deleted". And watch what happens
for both "INBOX" and "JUNK EMAIL" (why are you fetching your junk mail,
anyway?) when you get to this bit of the code:
(when (and remove fetchflag)
(setq remove (nreverse remove))
(imap-message-flags-add
(imap-range-to-message-set (gnus-compress-sequence remove))
fetchflag nil buf))
(if dontexpunge
(imap-mailbox-unselect buf)
(imap-mailbox-close nil buf))
To be honest I don't see why `imap-mailbox-close' would expunge mail
anyway: its docstring says it does, but no expunge command is given.
There's a `imap-mailbox-expunge' function, but nothing ever calls it.
Anyway, that part of the code hasn't changed since emacs-27, so <shrug>.
If something funny is happening with the values of fetchflag or
dontexpunge, we can drag in Stefan M, who changed `mail-source-bind'.
Eric
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.