[PATCH] Add a few tests for searching LWN emails.

Carl Worth cworth at cworth.org
Fri Jan 28 11:59:38 PST 2011


On Thu, 27 Jan 2011 03:31:49 -0700, Thomas Schwinge <thomas at schwinge.name> wrote:
> These tests should pass -- but they currently don't.

Hi Thomas,

Thanks for sending these test cases. This is actually my favorite way to
receive bug reports. I really appreciate it!

> What we get from these emails, is an author named ``LWN.net'', and the
> ``Weekly Notification'' / ``Mailing Lists'' bits are stripped away.  I
> suspect this may be a misinterpretation in the notmuch address parser,
> related to the dot in the name.  I have not yet looked at the relevant
> code.

Yes, I believe this is related to the dot in the name. From my
recollection a name with an address requires quoting. So the header that
is currently formatted as:

	From: LWN.net Weekly Notification <lwn at lwn.net>

should instead be:

	From: "LWN.net Weekly Notification" <lwn at lwn.net>

I verified that adding this quoting fixes the tests[*]. I've CCed
lwn at lwn.net in case the kind editors there would like to add quoting
here.

I don't have any of the relevant RFCs in front of me now, so I don't
know exactly how an address with this missing quoting should be
parsed. But I recall having failures trying to send mail to an address
like this formatted without the quoting.

So I'm not sure what could reasonably be changed here in GMime or not. I
definitely do want to fix notmuch so that it indexes all of the text
here regardless if it's formatted in an RFC-compliant way or not.

-Carl

[*] Except for test VI which has a bug in that it searches for the word
"mailing" in the subject header, but no such word exists in the
message's subject header.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110129/1e1a6d6b/attachment-0001.pgp>


More information about the notmuch mailing list