1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Fix for #82; Improper handling of badly-encoded documents.

* fix logging warning message

* decode as ascii on Decode error

* Add test case for #88 #82

* add test case bis for #88 #82
This commit is contained in:
antcorro 2016-04-04 21:28:11 +02:00 committed by Adam Coddington
parent 512c44bca6
commit 3c33a22c3e
3 changed files with 116 additions and 2 deletions

View file

@ -347,12 +347,12 @@ class Mailbox(models.Model):
)
except ValueError:
logger.warning(
"Decoding error encountered; interpreting as ASCII!",
"Decoding error encountered; interpreting %s as ASCII!",
content_charset
)
msg.set_payload(
msg.get_payload(decode=True).decode(
content_charset,
'ascii',
'ignore'
)
)