Subject: bug#45631: 27.1; regression: message-forward-ignored-headers no longer applies when forwarding as MIME

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 18 Jan 2021 16:50:10 +0100

Daniel Kahn Gillmor <[email-masked]> writes:

>>   Content-Type: multipart/signed; boundary="=-=-=";
>> 	micalg=pgp-sha256; protocol="application/pgp-signature"
>
> I agree, but if the user is stripping the Content-Type header, i think
> they're going to break a lot more than digital signatures or encryption
> (imagine what that does to a multipart/alternative message).  I think
> that stripping Content-Type is more of a case of "don't do that, then".
> Maybe we even want to warn if the user tries to strip any of the
> Content-* headers more generally.

This is bringing back memories...

When forwarding messages, we have three cases:

1) Forward as non-MIME

Heeding message-forward-included-headers is unproblematic here: The
recipient isn't going to be able to reconstruct the original message at
all, since none of the MIME headers (and stuff) is included in
`message-forward-included-headers'.  This basically means that the
recipient can just read the text itself.

2) MIME, but `message-forward-show-mml'

We can also remove all the headers here, because Message will
reconstruct all the MIME headers needed for the recipient to reconstruct
the entire original message, with multipart bits and all.

3) MIME, but not `message-forward-show-mml'

We don't remove any headers, because we don't know which ones are needed
for the recipient to actually read the resulting nested message.
Certainly not based on `message-forward-included-headers' -- this just
leaves From/Subject/etc.

So...  I think what message was doing before my last change was correct,
but insufficiently documented: If we have `message-forward-as-mime', but
not `message-forward-show-mml', then we can't remove headers based on
`message-forward-included-headers', because the resulting message will
be invalid.

If headers are to be removed in 3), then we have to come up with a
`message-forward-headers-not-removed-when-using-mime-but-not-mml' (phew)
variable, that contains the headers necessary for reconstructing the
resulting message.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no