summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2014-11-22 22:38:44 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2014-11-22 22:43:19 +0100
commit3258aa00930df278ef82f156fb7dfaf332067e97 (patch)
tree1fc189619f414756da0f04ade2700004a45130fc
parentdc236be51a1e136b7ddd01e2e02f7a7a29e9a9dc (diff)
use magic on application/octetstream' attachments
Some versions of AppleMail apparently send out attachements with incorrect mimetypes "application/octetstream" (instead of "application/octet-stream"). This patch makes alot use libmagic on the attachments content to determine the actual content type.
-rw-r--r--alot/db/attachment.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/db/attachment.py b/alot/db/attachment.py
index ad996d2e..5c958e0b 100644
--- a/alot/db/attachment.py
+++ b/alot/db/attachment.py
@@ -47,7 +47,8 @@ class Attachment(object):
"""mime type of the attachment part"""
ctype = self.part.get_content_type()
# replace underspecified mime description by a better guess
- if ctype in ['octet/stream', 'application/octet-stream']:
+ if ctype in ['octet/stream', 'application/octet-stream',
+ 'application/octetstream']:
ctype = helper.guess_mimetype(self.get_data())
return ctype