diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-05 14:35:29 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-05 14:35:29 +0100 |
commit | da8af582470ee67dae23330efdc70d048e30c359 (patch) | |
tree | 94727164d40a4cea7fb2dc767b074060666dbd10 /script/qmauth.py | |
parent | 1cfad71608a6947d331f2de3b1f71813c33da392 (diff) |
qmauth.py proper charset decoding
Diffstat (limited to 'script/qmauth.py')
-rwxr-xr-x | script/qmauth.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/script/qmauth.py b/script/qmauth.py index 052b8dd..0c63c7d 100755 --- a/script/qmauth.py +++ b/script/qmauth.py @@ -202,7 +202,9 @@ def count_mails(f, subfolder): def _get_body(mail): if not mail.is_multipart(): if mail.get_content_maintype() == 'text': - return mail.get_payload(decode=True).decode(errors='replace') + return mail.get_payload(decode=True).decode( + encoding=mail.get_content_charset(failobj='utf-8'), + errors='replace') else: return mail.get_payload() |