From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew Cohen Newsgroups: gmane.emacs.bugs Subject: bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP) Date: Sun, 20 Mar 2022 05:52:04 +0800 Message-ID: <87lex5mwzf.fsf@ust.hk> References: <87tucmc2y4.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="32729"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: 54158@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 19 22:53:12 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 1nVh0Z-0008Hk-1n for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 22:53:12 +0100 Original-Received: from localhost ([::1]:43210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVh0X-0002iM-Q3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 17:53:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVh0Q-0002iA-HE for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 17:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVh0Q-0001YK-96 for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 17:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVh0Q-0005kp-7u for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 17:53:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87tucmc2y4.fsf@gnu.org> Resent-From: Andrew Cohen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Mar 2022 21:53: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.164772674222065 (code B ref 54158); Sat, 19 Mar 2022 21:53:02 +0000 Original-Received: (at 54158) by debbugs.gnu.org; 19 Mar 2022 21:52:22 +0000 Original-Received: from localhost ([127.0.0.1]:60721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVgzl-0005jo-SK for submit@debbugs.gnu.org; Sat, 19 Mar 2022 17:52:22 -0400 Original-Received: from mail-os0jpn01on2137.outbound.protection.outlook.com ([40.107.113.137]:15109 helo=JPN01-OS0-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVgzj-0005jY-EF for 54158@debbugs.gnu.org; Sat, 19 Mar 2022 17:52:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oNF5wG6VvJUtGKKzuLCGpjSVLH/RPGuu3F9ynFIgIdatPP1vL+xopql2iKrhFsKtWSH0te5NVoUsSsGCB5g4ngNtjOJiTwmwuQsMmaVm7/dAL+RIIH5hrru4D3tMGrDJEbb1mWS7iS8gVbRIf8CYs8NeZYMiFIchIZDJly+e2ZyLtdEicxRJc5mgkXZrR32T5ndo2nBFAY2UTn8q08w0VxEBe+ug19lG8R5Hr0IE2F6s7d+icuTWLCKIuLcmcRQWeB+9ythea0ZWqUN3LY9srbNlNoEnBpmWjjwyBWB68qBk0sENLSn/x29JBuBK2SMM4BeH18cRCf1lHGgOHgySgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=whDugnyQidplgevFmiCVC5d9FZkN/QwHwe7wA+d7Z5Y=; b=MxaDnj/Eli50szJeRJWI2JpNlWjUd0TM7x4Y2FukwoPZL2xCno3yVCjrsptkPgdXdsNH1wdq9xPPGNEFM627oNQ0IYJI4e1YaLLZBOVzqjnzj9n3sGu1kufMfDFWzX+gGcPk87o+wMxIN/8vB/Svp0pHR6Iz0MHjI2PNx3CLnFfLhPl45Rnz3cm729/wSCuWmC0cG/Xt0/y+LVK5jim4zmA2VIRtRyVjAYAHOK6dbvgvm+kTlbl7kWqeTbvJApJ/9AvBu3PYfK54HZGh2NJJVYz7LtrBj68xQw1+ABcKpS8Dddc1GQR5EjC7QrXGZCn0R9Rd1yoWOGyLKOgiMq/Rog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ust.hk; dmarc=pass action=none header.from=ust.hk; dkim=pass header.d=ust.hk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ust.hk; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=whDugnyQidplgevFmiCVC5d9FZkN/QwHwe7wA+d7Z5Y=; b=rBKPGohf0PwVS2DxBM4tNGUHV3TDHMa5rfIeD8hyiBZmj4v4ut2kbYLEgC4w8jYx5esn81qPA+QUQB2NLSFl9v7w7n/8GtHJvF6cxDSEZsLvmTP22oiw85bGdjIa/gI/kd1I4N02IIechoArpb7jLflesTNBYL9ztrDDCaOUhHS2RXeVlygfgDFTQ/yNI58VFOoDGAkTvOrhSlHMFbrpMPSzW1PBCSQ/52uUqweTb2trZVe7Imi1FoDa4lXgiWA4+BpniPb4y/e0tuFwGiwB+eJo73kWqAzVzHiu2qa8rC1v/bInjzTTjbFBVAK9qxdfcEGEthcDKyKyzMIC3o9Hyw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ust.hk; Original-Received: from OS3P286MB1877.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:1bf::11) by OSZP286MB1848.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:165::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.18; Sat, 19 Mar 2022 21:52:09 +0000 Original-Received: from OS3P286MB1877.JPNP286.PROD.OUTLOOK.COM ([fe80::255f:b27f:3eaf:717]) by OS3P286MB1877.JPNP286.PROD.OUTLOOK.COM ([fe80::255f:b27f:3eaf:717%4]) with mapi id 15.20.5081.019; Sat, 19 Mar 2022 21:52:08 +0000 X-ClientProxiedBy: HK2PR02CA0200.apcprd02.prod.outlook.com (2603:1096:201:20::12) To OS3P286MB1877.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:1bf::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12f92b0f-0083-4e4e-d9aa-08da09f2b6ed X-MS-TrafficTypeDiagnostic: OSZP286MB1848:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aFPfOZm8kuMYGwaA9R/oEdTdLUxQnx5+pmKkUg671eJtM75+F/OifojdYDzTY+CokAyCfwAaUA/6UHgnPO4X+ZWhN55wQHIvxgA7A1XNzGWEIHL0mw9GBmvVa8rJ4AwBGRbh61iCoMztlVE/hzOMC3oxHLTczLjiJ+mUdVIUf/PHeKhu+jqP4RJrPdtCYNVF3PiAncnSOI78oh0J7GkymrzMvUlvevY4KAVwJfdRqzgmizXxhY625ztSQ3uM1lKbapV/7nXk35tkJljJtVEjrzj0cwDuGx5AgR1Jij7VF4PyWvUv5g2lKC/0GHHzuW8LOtFQEW38Wgom/QCdtp/CI31IZOGQLR360fqbHwUTW2JUm7r8bCrit91UowDmWUsAYI0k7nwAZZ+787XoePyPwip+lhrNKXMC1JJ3P+/w/Md9OzGyGRAk4jdPPJX/AOEkgT2MotFB/EJGRAsLEgbVuu/Tb++cD0kxLTjmvY9yykt2ZXo4HTMdr53cFipIEHmTsc48B6AbfcfUQqoXxaY6aTNID00U6Cc8oRNLj0D3aebGUWQ7So3Udfke969TH1/h75fbDBpcMHSd2tmEUH0lQV8/CL7kdkXAXPgqlYku+7gWNW0DAe4fEQ7GrpN1aB198RjWm9aMcUudx0LBXDBFCQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3P286MB1877.JPNP286.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(83380400001)(26005)(186003)(6916009)(8676002)(36756003)(6512007)(2616005)(316002)(786003)(38100700002)(6506007)(6666004)(2906002)(6486002)(86362001)(5660300002)(508600001)(8936002)(66476007)(66946007)(66556008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tBpxtQzyrCGc2kiRo+7uiWS/bOlj9oDvCE+CHR5vrqgM60CtWeGZzIQ5zZ44wnPVv/QwQE03HI9nvIM+TU+iy5ZW2cyYYXRvcxF6cIGkwuZU+mYg3ZLWtULFXiH+U+n4JPJXatcO2Ep38rxzGZ1B788e/7VVt5K5si5QnYuSoWibZ63rXTVJwdjWvNUtz+FTWFPC+zRYfASIWIKgct7bD8+dDMco4DXXqL/oN1nxvA3RCLxSHtQ8pMZeR5KGwxhWIkKu2TV/D28w2MXTYwN6q/FcIUATDpsYK33ouZYxiiqRbbPF7CqteWJufjUjrd5PNJ2y7UFN4jHCAAZW8FPSahuBtj4J7K35BrCL10pd2cTOHus7AEkcPaWCX4AxQDCbaCYo7bdOSeWJxhyz74Tf0RNM0hbv/bwW9G88N7AfOyPE+U3ZDIgoSWqPRs5J8vlVXxU81PfbDusV0htH9qowzd/1ziR96AlQh/pYqqq31bFnVGyZizks9ZdKPUg+u3POWBWAvepsToC6LSLZvxPJOq/d/hEE0Ip1b5e4VWlIpiCUYZO9JSawfzwUkhtKAKhQN3WkkiBPAnQBy/XfdIKX2bOcDjVpKiNDnZHKWAA9Sr3ljRzFv/KhnNjHIJPBbjvv34mBwpruZjZ4pSEr64qd+ieku/i3FLjw4xmtGA/HJFSvVUCnxc2HEML+Dwtj2/PE5bgKFULxekLExTbNDU69pPoSWYEXyh1+21TSKY04gNC9J1JpEX/hevKDXy vmOkqlBxF9FeFRN7LxooUKdPp3QucdIP3pah8UTTJHbTfvd1LOrFIfHGtBscMXiYx00DQq7jDlqztnBy49Hh6xx4Ibxzn+8WvE X-OriginatorOrg: ust.hk X-MS-Exchange-CrossTenant-Network-Message-Id: 12f92b0f-0083-4e4e-d9aa-08da09f2b6ed X-MS-Exchange-CrossTenant-AuthSource: OS3P286MB1877.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2022 21:52:08.5560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c917f3e2-9322-4926-9bb3-daca730413ca X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yfAChbdx5s/jPlWHIu1s6cGJb69ZZ5x50Jig/u/qDr1v3meLbZzw6OSNXvPRqt9e X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZP286MB1848 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:228609 Archived-At: On Sat, Mar 19 2022, Roland Winkler wrote: >On Sat, Mar 19 2022, Andrew Cohen wrote: [...] >> So I think this might fix it (although I don't have a setup available >> to test it). > Thank you! I can confirm: I identified one scenario with emails I send >to myself such that they go into different folders on the IMAP server. >Then downloading these messages with Gnus from Emacs 28.0.91 gives me >reproducibly the duplicate mail downloads as described in the original >post. When I apply Andrew's patch to `mail-source-fetch-imap' the >downloads happen as expected, properly deleting the messages on the >server after download, as confirmed also with imap-log bound to to. >So for this one test case the patch appears to solve the problem. Great! >The patch may require more testing and also checking the code by someone >who knows what is supposed to happen in such an imap session. More testing would be good---but I suspect the number of users of a list of mailboxes with imap is small :) Fortunately the patch is quite minor and I'm pretty confident that this change is the right thing. My patch also fixes another bug---the header identifying the originating mailbox was getting set improperly (to the list of mailboxes rather than the actual mailbox). >I am surprised that `mail-source-fetch-imap' in Gnus from Emacs 27.2 >and from Emacs 28.0.91 are essentially the same (from all I can tell). >So I am wondering why `mail-source-fetch-imap' in Gnus from Emacs 27.2 >was behaving as expected; but the bug showed up only in Emacs 28. Can >this be in subtle ways related to the fact that mail-source.el in Emacs >27 used dynamic binding, whereas in Emacs 28 it uses lexical binding, >as speculated previously by Eric? This is indeed a mystery. If you are excited about getting to the bottom of it you could try enabling the log with emacs-27 and post the result of your scenario. The problem was the variable 'remove was accumulating UIDs from prior iterations of the loop. -- Andrew Cohen