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

Merge pull request #6 from invisiblebits/lologf-patch-raw-unicode

Update models.py
This commit is contained in:
Manuel Gomez 2019-05-24 12:28:45 +02:00 committed by GitHub
commit edc27af632
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -385,9 +385,9 @@ class Mailbox(models.Model):
# Fix to accept subject emojis in utf-8
if 'subject' in message:
msg.subject = (
utils.convert_header_to_unicode(unicode(message['subject']).decode('utf-8'))[0:255]
utils.convert_header_to_unicode(message['subject']).encode('raw-unicode-escape'))[0:255]
)
msg.subject = repr(email.header.decode_header(msg.subject)[0][0]).replace("'", "")
msg.subject = unicode(email.header.decode_header(msg.subject)[0][0]), errors='ignore')
if 'message-id' in message:
msg.message_id = message['message-id'][0:255].strip()
if 'from' in message: