new: Add few keys to email object creator

Fix #787
pull/789/head
Raphaël Vinot 2021-09-23 17:10:23 +02:00
parent 3072dac568
commit 9fc4d90454
1 changed files with 8 additions and 0 deletions

View File

@ -282,6 +282,8 @@ class EMailObject(AbstractMISPObjectGenerator):
if "To" in message:
self.__add_emails("to", message["To"])
if "Delivered-To" in message:
self.__add_emails("to", message["Delivered-To"])
if "From" in message:
self.__add_emails("from", message["From"])
@ -315,6 +317,12 @@ class EMailObject(AbstractMISPObjectGenerator):
if "Thread-Index" in message:
self.add_attribute("thread-index", message["Thread-Index"])
if "Received" in message:
try:
self.add_attribute("received-header-hostname", message['Received'].split(' ')[1])
except Exception:
pass
self.__generate_received()
def __add_emails(self, typ: str, data: str, insert_display_names: bool = True):