Recognize inline images as attachments

When parsing attachments allow content-disposition to take either of two
values: 'attachment',  or 'inline'. The latter appears to be used by
iPhone when sending images.
This commit is contained in:
Gauden Galea
2014-01-06 14:54:55 +01:00
parent 6ec9626c01
commit 4c7d52e2e1

View File

@@ -73,7 +73,7 @@ def parse_attachment(message_part):
if content_disposition != None:
dispositions = content_disposition.strip().split(";")
if dispositions[0].lower() == "attachment":
if dispositions[0].lower() in ["attachment", "inline"]:
file_data = message_part.get_payload(decode=True)
attachment = {