Re: WIP: filter out envelope headers in notmuch-insert.

Subject: Re: WIP: filter out envelope headers in notmuch-insert.

Date: Sun, 13 Feb 2022 10:06:27 -0400



From: David Bremner

David Bremner <> writes:

> David Bremner <> writes:
>> I thought about a more ambitious version that would replace any
>> existing "Return-Path" headers, but it seems like significantly more
>> work (the current code is not line based), and not obviously
>> better. Or maybe I missed the wording in the RFCs that talks about how
>> MDAs should behave here.
> The RFC wording I _did_ find is as follows.
> RFC5598 says that (ยง4.3.3)
>       The MDA records the RFC5321.MailFrom address into the
>       RFC5321.Return-Path field.
> where the first is the (address in) envelope from and the second is the
> Return-Path: header. I'm not sure how authoritative RFC5598 really is;
> it is "Category: Informational", whatever that means.

Starting at RFCs some more (as one does), I think that the "envelope
header" added by e.g. postfix's local(8) does not count as a
RFC5321.MailFrom (although it should contain the same
information). These mbox style envelope headers do not seem to super
well defined. RFC 4155, which is _about_ mbox, seems to go out of its
way not to define the syntax.

The following (from RFC5598) seems to indicate that
MDAs speak SMTP.

   Transfer into the MDA is accomplished by a normal MTA transfer

If correct, that means that notmuch-insert is not an MDA in the sense
meant by RFC5598

As an experiment I converted copy_fd to line oriented form (which I
guess I'll post seperately), but I realized that further progress would
require parsing the "envelope header" line.
notmuch mailing list --
To unsubscribe send an email to