1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-10 06:48:19 +02:00

Always store message as attachment if its content-disposition is marked as such.

This commit is contained in:
Adam Coddington 2015-07-07 22:58:15 -07:00
parent 4c16494b1a
commit 6183f68b39

View file

@ -298,7 +298,10 @@ class Mailbox(models.Model):
) )
) )
new.set_payload('') new.set_payload('')
elif msg.get_content_type() not in TEXT_STORED_MIMETYPES: elif (
(msg.get_content_type() not in TEXT_STORED_MIMETYPES) or
('attachment' in msg.get('Content-Disposition', ''))
):
filename = msg.get_filename() filename = msg.get_filename()
if not filename: if not filename:
extension = mimetypes.guess_extension(msg.get_content_type()) extension = mimetypes.guess_extension(msg.get_content_type())