fix: skip IPs in Received header

Related:  #787
pull/789/head
Raphaël Vinot 2021-09-27 10:26:43 +02:00
parent 28b016ace1
commit d44847b63a
1 changed files with 4 additions and 1 deletions

View File

@ -319,7 +319,10 @@ class EMailObject(AbstractMISPObjectGenerator):
if "Received" in message:
try:
self.add_attribute("received-header-hostname", message['Received'].split(' ')[1])
# We only want the hostnames
received_content = message['Received'].split(' ')
if received_content[0] == 'from':
self.add_attribute("received-header-hostname", received_content[1])
except Exception:
pass