Fix header checks

This commit is contained in:
Sean Whalen
2018-10-14 05:16:52 -04:00
parent a57d6836aa
commit 48ca180db5
2 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -326,16 +326,16 @@ def save_forensic_report_to_elasticsearch(forensic_report,
from_ = None
to_ = None
subject = None
if "from" in headers:
from_ = headers["from"]
if "From" in headers:
from_ = headers["From"]
from_query = {"match": {"sample.headers.from": from_}}
q = q & from_query
if "to" in headers:
to_ = headers["to"]
if "To" in headers:
to_ = headers["To"]
to_query = {"match": {"sample.headers.to": to_}}
q = q & Q(to_query)
if "subject" in headers:
subject = headers["subject"]
if "Subject" in headers:
subject = headers["Subject"]
subject_query = {"match": {"sample.headers.subject": subject}}
q = q & subject_query
+2 -2
View File
@@ -405,8 +405,8 @@ def parse_email(data):
" ")
if "from" not in parsed_email:
if "from" in parsed_email["headers"]:
parsed_email["from"] = parsed_email["Headers"]["from"]
if "From" in parsed_email["headers"]:
parsed_email["from"] = parsed_email["Headers"]["From"]
else:
parsed_email["from"] = None