summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPol Van Aubel <dev@polvanaubel.com>2016-10-13 14:32:39 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2016-12-26 20:57:31 +0000
commitd10865dd54160f5c4d49c4cc13d44aa7732fce65 (patch)
treec2d84cf938f1b2ee7e7269edb53eb78c0a303401 /alot
parentd8c2f41a42df1893c593c33bc5f8fdcb3f67e1e9 (diff)
Dirty fix for case-(in)sensitive MIME matching.
Simply cast every string to lower() when matching MIME media type and subtype. Matching is always case-insensitive as per RFC2045, 5.1.
Diffstat (limited to 'alot')
-rw-r--r--alot/db/message.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/alot/db/message.py b/alot/db/message.py
index de535d37..5566fa64 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -232,12 +232,12 @@ class Message(object):
content = part.get_payload(decode=True)
ct = helper.guess_mimetype(content)
- if cd.startswith('attachment'):
- if ct not in ['application/pgp-encrypted',
+ if cd.lower().startswith('attachment'):
+ if ct.lower() not in ['application/pgp-encrypted',
'application/pgp-signature']:
self._attachments.append(Attachment(part))
- elif cd.startswith('inline'):
- if filename is not None and ct != 'application/pgp':
+ elif cd.lower().startswith('inline'):
+ if filename is not None and ct.lower() != 'application/pgp':
self._attachments.append(Attachment(part))
return self._attachments