mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Fixed encoding error when saving messages to file (fixes #85)
This commit is contained in:
parent
7bb816b9ce
commit
7fdfa4bb0f
1 changed files with 1 additions and 1 deletions
|
|
@ -362,7 +362,7 @@ class Mailbox(models.Model):
|
||||||
def _process_message(self, message):
|
def _process_message(self, message):
|
||||||
msg = Message()
|
msg = Message()
|
||||||
if STORE_ORIGINAL_MESSAGE:
|
if STORE_ORIGINAL_MESSAGE:
|
||||||
msg.eml.save('%s.eml' % uuid.uuid4(), ContentFile(message), save=False)
|
msg.eml.save('%s.eml' % uuid.uuid4(), ContentFile(message.as_string(unixfrom=True)), save=False)
|
||||||
msg.mailbox = self
|
msg.mailbox = self
|
||||||
if 'subject' in message:
|
if 'subject' in message:
|
||||||
msg.subject = convert_header_to_unicode(message['subject'])[0:255]
|
msg.subject = convert_header_to_unicode(message['subject'])[0:255]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue