Author msapiro
Recipients barry, msapiro, r.david.murray
Date 2016-06-14.18:52:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The attached file, bad_email, can be parsed via

msg = email.message_from_binary_file(open('bad_email', 'rb'))

but then msg.as_string() prodices the following:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/email/", line 159, in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/usr/lib/python3.5/email/", line 115, in flatten
  File "/usr/lib/python3.5/email/", line 189, in _write
    msg.replace_header('content-transfer-encoding', munge_cte[0])
  File "/usr/lib/python3.5/email/", line 559, in replace_header
    raise KeyError(_name)
KeyError: 'content-transfer-encoding'
Date User Action Args
2016-06-14 18:52:52msapirosetrecipients: + msapiro, barry, r.david.murray
2016-06-14 18:52:52msapirosetmessageid: <>
2016-06-14 18:52:52msapirolinkissue27321 messages
2016-06-14 18:52:52msapirocreate