From e8e6abd84be006a3aab9d36289dab1dacc6158fa Mon Sep 17 00:00:00 2001 From: Sascha Rommelfangen Date: Tue, 19 Dec 2017 11:28:01 +0100 Subject: [PATCH] fixed bug when forwarding mail as .eml attachment --- mail_to_misp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mail_to_misp.py b/mail_to_misp.py index 94a2906..dcc13e1 100755 --- a/mail_to_misp.py +++ b/mail_to_misp.py @@ -134,6 +134,7 @@ stopword = config.stopword hash_only_tags = config.hash_only_tags forward_identifiers = config.forward_identifiers attach_original_mail = config.attach_original_mail +skip_wl = config.skip_item_on_warninglist original_email_data = email_data @@ -289,7 +290,7 @@ if stdin_used: for part in msg.walk(): if part.get_content_maintype() == 'multipart': continue - if part.get_content_maintype() != 'text': + if part.get_content_maintype() != 'text' and part.get_payload(decode=True) is not None: filename = part.get_filename() _, output_path = tempfile.mkstemp() output = open(output_path, 'wb')