This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mjpieters
Recipients barry, mjpieters, r.david.murray
Date 2018-12-21.00:52:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545353523.78.0.788709270274.issue35547@psf.upfronthosting.co.za>
In-reply-to
Content
Right, re-educating myself on the MIME RFCs, and found https://bugs.python.org/issue1372770 where the same issue is being discussed for previous incarnations of the email library.

Removing the FWS after CRLF is the wrong thing to do, **unless** RFC2047 separating encoded-word tokens. The work-around regex is a bit more complicated, but ideally the EW handling should use a specialist FWS token to delimit encoded-word sections that renders to '' as is done in unstructured headers, but everywhere. Because in practice, there are email clients out there that use EW in structured headers, regardless. 

Regex to work around this 

# crude CRLF-FWS-between-encoded-word matching
value = re.sub(r'(?<=\?=(\r\n|\n|\r))([\t ]+)(?==\?)', '', value)
History
Date User Action Args
2018-12-21 00:52:03mjpieterssetrecipients: + mjpieters, barry, r.david.murray
2018-12-21 00:52:03mjpieterssetmessageid: <1545353523.78.0.788709270274.issue35547@psf.upfronthosting.co.za>
2018-12-21 00:52:03mjpieterslinkissue35547 messages
2018-12-21 00:52:03mjpieterscreate