From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0InWM3AWb2ItlQAAbAwnHQ (envelope-from ) for ; Mon, 02 May 2022 01:23:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2HzRM3AWb2JsRgEAauVa8A (envelope-from ) for ; Mon, 02 May 2022 01:23:28 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2520539942 for ; Mon, 2 May 2022 01:23:28 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 89C225F478; Sun, 1 May 2022 23:23:24 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id C4B075E017 for ; Sun, 1 May 2022 23:23:21 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id D7E825FBD7; Sun, 1 May 2022 19:23:20 -0400 (EDT) Received: (nullmailer pid 2305930 invoked by uid 1000); Sun, 01 May 2022 23:23:19 -0000 From: David Bremner To: Sean Whitton , notmuch@notmuchmail.org Subject: Re: Forcing a sync of maildir flags? In-Reply-To: <87d0a7zpfd.fsf@iris.silentflame.com> References: <871rqp97o0.fsf@iris.silentflame.com> <87r1ypsb1p.fsf@tethera.net> <87r1yp6joi.fsf@iris.silentflame.com> <87mu9cg5xy.fsf@tethera.net> <87d0a7zpfd.fsf@iris.silentflame.com> Date: Sun, 01 May 2022 20:23:19 -0300 Message-ID: <87ee1c7s7s.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: YING6WU2CUYD63FRJGMO6CU6LK3YIN6L X-Message-ID-Hash: YING6WU2CUYD63FRJGMO6CU6LK3YIN6L X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651447408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=y/uEeARq5PhF4QH7Vn6Rq8P7+qJTc7l6utSVAw0sm6w=; b=UzP3gypFRFa/UNeUNodp/9dc7xytTEqYoBnCl5Al8LCwFv+Y1WLzs8HoLgDkUdxRxndu33 InM5nAvGkYtleUNF8Ty6XOFyzVlPIZ05Ej0DkB67hNSgMbykBtP+c/eMtFdeGoequsa7ng t89gEDWsCjowmFg8E2Z2oHoHctoxzF1Qe6E+CrfAE619xV3GDoFcvMZoJQLGvF0CHtjngE 2dmNfWWaWxOQwAeuMtCAxYt/tipU0jCX7d6Yc/xpBdbZW9MqcUlpuPOXmxKm+QEwI1Kso4 PxQwCTLCr/WkAEodf2jtWKKghd0eF2xLKg3D1K8YkFvHJp3w/xcZBKaBYeUb9w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651447408; a=rsa-sha256; cv=none; b=nTw/cCWq2eiDdhDmEmJTbPtVSHpb8ZyieLJikK2XNVfbaIb0b2iemNo5iwuCMWBCH5LHEo jKIywFI1jOFaGP0RINkfDmU7arjwZFd1X9bwGwNYmri8HS1Piz/GkUyfQ1MssZSkJed0l2 cZ45qvehQ1+o3fLEh0T6r5Xd+dU/Q7VTEvgcYgJ+IuVk7YJ1Q8IjWTqxapv746GvTXDHSP HuOESlojuVL/pgqD9c7kCeXMV3WyRIMwR6Csxp1xMvf4DRWRdNtJGvu2zUeZjy0Uj7IHeB zHiyLHpaLIs1uw5VzwMUa2rTxTAmqEbJaw5084v+3JcL5A2M531/B5BbeTBF9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.03 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 2520539942 X-Spam-Score: -1.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: GYZNpzcGScJd Sean Whitton writes: > > Thanks. Let me record in this thread what I will believe it will take a > reproduce this in a test: > > 1) inbox and sent are Maildirs > > 1) Compose mail to a mailing list which will return copies of > submissions, with `Fcc: sent -unread` Since you mention Fcc, are you using notmuch insert? > > 2) notmuch new, and in post-new hook, notmuch tag -unread -- folder:sent > > Expected result: copy of message in both inbox and sent has Seen flag > > Actual result: only copy of message in sent has Seen flag I tried to simulate this in the form of a test. I'm not using notmuch insert here, but I manage to trigger similar looking behaviour: test_begin_subtest "duplicate file with seen flag" test_subtest_known_broken mkdir -p "${MAIL_DIR}"/sent/{cur,new,tmp} notmuch config set maildir.synchronize_flags true add_message '[subject]="seen message"' '[filename]=fcc-file:2,S' '[dir]=sent/cur' notmuch new # for debugging notmuch search subject:"seen message" mkdir -p "${MAIL_DIR}"/inbox/{cur,new,tmp} cp "${gen_msg_filename}" "${MAIL_DIR}"/inbox/new/copied-file:2, notmuch new # for debugging notmuch search subject:"seen message" # next line is a no-op, because it already doesn't have the unread tag notmuch tag -unread folder:sent count=$(notmuch search --output=files subject:"seen message" | grep -c ',S$') # for debugging: notmuch search --output=files subject:"seen message" test_expect_equal "${count}" "2" This has the output BROKEN duplicate file with seen flag --- T050-new.41.expected 2022-05-01 22:51:45.644747316 +0000 +++ T050-new.41.output 2022-05-01 22:51:45.644747316 +0000 @@ -1 +1 @@ -2 +1 No new mail. thread:0000000000000011 2001-01-05 [1/1] Notmuch Test Suite; seen message (inbox) Processed 1 file in almost no time. No new mail. thread:0000000000000011 2001-01-05 [1/1(2)] Notmuch Test Suite; seen message (inbox) /home/bremner/software/upstream/notmuch/test/tmp.T050-new/mail/sent/cur/fcc-file:2,S /home/bremner/software/upstream/notmuch/test/tmp.T050-new/mail/inbox/new/copied-file:2, The key point is that from notmuch's point of view the message never has the unread tag, so there is no change for "notmuch tag" to sync with maildir flags. It doesn't seem to make a difference if I put the copy in inbox/new or inbox/cur, so I don't think it is related to the previous efforts not to prematurely move files out of new/. As far as I can tell, notmuch-new (unlike notmuch-insert) does not call notmuch_message_tags_to_maildir_flags, so the maildir flags on the newly discovered copy are not updated. Perhaps it should, but that seems like a pretty big change, so I want to proceed with caution.