fix: issue with EMailObject

pull/875/head
Raphaël Vinot 2022-11-09 13:44:36 +01:00
parent fd05292d7c
commit fc7f273f76
1 changed files with 2 additions and 2 deletions

View File

@ -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