email mirror: ignore decoding errors.

Empirically, we only get these for malformed emails where the charset
specified in a message part header does not match the true encoding of
the part. I checked what the resulting Zulip looked like for the
original offender, and it looked find with ignoring errors.

(imported from commit ac6ba65b611cb22d4ec547b75a585abce6fc50b0)
This commit is contained in:
Jessica McKellar 2013-09-24 10:05:26 -04:00
parent b2a352da00
commit f0911f51a0
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ def get_message_part_by_type(message, content_type):
if part.get_content_type() == content_type:
content = part.get_payload(decode=True)
if charsets[idx]:
content = content.decode(charsets[idx])
content = content.decode(charsets[idx], errors="ignore")
return content
def extract_body(message):