From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP) Date: Thu, 10 Mar 2022 11:38:32 -0800 Message-ID: <87r1797g3r.fsf@ericabrahamsen.net> References: <87tucmc2y4.fsf@gnu.org> <87mtiek67l.fsf@ericabrahamsen.net> <87v8x2ljbs.fsf@gnu.org> <87a6eejjbr.fsf@ericabrahamsen.net> <87a6e1n4n9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16542"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54158@debbugs.gnu.org To: Roland Winkler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 10 20:39:10 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSOcw-00046z-9L for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Mar 2022 20:39:10 +0100 Original-Received: from localhost ([::1]:50226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSOcv-0004cR-57 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Mar 2022 14:39:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSOco-0004Zs-Pw for bug-gnu-emacs@gnu.org; Thu, 10 Mar 2022 14:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSOco-0008Sg-HH for bug-gnu-emacs@gnu.org; Thu, 10 Mar 2022 14:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSOco-0005A8-CW for bug-gnu-emacs@gnu.org; Thu, 10 Mar 2022 14:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 19:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54158 X-GNU-PR-Package: emacs Original-Received: via spool by 54158-submit@debbugs.gnu.org id=B54158.164694112119817 (code B ref 54158); Thu, 10 Mar 2022 19:39:02 +0000 Original-Received: (at 54158) by debbugs.gnu.org; 10 Mar 2022 19:38:41 +0000 Original-Received: from localhost ([127.0.0.1]:35558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSOcT-00059Z-7D for submit@debbugs.gnu.org; Thu, 10 Mar 2022 14:38:41 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:58164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSOcR-00059J-Dl for 54158@debbugs.gnu.org; Thu, 10 Mar 2022 14:38:39 -0500 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 4D8A1FA0B2; Thu, 10 Mar 2022 19:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1646941113; bh=K8RMOVjKQ7L32SAktJbSo47A/hySTM0LUQMGFKBPQ1U=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=q9t7X5Yy88K7Re7X1Df6lsJGhnERIea4YiKi2NzlR5jLzA8iCR8YKra8QhQKrIxVX Yl4ltX7cYsWvp73VQ5FIr2+4ROgZht83Ohf00nokEiTUUOYLWqzo9H8sszakhgmpOB DIQ1Hnchbzk1K+/v7b7I8Sl1dy6UXzWUHtxlOod0= In-Reply-To: <87a6e1n4n9.fsf@gnu.org> (Roland Winkler's message of "Mon, 07 Mar 2022 09:50:18 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228209 Archived-At: Roland Winkler writes: > On Fri, Feb 25 2022, Eric Abrahamsen wrote: >> 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. > > ...First I thought "let me revert this patch and see what happens", but > that's not a meaningful step. > >> 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" > > The values of these variables are always what you said they should be, > nil and "\Deleted". > >> (why are you fetching your junk mail, anyway?) > > It's the usual problem that the folder "JUNK EMAIL" contains messages > that should not be there. And I haven't figured out how the server > identifies mail as spam, nor whether it would allow me to fine-tune > this. I find it easier to do all this on the client side. > >> 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 >> . > > I looked at this code. Unfortunately, the wrappers it uses make it very > difficult to understand what it is doing, also because I do not know > either what it needs to do to get things right. > >> If something funny is happening with the values of fetchflag or >> dontexpunge, we can drag in Stefan M, who changed `mail-source-bind'. > > Following your suggestions of monitoring the variables `dontexpunge' and > `fetchflag', I do not see anything unusual in mail-source-fetch-imap. My intuitive shots-in-the-dark are pretty much always wrong :( > My understanding is that IMAP servers permit to expunge individual > messages while keeping others, though I do not want to use this feature > (I want to expunge everything after fetching it). However, I do not see > where mail-source-fetch-imap would implement such fine control. But my > problem of multiple downloads exists only for *some*, but not all > messages. So it seems to me we may be looking at the wrong part of the > code altogether. But that's only a wild guess of someone who does not > know much about all of this. I don't know that much, either. I'll set up a local IMAP account and do some testing with this, but it will take me a week or so to get to it. Can you tell me what IMAP server you're talking to here?