summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-05-15 18:51:30 +0200
committerAnton Khirnov <anton@khirnov.net>2021-05-15 18:51:30 +0200
commitaef67de454a00af06be1a72397ffcb930b15abf5 (patch)
treea02ad63b622570422eceb33da0e1ad4d18ec6bbd
parent179a9d6c0c15be9383940259c98ab9cd41440b40 (diff)
mail/envelope: drop a workaround for very old libmagic versions
5.12 was released in 2013, we do not need to support it anymore.
-rw-r--r--alot/mail/envelope.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/alot/mail/envelope.py b/alot/mail/envelope.py
index 4714b32d..a4985c7a 100644
--- a/alot/mail/envelope.py
+++ b/alot/mail/envelope.py
@@ -9,7 +9,6 @@ import email
import email.policy
from email.message import MIMEPart
import email.charset as charset
-import mimetypes
from urllib.parse import unquote
import gpg
@@ -221,15 +220,6 @@ class Envelope:
data = f.read()
ctype = helper.guess_mimetype(data)
- # libmagic < 5.12 incorrectly detects excel/powerpoint files as
- # 'application/msword' (see #179 and #186 in libmagic bugtracker)
- # This is a workaround, based on file extension, useful as long
- # as distributions still ship libmagic 5.11.
- if (ctype == 'application/msword' and
- not _libmagic_version_at_least(513)):
- mimetype, _ = mimetypes.guess_type(path)
- if mimetype:
- ctype = mimetype
# Set the filename parameter
if not filename: