From 61b1c65b143e0a2b63c3eecc9b3adde34857daec Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 4 Feb 2019 18:01:39 +0100 Subject: restore lenient libmagic decoding 176cffcd ("refactor alot.db.utils.remove_cte", 2018-12-04) created a few problems with 8bit quoted-printable e-mails, see #1291 #1360. This commit restores the old libmagic fallback which did not cause this problem. --- alot/db/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'alot/db') diff --git a/alot/db/utils.py b/alot/db/utils.py index ea0963c1..94886148 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -446,9 +446,9 @@ def remove_cte(part, as_string=False): sp = helper.try_decode(bp) except UnicodeDecodeError as emsg: # the mail contains chars that are not enc-encoded. - # try again and just ignore those + # libmagic works better than just ignoring those logging.debug('Decoding failure: {}'.format(emsg)) - sp = bp.decode(enc, errors='ignore') + sp = helper.try_decode(bp) return sp return bp -- cgit v1.2.3