From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.bugs Subject: bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP) Date: Mon, 07 Mar 2022 09:50:18 -0600 Message-ID: <87a6e1n4n9.fsf@gnu.org> References: <87tucmc2y4.fsf@gnu.org> <87mtiek67l.fsf@ericabrahamsen.net> <87v8x2ljbs.fsf@gnu.org> <87a6eejjbr.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24720"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54158@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 07 16:56:31 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 1nRFio-0006DF-6r for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Mar 2022 16:56:30 +0100 Original-Received: from localhost ([::1]:43828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRFin-0002EV-2y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Mar 2022 10:56:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRFdW-0007A4-Kk for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 10:51:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRFdW-0006N4-CA for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 10:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRFdW-0000Al-Af for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 10:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Roland Winkler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Mar 2022 15:51: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.1646668226603 (code B ref 54158); Mon, 07 Mar 2022 15:51:02 +0000 Original-Received: (at 54158) by debbugs.gnu.org; 7 Mar 2022 15:50:26 +0000 Original-Received: from localhost ([127.0.0.1]:54451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRFcv-00009e-PL for submit@debbugs.gnu.org; Mon, 07 Mar 2022 10:50:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRFcu-00009R-HS for 54158@debbugs.gnu.org; Mon, 07 Mar 2022 10:50:24 -0500 Original-Received: from [2001:470:142:3::e] (port=45554 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRFcp-0006F3-6J; Mon, 07 Mar 2022 10:50:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Ea569PVSOYPYeX/u+5iqYmblRDcCOov6Yhp8vR8SOcs=; b=j0dN4KWR9BsjpTSasgxK CMigplhrFURnKZ+UUY3iMcK+g1oMuZk8YkD/S++JzMUVMhgqJUFiVHO1RHMNRGQaf5DnVcOTS62ey 2C8oMi/vlzBVkRdZ2c1uCQRUnfbJGLyuGW7FyxS8u3WZmZJE39vKye3DonOrErJSpUY397aQRlXz2 yVUpMRUIvexA/F4MBcs6a4ac9Mc5OIf/xLSYm4WtXZo1Ko/q/xEpUGn/ljk8LVIU5ALjQ3Onvm+o2 fP5qqnLrW9ur1vSYbHfrzMsjJ8mwuxaMaWEtks7oDmZPjDn4yUKZpVsBhHTK+uTrvD0BrfoOLMXWw ccRkj+23HIsYUQ==; Original-Received: from [2600:1700:5650:f790::42] (port=51180 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRFco-0004Uv-Tt; Mon, 07 Mar 2022 10:50:18 -0500 In-Reply-To: <87a6eejjbr.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 25 Feb 2022 21:19:36 -0800") 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:228112 Archived-At: 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 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. Any help is appreciated! Roland