mirror of https://github.com/MISP/misp-modules
Merge pull request #474 from JakubOnderka/patch-4
fix: Consider mail body as UTF-8 encodedpull/475/head
commit
8c05037971
|
@ -110,9 +110,8 @@ def handler(q=False):
|
|||
email_object.add_reference(f_object.uuid, 'includes', 'Email attachment')
|
||||
|
||||
mail_body = email_object.email.get_body(preferencelist=('html', 'plain'))
|
||||
if extract_urls:
|
||||
if mail_body:
|
||||
charset = mail_body.get_content_charset()
|
||||
if extract_urls and mail_body:
|
||||
charset = mail_body.get_content_charset('utf-8')
|
||||
if mail_body.get_content_type() == 'text/html':
|
||||
url_parser = HTMLURLParser()
|
||||
url_parser.feed(mail_body.get_payload(decode=True).decode(charset, errors='ignore'))
|
||||
|
|
Loading…
Reference in New Issue