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: Fri, 25 Feb 2022 21:19:36 -0800 Message-ID: <87a6eejjbr.fsf@ericabrahamsen.net> References: <87tucmc2y4.fsf@gnu.org> <87mtiek67l.fsf@ericabrahamsen.net> <87v8x2ljbs.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="26512"; 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 Sat Feb 26 06:20:13 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 1nNpV7-0006l9-Cx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Feb 2022 06:20:13 +0100 Original-Received: from localhost ([::1]:40980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNpV5-0007Yf-UL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Feb 2022 00:20:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNpUw-0007YX-Vy for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 00:20:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNpUw-0003s0-N3 for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 00:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNpUw-0006se-CF for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 00:20: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: Sat, 26 Feb 2022 05:20: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.164585278726412 (code B ref 54158); Sat, 26 Feb 2022 05:20:02 +0000 Original-Received: (at 54158) by debbugs.gnu.org; 26 Feb 2022 05:19:47 +0000 Original-Received: from localhost ([127.0.0.1]:54105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNpUg-0006rv-Rs for submit@debbugs.gnu.org; Sat, 26 Feb 2022 00:19:47 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:55130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNpUe-0006qg-D5 for 54158@debbugs.gnu.org; Sat, 26 Feb 2022 00:19:45 -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 20027FA558; Sat, 26 Feb 2022 05:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1645852778; bh=52uJ+NI4yFPP83MKjVywIJ6k3LcmyDxpUWeyJwOyoTg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lLClfJPGx10e/94kparDcRbDd1M9rgpYyWWp0D1U2va8Bq4p/gxWEsjnlMoXEb9ot G++kbR4/lUHykHSmgjHjH4o4lMAlL4c5dBA0sUchJw82KAsJjwS/PBTgpNz+SjmK8R WJ5A2Jxn6M7TmD3Vy13hT0Tn95v5XNp4VFvsrQFo= In-Reply-To: <87v8x2ljbs.fsf@gnu.org> (Roland Winkler's message of "Fri, 25 Feb 2022 15:36:39 -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:227666 Archived-At: Roland Winkler 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 . If something funny is happening with the values of fetchflag or dontexpunge, we can drag in Stefan M, who changed `mail-source-bind'. Eric