From 9a4b35a3597b2fcdc2913652ec2dfb7ad19e1f02 Mon Sep 17 00:00:00 2001 From: nnako Date: Sat, 25 Apr 2015 22:00:03 +0200 Subject: [PATCH] Update mailbot.py FIX: string access on byte sequence and type cast for invocation of mail message function --- mailbot/mailbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailbot/mailbot.py b/mailbot/mailbot.py index b9520f3..35e8712 100644 --- a/mailbot/mailbot.py +++ b/mailbot/mailbot.py @@ -59,7 +59,7 @@ def process_messages(self): for uid, msg in messages.items(): self.mark_processing(uid) - message = message_from_string(msg['RFC822']) + message = message_from_string(msg[b'RFC822'].decode('utf-8')) for callback_class, rules in CALLBACKS_MAP.items(): self.process_message(message, callback_class, rules) self.mark_processed(uid)