mirror of https://github.com/MISP/PyMISP
fix: Properly get and decode the body of the email
parent
cb15bdfca1
commit
04d3183115
|
@ -40,8 +40,8 @@ class EMailObject(AbstractMISPObjectGenerator):
|
||||||
return to_return
|
return to_return
|
||||||
|
|
||||||
def generate_attributes(self):
|
def generate_attributes(self):
|
||||||
if self.__email.get_body():
|
if self.__email.get_body(preferencelist=('html', 'plain')):
|
||||||
self.add_attribute('email-body', value=self.__email.get_body().as_string())
|
self.add_attribute('email-body', value=self.__email.get_body(preferencelist=('html', 'plain')).get_payload(decode=True).decode())
|
||||||
if 'Reply-To' in self.__email:
|
if 'Reply-To' in self.__email:
|
||||||
self.add_attribute('reply-to', value=self.__email['Reply-To'])
|
self.add_attribute('reply-to', value=self.__email['Reply-To'])
|
||||||
if 'Message-ID' in self.__email:
|
if 'Message-ID' in self.__email:
|
||||||
|
|
Loading…
Reference in New Issue