filtering headers from forwarded messages

classic Classic list List threaded Threaded
4 messages Options
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

filtering headers from forwarded messages

hey folks--

i recently had cause to forward a set of messages to a colleague via
notmuch (thank you for "notmuch-show-forward-open-messages"!), and
noticed that forwarding messages that i've personally received leaks
quite a bit of metadata about message delivery paths that is (a)
generally not useful when i'm forwarding in order to transfer the
message content, and (b) potentially harmful to users whose message
routing path reveals something bad or awkward about their setup.

For example, maybe for some people, their incoming mail path shows that
they're actually reading their personal e-mail on their employer's
mailsystems, but they don't want to expose their place of employment to
someone just by forwarding a message.  (this path is exposed by
Received: headers)

Or, there are internal headers added by local antispam or antimalware
filters, and they don't want to expose the specifics of their filtering
defenses because it might enable attacks on those systems (or customized
bypass mechanisms).

So, it occurs to me that someone might want to forward a message (or
messages) while filtering the headers in some way.

Of course, for messages being forwarded for the purpose of debugging the
transit path, you *don't* want to filter out headers.

In notmuch-emacs, i can manually filter the headers by editing the reply
compose buffer, of course, but it's kind of a pain, and it'd be nice to
have it done automatically for me.

Some possible filters i can imagine (which might well have problems, i
would appreciate any review):

 - blocklist: remove all headers that are in a fixed set: (Received,
      Delivered-To, Received-SPF, X-Original-To, Return-Path,
      X-Virus-Check-By, X-Virus-Scanned, Authentication-Results, X-MS-*,
      X-Microsoft-*)
 
 - allowlist: remove all headers except for a fixed set (To, From, Cc,
      Subject, Date, Message-Id, References, In-Reply-To, MIME-Version,
      Content-*, List-*, Sender)

 - ordered removal: remove all headers up to and including the last
   Received line


Has anyone else considered this use case, or thought about how to make
it easy/simple to do the right thing when using Notmuch?  Are there
other factors that are worth considering?

    --dkg

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

signature.asc (233 bytes) Download Attachment
Teemu Likonen Teemu Likonen
Reply | Threaded
Open this post in threaded view
|

Re: filtering headers from forwarded messages

Daniel Kahn Gillmor [2019-12-20T13:50:03-05] wrote:

> In notmuch-emacs, i can manually filter the headers by editing the
> reply compose buffer, of course, but it's kind of a pain, and it'd be
> nice to have it done automatically for me.

> Has anyone else considered this use case, or thought about how to make
> it easy/simple to do the right thing when using Notmuch? Are there
> other factors that are worth considering?

The underlying message-mode has these variables:

    message-forward-as-mime
    message-forward-before-signature
    message-forward-ignored-headers
    message-forward-included-headers
    message-forward-show-mml

I have not studied those very closely but at least I know that when
-as-mime is nil user can use -included-headers to set what headers user
wants to include.


--
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tlikonen@...
/  https://keybase.io/tlikonen  https://github.com/tlikonen

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

signature.asc (707 bytes) Download Attachment
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

Re: filtering headers from forwarded messages

On Mon 2019-12-30 15:16:59 +0200, Teemu Likonen wrote:

> Daniel Kahn Gillmor [2019-12-20T13:50:03-05] wrote:
>
>> In notmuch-emacs, i can manually filter the headers by editing the
>> reply compose buffer, of course, but it's kind of a pain, and it'd be
>> nice to have it done automatically for me.
>
>> Has anyone else considered this use case, or thought about how to make
>> it easy/simple to do the right thing when using Notmuch? Are there
>> other factors that are worth considering?
>
> The underlying message-mode has these variables:
>
>     message-forward-as-mime
>     message-forward-before-signature
>     message-forward-ignored-headers
>     message-forward-included-headers
>     message-forward-show-mml
>
> I have not studied those very closely but at least I know that when
> -as-mime is nil user can use -included-headers to set what headers user
> wants to include.
Thanks for the pointer!  it looks like
message-forward-{ignored,included}-headers should do (roughly) what i
want.  I'll try them out.

    --dkg

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

signature.asc (233 bytes) Download Attachment
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

Re: filtering headers from forwarded messages

On Wed 2020-01-08 10:25:50 -0500, Daniel Kahn Gillmor wrote:
> Thanks for the pointer!  it looks like
> message-forward-{ignored,included}-headers should do (roughly) what i
> want.  I'll try them out.

Just reporting back that they do indeed suit my purposes.  Things are
much nicer now that i've customized them to suit my tastes.

Thanks, Teemu!

        --dkg

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

signature.asc (233 bytes) Download Attachment