From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8ACOA2VL7mJRfAEAbAwnHQ (envelope-from ) for ; Sat, 06 Aug 2022 13:07:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CESXA2VL7mLyPQEA9RJhRA (envelope-from ) for ; Sat, 06 Aug 2022 13:07:17 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 C9A221BEC8 for ; Sat, 6 Aug 2022 13:07:16 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ECCD75F3CE; Sat, 6 Aug 2022 11:07:13 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7F52D5F36D for ; Sat, 6 Aug 2022 11:07:10 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 1FD1F5FBC0; Sat, 6 Aug 2022 07:07:09 -0400 (EDT) Received: (nullmailer pid 1007813 invoked by uid 1000); Sat, 06 Aug 2022 11:07:08 -0000 From: David Bremner To: Gregor Zattler , notmuch@notmuchmail.org Subject: Subjects for messages with multiple files In-Reply-To: <871qtvt4dw.fsf@no.workgroup> References: <87edxw8jp4.fsf@no.workgroup> <87czdfn0kc.fsf@tethera.net> <87a68jn00u.fsf@tethera.net> <871qtvt4dw.fsf@no.workgroup> Date: Sat, 06 Aug 2022 08:07:08 -0300 Message-ID: <87r11tljfn.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: MJNTJBCBPPW43EOTGEXIM3UVMHE56R33 X-Message-ID-Hash: MJNTJBCBPPW43EOTGEXIM3UVMHE56R33 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=1659784036; 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=CfSCstdEmkCFnZc6XfB8sYlAAVrkVbBGn8P8Fqy5Hic=; b=EH1LADOl4RUNTc68MnRAj/Ne3lUNUgMZmS+sm2EA3GSsO2twPGXBJRYeXlT4CapnUzJ1h0 XGvZ+BLcyfEKh/wJHnn84NpoGgPo/T3zfIJ185KYaC+F8WK3IdMb08lTxN4bK6X3Dn4pYe 3NrsuQamBHlVKgo6S2xCKniCCwdN7vUDflYLl32o/DcVAS5YplyI9F+L1uNxF2qT4vvuoZ HYFreJdJaU7JnezFN4K2I4e+E7KL5Aaz/Y73OuTK86/cGJ6MbDwItUkFS3E2laXywoxr1T XqdbMll2NEzAcQSUNdHsm3oEaKfZm0MYgDFL/8A4ni2v9Qy8OVkAYVb2DHY/2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659784036; a=rsa-sha256; cv=none; b=B3/POSUQF/3jlloEW63wcrL0wTLM7+ifStO1A4icw5JGCQTdhnK3nQTg0f8/h8HpHHDJfh CaCl2vznIlfOF42xARn9dpkqQdynLXfiN+NqYMSOAbNALcokqgt334Z0lDUg0hg8MbWOfx EjeBJddOL3vhlNaDSOIF+JqY0ZSOasrVLjI0KG959e9W8aed5tDIzykmb0o/6QT/w65gKj 4QPfi9R28x8PBqYPdto7xzwlxx1Ecg+u6Zv+1/eEiR1O/W5DxPXBIBrYI+6YxvXUtrYHBs QWZG6ftO9V/Gx6WUzhiiFsdycjvu2WAvNRotyC92BP1aYmmzhYrMuxTsEV5nXQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -3.10 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: C9A221BEC8 X-Spam-Score: -3.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: CqOQw0Nb7Snx Gregor Zattler writes: > In my particular case the notmuch-search buffer shows two > lines for two matching threads one of which stands out > because its date is 1970-01-01 because I was too lazy to > provide Date: headers in the test case's messages. > > In my particular case the Subject: shown on this very line > for the test case is "two". But if I place the cursor on > this line and hit RET, the "first" of the three messages is > shown, which in my particular case happens to be the one > with Subject: "one". Correspondingly the very first line of > this notmuch-show buffer reads "one". The underlying issue here is a bit tricky. Each message-id has a subject value [1] associated with it. This is used to decide what to display from notmuch search (i.e. it's used to construct the subject threads) and it is used by the regex search. Currently (since 2017) we make some effort to maintain that as the subject of the first file indexed. The numbering of duplicates on the other hand is by lexicographic order of the filenames [2]. Probably we want to keep a list of subjects, but then the question is how to make the order match. Ordering the files by discovery order could be done (although not as trivially as you might expect) or ordering the subjects by alphabetical order of filename could be done. The latter probably requires less intrusive changes to the database, but the question, for those who made it this far is we care about keeping track of what the first indexed file is. I had a quick look back at the previous discussion [3] and I see some vague reference to that being desirable as mitigation for some duplicate message-id attacks, but I'm not sure how convincing that is. [1]: actually a Xapian value slot, for those familiar with Xapian. [2]: something like that anyway. The main point is that the database doesn't know anything about the order files are indexed (discovered). [3]: see e.g. https://nmbug.notmuchmail.org/nmweb/search/id%3A87378dny3d.fsf%40qmul.ac.uk