From 2a4b2150267d35e1aecbea411671b6e1a90916a8 Mon Sep 17 00:00:00 2001 From: nighttardis Date: Mon, 30 Nov 2020 18:45:53 -0600 Subject: [PATCH] adding check if "from" is in the "received" header row --- pymisp/tools/emailobject.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pymisp/tools/emailobject.py b/pymisp/tools/emailobject.py index ea554a2..bdf66e3 100644 --- a/pymisp/tools/emailobject.py +++ b/pymisp/tools/emailobject.py @@ -217,6 +217,8 @@ class EMailObject(AbstractMISPObjectGenerator): Extract IP addresses from received headers that are not private. """ for received in self.__parser.received: + if "from" not in received: + continue tokens = received["from"].split(" ") ip = None for token in tokens: