mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
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:
@@ -137,7 +137,7 @@ def get_message_part_by_type(message, content_type):
|
|||||||
if part.get_content_type() == content_type:
|
if part.get_content_type() == content_type:
|
||||||
content = part.get_payload(decode=True)
|
content = part.get_payload(decode=True)
|
||||||
if charsets[idx]:
|
if charsets[idx]:
|
||||||
content = content.decode(charsets[idx])
|
content = content.decode(charsets[idx], errors="ignore")
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def extract_body(message):
|
def extract_body(message):
|
||||||
|
|||||||
Reference in New Issue
Block a user