summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-03-05 14:35:29 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-03-05 14:35:29 +0100
commitda8af582470ee67dae23330efdc70d048e30c359 (patch)
tree94727164d40a4cea7fb2dc767b074060666dbd10
parent1cfad71608a6947d331f2de3b1f71813c33da392 (diff)
qmauth.py proper charset decoding
-rwxr-xr-xscript/qmauth.py4
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()