unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Roland Winkler <winkler@gnu.org>
Cc: 54158@debbugs.gnu.org
Subject: bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP)
Date: Fri, 25 Feb 2022 21:19:36 -0800	[thread overview]
Message-ID: <87a6eejjbr.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87v8x2ljbs.fsf@gnu.org> (Roland Winkler's message of "Fri, 25 Feb 2022 15:36:39 -0600")

Roland Winkler <winkler@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@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





  reply	other threads:[~2022-02-26  5:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 16:42 bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP) Roland Winkler
2022-02-25 21:05 ` Eric Abrahamsen
2022-02-25 21:36   ` Roland Winkler
2022-02-26  5:19     ` Eric Abrahamsen [this message]
2022-02-28 16:30       ` Roland Winkler
2022-03-07 15:50       ` Roland Winkler
2022-03-10 19:38         ` Eric Abrahamsen
2022-03-13  5:33           ` Roland Winkler
2022-03-18 16:09             ` Roland Winkler
2022-03-18 16:19               ` Eric Abrahamsen
2022-03-18 16:34                 ` Roland Winkler
2022-03-18 16:45                   ` Robert Pluim
2022-03-18 17:55                     ` Roland Winkler
2022-03-18 16:49                   ` Eric Abrahamsen
2022-03-18 16:53                     ` Eric Abrahamsen
2022-03-18 15:27       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-18 16:03         ` Eric Abrahamsen
2022-03-19  4:53 ` Andrew Cohen
2022-03-19 16:25   ` Roland Winkler
2022-03-21 19:33     ` Eric Abrahamsen
2022-03-21 19:38       ` Lars Ingebrigtsen
2022-03-21 19:48         ` Eric Abrahamsen
2022-03-21 19:50           ` Lars Ingebrigtsen
2022-03-21 23:18             ` Eric Abrahamsen
2022-03-21 20:40       ` Roland Winkler
2022-03-21 23:27         ` Eric Abrahamsen
2022-03-19 21:52 ` Andrew Cohen
2022-03-20  3:50   ` Roland Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6eejjbr.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=54158@debbugs.gnu.org \
    --cc=winkler@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).