notmuch ignoring alot of emails

Alvaro Herrera alvherre at
Mon Jul 1 08:36:57 PDT 2019

On 2019-Jun-30, Tomi Ollila wrote:

> Just checking line starting with 'From ' would be pretty naïve since
> From may be first word in any line in text body.

Even so, early mail systems relied on there not being any such lines,
and they escaped those lines to be ">From" or to use quoted-printable
encoding.  GMime has bespoke code to do this, in fact.  Mail systems
stopped doing this escaping after MIME boundaries got more widely used,
I suppose.

I think NNTP used content length much more extensively than email.  Of
course, NNTP is almost disappeared now ...

> If we'd have to do content scanning then at least empty line before
> From would be reguired, and next lines starting like
> Received: someone at
> Date: a date
> From: someone
> (and then empty line... ;)
> all this checkin would be required and still it could fail (perhaps
> this content get modified in the fly, but then signature check, if
> this mail had one, could fail...)

This logic still fails if you have mail-like content in the mail, such
as attachments produced by "git format-patch".  Many open source lists
don't have this problem because they use "git send-email" instead, but
this is not universal.

> If there is header that tells the length of the body, then things
> could be easier...

Early emails had Content-Length as a header, but it was not universal,
and nowadays it seems to have been abandoned as a practice; the MIME
content boundary is used universally (or at least I cannot find any
recent divergence from this practice.)

Álvaro Herrera                      

More information about the notmuch mailing list