unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Gregor Zattler <telegraph@gmx.net>, notmuch@notmuchmail.org
Subject: Subjects for messages with multiple files
Date: Sat, 06 Aug 2022 08:07:08 -0300	[thread overview]
Message-ID: <87r11tljfn.fsf@tethera.net> (raw)
In-Reply-To: <871qtvt4dw.fsf@no.workgroup>

Gregor Zattler <telegraph@gmx.net> 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

  reply	other threads:[~2022-08-06 11:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  9:03 [bug]: notmuch-emacs: notmuch-show: "c F" shows same file name for different instances of duplicate messages Gregor Zattler
2022-08-04 21:47 ` David Bremner
2022-08-04 21:58   ` David Bremner
2022-08-05  9:40     ` Gregor Zattler
2022-08-06 11:07       ` David Bremner [this message]
2022-08-05  9:21   ` Gregor Zattler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r11tljfn.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=telegraph@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).