diff --git a/integrator/mail/imap.py b/integrator/mail/imap.py index 5ab1757..f588b2d 100644 --- a/integrator/mail/imap.py +++ b/integrator/mail/imap.py @@ -129,4 +129,7 @@ def getText(msg): return msg.get_payload(decode=True).decode(getCharset(msg)) def getCharset(msg): - return dict(msg.get_params()).get('charset') or 'ISO8859-1' + params = msg.get_params() + if params: + return dict(params).get('charset') or 'ISO8859-1' + return 'ISO8859-1'