X-Envelope-From: notmuch-bounces@notmuchmail.org  Fri Aug 28 10:27:19 2026
Return-Path: <notmuch-bounces@notmuchmail.org>
X-Original-To: nmbug@yantan.tethera.net
Delivered-To: nmbug@yantan.tethera.net
Received: from yantan.tethera.net (localhost [127.0.0.1])
	by mail.notmuchmail.org (Postfix) with ESMTP id E725E5F88C;
	Fri, 28 Aug 2026 10:27:18 +0000 (UTC)
Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634])
	by mail.notmuchmail.org (Postfix) with ESMTPS id 7463D5F873
	for <notmuch@notmuchmail.org>; Fri, 28 Aug 2026 10:27:15 +0000 (UTC)
Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2cedda2ce6fso5813625ad.1
        for <notmuch@notmuchmail.org>; Fri, 28 Aug 2026 03:27:15 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1787912833; cv=none;
        d=google.com; s=arc-20260327;
        b=FvG/Wp9zscUznW/UBfbh1qFTPFrgalj2UDWb033fY59IqgcyMfVKZDBRRl9XN9xGfL
         dV9LfHvwEsA69y6/6iwbpRXYTxPxyn60s03/6kI7cZw8Xf5my0nisipSxDlbj6GUaRHf
         91CK1oqVe6M31rleMmZgp6h+lIehMTLykmLRtb6ekZADIhoD8W0I2GNqy4BaiA7z71ju
         KvmfUE20BFAfn6+e0ikexxP7vxM6DvDwWSNu26wc8GyJNIo0VPnSw0uXoUeAxayJWnMY
         sG2MPnDCJNdLfYXH+3POKcND/H04AC180NLNFfC8hB8RhqO4fgcjT6ZRdoFiGx+a22VP
         djIA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=wTa6DLuNdcAYELWeFG8Uf4N9zHC3UrxFzjp9CvnwtLU=;
        fh=aL9+x5QhvsmuvCzRv0jvnRerfJNkmUEv/b4GG+Ps08o=;
        b=o0BJ4Z1mZWvORZZc9Ts0kqhkPZudQrqQ6InT1dSNoVwrGH/KBugU6+dWbmxgL5fa2x
         h9Pas1iSB5WeEzsB/4pLyvYgBKTerJ4wMJy5jnMHah8bQIuifYqxw+LIPYOt+tS/w0fx
         6oFnNfFEe/TecGPJAc7HUT+WxnKjDpQvyD9bU9+WSpPq4/Z12igUL82EHp2vu/x64Mx+
         dHM9Xgr4n6R4SdzvbWKFc8e1iNY1Wvd9OShzm+LPAbIkgyQW54NrkmJb5/SCauqzPOzp
         z2oO4bHG4+1oC24ZaxEArnZUAekrHGrLEFwcEmfofBekUqCiXSw/mvXQRw0v7up4dU/m
         JuWw==;
        darn=notmuchmail.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1787912833; x=1788517633; darn=notmuchmail.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=wTa6DLuNdcAYELWeFG8Uf4N9zHC3UrxFzjp9CvnwtLU=;
        b=OV1zPZpyqSOIdzNPq4O+n0apIAo7hf5QLDj/th0EKX9y8ajvRb5/hjM9s9QFiz7Sdk
         3SD73wTYj4XGPhMZUMRTGXLYmZaTHTO7viiJtth/SysKoUltQdKXZ9YVvGYRVlQqEmIb
         eFxOFco+ZCKjiaC269MbsscR111Xz8kSFE8pa9qq+nEBJ6JTbBPy6ZyAHs5W94WivrgV
         fUVmBfDQtweS/4r4E+sK1fInNOvqYjD8wCsJUfmNZNBOBaxFbF2pAEBP1tIF+bGRod/2
         ZTUCG38oB9MXHoxqo3i0huYDGsNaLEPwDoH/iB6ioFMFcFTj6HyLLbpnhyUMXQ+c1nbo
         Zyfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1787912833; x=1788517633;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wTa6DLuNdcAYELWeFG8Uf4N9zHC3UrxFzjp9CvnwtLU=;
        b=sM1BHkkEpcQFU03oyyZN1ZkDJ3LezE19U0v4WX+cP7CueKgL0Hx0ib8j3U3hLII2qQ
         7KX6ORhTk1rSb2T5lxZAgMdZeKqDIXbZLj9RdIugEjYXzjuldprDPz6j/2xQfvvjJBb0
         BkDxl199B6F1dYH5V1CkO0Tq8PYoKvxMzCdsMXtk3UtcJt7V23OD6ROcHXDZuv2vHIf9
         ZUjArstRstcovTPr553WYn4J19AWJ+w0IspioDoTp6SQATbx7kyloXBjkTgpu0Jxdqc/
         Mj4/Op3VvpczYlyAVqUM+4EyFLVkcWwjLhNXt3rJFfCcseos+58IvXLHhB/A1gVIh6yF
         /UzQ==
X-Gm-Message-State: AFuF++nEi7f3vYqcGYlROL5DhjBouqe4IIGkb5aJrAe9r3Boqm23Rtg+
	ottlS1PKmmp+wnrkdMjtbO1h1m4pXxCqkvNG0o+hCD0t5goemgGdfrXgaa/Z7Bxi+3M3KVZSQ2N
	JxBki+HBl6/Yqacg+HcAWE8c40Kaf5TM=
X-Gm-Gg: AR+sD118CyzVodKL+MSPZeXLYg3OSxHac8fSwf7/4wrsPdg60RwkbMkEPe3IP5wMdq8
	FjwF2Ln/N5Crx249wEpdnpErsoMEonkRNO70AGphEiz/c9XuGFco15BOq7fYkQmSzQsCGdiKZEj
	Wdmnfwm9KzHUp2Qrgr1tQ6Aqd5Th+ucXhizaCmmD4o/jI9s2bFYiUrtmdnYWT5n1dcqqYUH5+TC
	RGPJfJ1KgsrWDdcrC2yhm5wBTXs7NAcK1sF+Uk/sGCFk/AL3WFuMl0D94FaKlGZTG0C25JGPnPG
	6JanLd6Pm5pUALQ7ZqSpScRd+A3MrCdBjs+eONkqUb+GGREP0PxaBE83Ni9wGzz9wKusOZ4tS8l
	j8w==
X-Received: by 2002:a17:90a:da83:b0:396:5cdc:4bea with SMTP id
 98e67ed59e1d1-396d0e7cd03mr11343746a91.5.1787912833466; Fri, 28 Aug 2026
 03:27:13 -0700 (PDT)
MIME-Version: 1.0
References: <87ld9rsgyl.fsf@mailhost.krisman.be>
In-Reply-To: <87ld9rsgyl.fsf@mailhost.krisman.be>
From: Michael J Gruber <michaeljgruber+grubix+git@gmail.com>
Date: Fri, 28 Aug 2026 12:27:01 +0200
X-Gm-Features: AcwNN1UJiylC__3lQItftvDjTBdc_0KRmqx1rfJOPavMyGCLkwA2IR335RwZ4NQ
Message-ID: <CAA19uiRvQh5+utUs1_MOc_jPuR0eOQqTB8DwSFakdZShBT6uag@mail.gmail.com>
Subject: Re: Notmuch and cross-posts, is my database corrupted?
To: Gabriel Krisman Bertazi <krisman@suse.de>
Message-ID-Hash: QWRJK7LT47KSS425XS7FN3XWNWD7H6QD
X-Message-ID-Hash: QWRJK7LT47KSS425XS7FN3XWNWD7H6QD
X-MailFrom: michaeljgruber@gmail.com
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
CC: notmuch@notmuchmail.org
X-Mailman-Version: 3.3.3
Precedence: list
List-Id: "Use and development of the notmuch mail system." <notmuch.notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Owner: <mailto:notmuch-owner@notmuchmail.org>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Subscribe: <mailto:notmuch-join@notmuchmail.org>
List-Unsubscribe: <mailto:notmuch-leave@notmuchmail.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Am Do., 27. Aug. 2026 um 18:30 Uhr schrieb Gabriel Krisman Bertazi
<krisman@suse.de>:
>
>
> Hello,
>
> I'm hitting an issue with notmuch-emacs where if I search an email in a
> specific folder with tag:unread it doesn't show, but if I search without
> the tag:unread, notmuch finds it and says it has tag:unread.
>
> I removed emacs from the equation and tracked to notmuch:
>
> $ notmuch search 'thread:000000000001f39c AND folder:suse/INBOX'
> thread:000000000001f39c    August 07 [1/456(913)] Greg Kroah-Hartman| Joshua Peisach, Ronald Warsow, Pavel Machek, Shuah Khan, Thorsten Leemhuis, Brett A C Sheffield, Takeshi Ogasawara, Benjamin Boortz, Justin Forbes, Peter Schneider, Markus Reichelt, Ron Economos, Barry K. Nathan, Miguel Ojeda, Jeffrin Thalakkottoor, Mark Brown; [PATCH 7.1 293/438] io_uring/net: initialize mshot_len for send (patch signed unread)
>
> You can see it has tag:unread.  But if I add "AND tag:unread" to my search:
>
> $ notmuch search 'thread:000000000001f39c AND folder:suse/INBOX AND tag:unread'
> //no result
>
> In addition:
>
> $ notmuch search --output tags 'thread:000000000001f39c AND folder:suse/INBOX'
> patch
>
> After some debugging, I found the reason is that this message was
> cross-posted, and exists from multiple sources:
>
> $ notmuch search  --output files 'thread:000000000001f39c AND folder:suse/INBOX'
> /home/krisman/Maildir/lei/linux-fsdevel/cur/1f8e2d206fa939895a9c865a9cad26fdda96431f:2,S
> /home/krisman/Maildir/suse/INBOX/cur/1786117413.2069216_1.cartola,U=18382:2,S
> /home/krisman/Maildir/lei/INBOX/cur/1f8e2d206fa939895a9c865a9cad26fdda96431f:2,S
>
> They seem to be at least two different objects in the database:
>
> $ notmuch search  --output tags 'thread:000000000001f39c AND folder:lei/linux-fsdevel'
> patch
> signed
> unread
> $ notmuch search  --output tags 'thread:000000000001f39c AND folder:lei/INBOX'
> patch
> signed
> unread
> $ notmuch search  --output tags 'thread:000000000001f39c AND folder:suse/INBOX'
> patch
>
> So, the tags are out of sync across the cross-posts.  Is this expected?
> When I set a tag via notmuch-emacs (with +unread), should it update all
> versions of the message?
>
> In addition, The following commands seem inconsistent with each other.
> Either they both should find the INBOX copy of the message and report
> only the "patch" tag, or they should find the multiple objects and both
> report the 3 tags, IMO.
>
>
> $ notmuch search 'thread:000000000001f39c AND folder:suse/INBOX'
> thread:000000000001f39c    August 07 [1/456(913)] Greg Kroah-Hartman| Joshua Peisach, Ronald Warsow, Pavel Machek, Shuah Khan, Thorsten Leemhuis, Brett A C Sheffield, Takeshi Ogasawara, Benjamin Boortz, Justin Forbes, Peter Schneider, Markus Reichelt, Ron Economos, Barry K. Nathan, Miguel Ojeda, Jeffrin Thalakkottoor, Mark Brown; [PATCH 7.1 293/438] io_uring/net: initialize mshot_len for send (patch signed unread)
>
> $ notmuch search --output tags 'thread:000000000001f39c AND folder:suse/INBOX'
> patch
>
> In short, I could use some assistance in understanding how people deal
> with cross-posts, and whether this behavior is expected or if my
> database ended up somehow corrupted.  If that is the case, what is the
> process to regenerate it?

Before touching the database, please make sure that you are not mixing
up threads with messages. In particular, redo your searches with
`--output=messages` to check whether you get the same messages. The
database is by message.

That being said, `unread` is peculiar. Which mailstore do you use, and
do you sync flags? If you sync from mail store flags (`U`) and you
have to files with the same message ID but different `U`, it's a
matter of chance which one is read. I vaguely recall, though, that on
touching `unread` the status gets synced to all files for that mid. I
might be wrong, and an imap sync might reset it anyways.

Michael
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org
