From fc17a40b184688e60f2c1b165ddd968096a5cab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 11 May 2018 15:20:21 -0400 Subject: [PATCH] chg: Strip spaces in the config --- mail_to_misp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_to_misp.py b/mail_to_misp.py index accba6e..04cce6e 100755 --- a/mail_to_misp.py +++ b/mail_to_misp.py @@ -134,7 +134,7 @@ class Mail2MISP(): self.clean_email_body = html.unescape(mail_as_bytes.decode('utf8', 'surrogateescape')) # Check if there are config lines in the body & convert them to a python dictionary: # :: => {: } - self.config_from_email_body = {k: v for k, v in re.findall(f'{config.body_config_prefix}:(.*):(.*)', self.clean_email_body)} + self.config_from_email_body = {k.strip(): v.strip() for k, v in re.findall(f'{config.body_config_prefix}:(.*):(.*)', self.clean_email_body)} if self.config_from_email_body: # ... remove the config lines from the body self.clean_email_body = re.sub(rf'^{config.body_config_prefix}.*\n?', '',