From 54d38df6dc6bc1ce8fb8325389c4373d3dd87fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 30 Sep 2021 11:10:14 +0200 Subject: [PATCH] fix: message_from_bytes really dislikes newline at the beginning of a mail --- pymisp/tools/emailobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymisp/tools/emailobject.py b/pymisp/tools/emailobject.py index eea5cd3..da3fb8b 100644 --- a/pymisp/tools/emailobject.py +++ b/pymisp/tools/emailobject.py @@ -45,7 +45,7 @@ class EMailObject(AbstractMISPObjectGenerator): def parse_email(self) -> EmailMessage: """Convert email into EmailMessage.""" - content_in_bytes = self.__pseudofile.getvalue() + content_in_bytes = self.__pseudofile.getvalue().strip() eml = message_from_bytes(content_in_bytes, _class=EmailMessage, policy=policy.default)