> I don't think the issue with your test is the same problem.
What let's me think that my test triggers a bug is that notmuch doesn't
show any information about the sender in the overview of all messages.
This is from the test log:
-thread:XXX 2000-01-01 [1/1] Search By From Name [with brackets]; search by from (name with brackets) (inbox unread)
+thread:XXX 2000-01-01 [1/1] ; search by from (name with brackets) (inbox unread)
Also, leaving the brackets out of the search query in the test doesn't
help either.
Anyway, I attached a real message.
Quoting David Bremner (2018-10-09 01:54:51)
> Justin Humm <justin.humm@posteo.de> writes:
>
> > Hello,
> >
> > I struggle with searching the From field of mails, that have square brackets
> > in it. The first instance of that problem I found is
> >
> > From: =?UTF-8?Q?Shedhalle_T=c3=bcbingen_[Festival]?= <festival@shedhalle.de>
> >
> > In this case, on 0.27 I'm unable to find any mail with
> >
> > from:"Shedhalle"
> > from:"Tübingen"
> > from:"Festival"
> >
> > However I can find mails with
> >
> > From: "dependabot[bot]" <notifications@github.com>
> >
> > by searching for
> >
> > from:"dependabot"
> > from:"bot"
> >
> > I managed to write a short test, that reproduces the problem. It fails on
> > master, but should pass imho. It is attached below this mail. For me it
> > generates the following output:
>
> I don't think the issue with your test is the same problem. With that
> sample data, 'from:"Search By From Name"' works fine to match the
> thread. I'm not really sure why your test is failing, but in general it
> doesn't really make sense to search for punctuation, unless you use a
> (slower) regexp search. The details are in notmuch-search-terms(7),
> under "Terms and phrases"
>
> Can you provide a sample complete message where searching doesn't work?
> I suspect it's most likely a problem with the encoded header. I tried
> copying your "Shedhalle" from header into a test message and it seemed
> like the terms for phrase search were not being generated at index
> time. That looks like a bug, but I'd prefer to see a real message, if
> possible.