From fa95c9d84f7e39cfc944d6867ef67815f5df746d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 11 Jan 2021 14:15:30 +0100 Subject: [PATCH] fix: Properly decode the body depending on the encoding of the email Fix #671 --- 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 7015ec5..ea4a90b 100644 --- a/pymisp/tools/emailobject.py +++ b/pymisp/tools/emailobject.py @@ -269,7 +269,7 @@ class EMailObject(AbstractMISPObjectGenerator): if self.encapsulated_body == body.get_content_type(): comment += " De-Encapsulated from RTF in original msg." self.add_attribute("email-body", - body.get_payload(decode=True).decode('utf8', 'surrogateescape'), + body.get_content(), comment=comment) headers = ["{}: {}".format(k, v) for k, v in message.items()]