Permalink
Browse files

FIX: parse mail body text if type is bytes object

  • Loading branch information...
tomas321 authored and wagner-certat committed Jan 7, 2019
1 parent e9b584d commit 456b3488ed498285c6010d9883f92fbe59a42c61
Showing with 1 addition and 1 deletion.
  1. +1 −1 intelmq/bots/collectors/mail/collector_mail_url.py
@@ -33,7 +33,7 @@ def process_message(self, uid, message):
seen = False

for body in message.body['plain']:
match = re.search(self.parameters.url_regex, str(body))
match = re.search(self.parameters.url_regex, str(body.decode('utf-8') if isinstance(body, bytes) else body))
if match:
url = match.group()
# strip leading and trailing spaces, newlines and

0 comments on commit 456b348

Please sign in to comment.