I expected the part headers to include the Content-Transfer-Encoding as-is, and for the part body reader to return content as-is.
What did you see instead?
I found that Part has special handling for parts with Content-Transfer-Encoding: quoted-printable, which as introduced in issue #4411.
GitHub has also just led me to issue #26803 (which I failed to find before) which also proposes a way to bypass this via Part.NextRawPart. Unfortunately, although that proposal was accepted, the issue was closed by the submitter before being implemented.
Having access to the raw part body and unmodified headers is useful. In particular, for an IMAP server, I need to be able to inspect the part headers and body, including the Content-Transfer-Encoding header, in order to build the BODYSTRUCTURE response.
I can think of a couple workarounds for my particular server but they're not great, and I think this deserves a fix in the std library.
changed the title
mime/multipart: allow disabling automatic quoted-printable handlingDec 4, 2018