SESEmailForward icon indicating copy to clipboard operation
SESEmailForward copied to clipboard

Tears apart multi-line content-type

Open particleflux opened this issue 6 years ago • 0 comments

Content-Type headers spanning multiple lines, like the ones uses by PGP/MIME, get torn apart.

For example the following excerpt of an email (last lines of header + start of body):

MIME-Version: 1.0
Content-Type: multipart/encrypted;
 protocol="application/pgp-encrypted";
 boundary="xRmQHxB0D5FgqSvOWFFhW9uLSlHPBbY4w"

This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)
--xRmQHxB0D5FgqSvOWFFhW9uLSlHPBbY4w
Content-Type: application/pgp-encrypted
Content-Description: PGP/MIME version identification

becomes this:

Subject: Fwd: Test
Content-Type: multipart/encrypted;
MIME-Version: 1.0

which then fails to be parsed correctly.

I guess the best solution would be to keep the existing headers and replace the relevant ones instead of re-writing them all

particleflux avatar Aug 26 '19 19:08 particleflux