From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31782 invoked from network); 10 Jan 2023 21:10:57 -0000 Received: from lists.gnu.org (209.51.188.17) by inbox.vuxu.org with ESMTPUTF8; 10 Jan 2023 21:10:57 -0000 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFLtJ-0002k0-R4; Tue, 10 Jan 2023 16:10:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFL8r-0007Lj-Jh for info-gnus-english@gnu.org; Tue, 10 Jan 2023 15:22:42 -0500 Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFL8p-0002vL-7Q for info-gnus-english@gnu.org; Tue, 10 Jan 2023 15:22:41 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boula.in; s=key1; t=1673382152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=QLxjzAhkHlOnyHq37PHmK4XVl1QDuKNs1c8qc7I3v5E=; b=qB0YZ+W/7pv20nOkNr56tv0whxVbrw1IsbIn9vT8+4nGV7DFgddyoxX708Cyfv4EvHR0et 0y86clKIWaqWTkZFhl6knrKC+jsjGyc+hSICVPjWncQfGN9FBf4HgwiQg29EPDTM3sMuch gm/hmDaERLr+bgeTq8vdZfxuhDmST7kg2/ILYOM7N2MY4VnZ5z4yz10+CAbN+DImvGaTte bU/e8Z7zs7AZ+Z5U6P389SSaAcXriRq98Sf3TOxpY4XtVWA/YsIO6Y1IcN4Z/T3xBFFozZ 70N5BaOsY/rltOE9JtSjnihLXJScTGiQchhqmcCRZBonZW+oI/gdr/YvJRgESQ== From: Kevin Boulain To: info-gnus-english@gnu.org Subject: Does gnus-summary-move-article need to clear the marks? Date: Tue, 10 Jan 2023 21:22:27 +0100 Message-ID: <87h6wyrvgc.fsf@boula.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=kevin@boula.in; helo=out2.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 10 Jan 2023 16:10:40 -0500 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+ml=inbox.vuxu.org@gnu.org Sender: info-gnus-english-bounces+ml=inbox.vuxu.org@gnu.org Hey, I'm trying out Gnus and the IMAP server from which I'm getting my emails is running a Sieve script that takes some actions, including setting a bunch of IMAP keywords/flags ('client' ones, not the system ones like \Seen as per https://www.rfc-editor.org/rfc/rfc3501#section-2.3.2). When an email with these custom flags is marked as read (via 'd', gnus-summary-mark-as-read-forward) and moved to another IMAP folder (via 'B m', gnus-summary-move-article) it loses its flags. In the IMAP log (that I got with nnimap-record-commands) I can see: UID STORE 65 FLAGS.SILENT (\Seen) A quick Edebug breakpoint on nnimap-request-set-mark (where the magic seems to happen) gives the following backtrace: nnimap-request-set-mark("INBOX" (((65) set (read)) ((65) del (unexist seen forward unsend download cache save score dormant bookmark killed expire reply tick))) "$SERVER") gnus-request-set-mark("nnimap+$SERVER:INBOX" (((65) set (read)) ((65) del (unexist seen forward unsend download cache save score dormant bookmark killed expire reply tick)))) gnus-summary-push-marks-to-backend(65) gnus-summary-move-article(nil) funcall-interactively(gnus-summary-move-article nil) command-execute(gnus-summary-move-article) So the issue appears to be that gnus-summary-push-marks-to-backend calls gnus-request-set-mark with 'set: https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/gnus/gnus-sum.el?h=emacs-28.2#n10390 Should it be 'add instead, which should preserve the set of flags? https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/gnus/nnimap.el?h=emacs-28.2#n1243 Similarly to what marking as read does: UID STORE 67 +FLAGS.SILENT (\Seen) >From around here: https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/gnus/gnus-sum.el?h=emacs-28.2#n12896 This patch appears to work but I'm not familiar with the code: diff --git i/lisp/gnus/gnus-sum.el w/lisp/gnus/gnus-sum.el index 3f350bffb3..a13777cd95 100644 --- i/lisp/gnus/gnus-sum.el +++ w/lisp/gnus/gnus-sum.el @@ -10390 +10390 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." - (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set) + (gnus-request-set-mark gnus-newsgroup-name `(((,article) add ,set) PS: I sent a similar email to ding@gnus.org a few days ago but it doesn't look like it went through. Apologies if it ends up duplicated.