X-Envelope-From: notmuch-bounces@notmuchmail.org  Thu Aug 27 16:30:24 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 DB1915F886;
	Thu, 27 Aug 2026 16:30:23 +0000 (UTC)
X-Greylist: delayed 406 seconds by postgrey-1.36 at yantan; Thu, 27 Aug 2026 15:54:46 UTC
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])
	by mail.notmuchmail.org (Postfix) with ESMTPS id 6A2305F867
	for <notmuch@notmuchmail.org>; Thu, 27 Aug 2026 15:54:46 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp-out2.suse.de (Postfix) with ESMTPS id 5B96A1FB1D
	for <notmuch@notmuchmail.org>; Thu, 27 Aug 2026 15:47:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1787845674; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type;
	bh=R/6aX34ENaEZIQPcW61w8E49G2rD43PQcy7LplniuKY=;
	b=OXVEyEri5WahkTxOo6EDdPwHwA+2R6aRNylewT3PK1VYl8tFmjIee0DebU+mA9iaRA/uhF
	OmON0Ua5616oW0OXyE1kGLAuKJBR0LZheHoYK2XXDcPIzNDPGZtFKIDTreNZfiyTtFR3iZ
	u3WTp+tEB4ExbNGlHaIy3DGdJfwQWbM=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1787845674;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type;
	bh=R/6aX34ENaEZIQPcW61w8E49G2rD43PQcy7LplniuKY=;
	b=8SuUbmj9KWjS1GwoImIraM2ckAD5FiBq0Ns7CK1QezSGG6GPq7+mJiF/LCHmD+S6qY7P2L
	JFS+fX4O6xnyBeCg==
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Vr3kT0yR;
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Us5n3hT2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1787845670; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type;
	bh=R/6aX34ENaEZIQPcW61w8E49G2rD43PQcy7LplniuKY=;
	b=Vr3kT0yRdryn9vESYZXPWkjcc7ASH9c7YvXWX0cKQiqhlp2e1W71iGCLEISyhIZxhh2mAg
	GoHOijvQWgU0lSd42H1eyFKtGPPc7kl/zL1UruWuX9LSRASU3jCGVRlm5AYzv7MRPR8jle
	fUoZ/dI60iU5l1xdsJYO+iahPXvv5Tg=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1787845670;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type;
	bh=R/6aX34ENaEZIQPcW61w8E49G2rD43PQcy7LplniuKY=;
	b=Us5n3hT23EmyyizrK6Bqob/9zB4geFgskzpcWG5huxCyhcyVK1ACPxsvnFIQOqguGdOc/P
	qrUPJ6vaMEPx+WBg==
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BBE531352D
	for <notmuch@notmuchmail.org>; Thu, 27 Aug 2026 15:47:49 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
	by imap1.dmz-prg2.suse.org with ESMTPSA
	id wIN1HyVckGrKeQAAD6G6ig
	(envelope-from <krisman@suse.de>)
	for <notmuch@notmuchmail.org>; Thu, 27 Aug 2026 15:47:49 +0000
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: notmuch@notmuchmail.org
Subject: Notmuch and cross-posts, is my database corrupted?
Organization: SUSE
Date: Thu, 27 Aug 2026 11:47:46 -0400
Message-ID: <87ld9rsgyl.fsf@mailhost.krisman.be>
MIME-Version: 1.0
X-Spam-Level: 
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 5B96A1FB1D
X-Spamd-Result: default: False [-3.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUBJECT_ENDS_QUESTION(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	ARC_NA(0.00)[];
	HAS_ORG_HEADER(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	MIME_TRACE(0.00)[0:+];
	MISSING_XM_UA(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_ONE(0.00)[1];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	TO_DN_NONE(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	DKIM_TRACE(0.00)[suse.de:+]
X-Spam-Flag: NO
X-Spam-Score: -3.51
X-MailFrom: krisman@suse.de
X-Mailman-Rule-Hits: nonmember-moderation
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0
Message-ID-Hash: JAEKH7LMKEBWOU3B4OEKLZTQPDYWZECD
X-Message-ID-Hash: JAEKH7LMKEBWOU3B4OEKLZTQPDYWZECD
X-Mailman-Approved-At: Thu, 27 Aug 2026 16:30:22 +0000
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


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?

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