From fc7f273f76334c4a829ccc6b4acaf5163436c77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 9 Nov 2022 13:44:36 +0100 Subject: [PATCH] fix: issue with EMailObject --- pymisp/tools/emailobject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymisp/tools/emailobject.py b/pymisp/tools/emailobject.py index ee3810d..4b0cc58 100644 --- a/pymisp/tools/emailobject.py +++ b/pymisp/tools/emailobject.py @@ -28,7 +28,7 @@ class MISPMsgConverstionError(MISPObjectException): class EMailObject(AbstractMISPObjectGenerator): - def __init__(self, filepath: Union[Path, str], pseudofile: BytesIO, + def __init__(self, filepath: Optional[Union[Path, str]]=None, pseudofile: Optional[BytesIO]=None, attach_original_email: bool = True, **kwargs): super().__init__('email', **kwargs) @@ -111,7 +111,7 @@ class EMailObject(AbstractMISPObjectGenerator): "cte": "base64"} if msg_obj.htmlBody is not None: try: - _html_encoding_raw = msg_obj.mainProperties['3FDE0003'].value + _html_encoding_raw = msg_obj.props['3FDE0003'].value _html_encoding = codepage2codec(_html_encoding_raw) except KeyError: _html_encoding = msg_obj.stringEncoding