From cf51e183b0b290c36ddebe5a5799b41dfc5a4d6e Mon Sep 17 00:00:00 2001 From: CIRCL Date: Fri, 2 Jun 2017 08:49:18 +0200 Subject: [PATCH] fixed file upload --- 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 752b488..c8ec0e1 100755 --- a/mail_to_misp.py +++ b/mail_to_misp.py @@ -273,7 +273,8 @@ if stdin_used: _, output_path = tempfile.mkstemp() output = open(output_path, 'wb') output.write(part.get_payload(decode=True)) - misp.upload_sample(filename, output_path, new_event, distribution=None, to_ids=True, category=None, comment=None, info='My Info', analysis=None, threat_level_id=None) + event_id = new_event['Event']['id'] + misp.upload_sample(filename, output_path, event_id, distribution=None, to_ids=True, category=None, comment=None, info='My Info', analysis=None, threat_level_id=None) output.close() syslog.syslog("Job finished.")