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 martin.panter
Recipients barry, martin.panter, msapiro, r.david.murray
Date 2016-06-13.12:58:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465822737.98.0.674119687358.issue26686@psf.upfronthosting.co.za>
In-reply-to
Content
FWIW in the HTTP bug <https://bugs.python.org/issue24363#msg244676>, David said “when seeing a line that doesn't look like a header the error recovery is to treat that line as the beginning of the body (ie: assume the blank line is missing).” I have no experience with email and RFC 5322 header handling, but it does make more sense to me to handle this as a defect in the header section, _not_ a genuine transition to the body (same as desired for the HTTP case).

Here is a patch that revives MalformedHeaderDefect (see Issue 14925), and continues parsing the rest of the header section instead of starting the body. But I am not sure how safe this change is. I did have to fix one unrelated set of tests (see headertest_msg in the Test8BitBytesHandling class) that did not include a blank line and was relying on the old behaviour.
History
Date User Action Args
2016-06-13 12:59:00martin.pantersetrecipients: + martin.panter, barry, msapiro, r.david.murray
2016-06-13 12:58:57martin.pantersetmessageid: <1465822737.98.0.674119687358.issue26686@psf.upfronthosting.co.za>
2016-06-13 12:58:57martin.panterlinkissue26686 messages
2016-06-13 12:58:57martin.pantercreate