Workaround for forensic/ruf reports that are missing Reported-Domain

This commit is contained in:
Sean Whalen
2018-10-08 09:31:53 -04:00
parent f1fa8709c2
commit 66af8e6090
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
4.1.9
-----
- Workaround for forensic/ruf reports that are missing `Arrival-Date`
- Workaround for forensic/ruf reports that are missing `Arrival-Date` and/or
`Reported-Domain`
4.1.8
-----
+5 -1
View File
@@ -856,7 +856,11 @@ def parse_forensic_report(feedback_report, sample, sample_headers_only,
if "date_utc" in received:
received["date_utc"] = received["date_utc"].replace("T",
" ")
parsed_sample["from"] = convert_address(parsed_sample["from"][0])
msg_from = convert_address(parsed_sample["from"][0])
parsed_sample["from"] = msg_from
if "reported_domain" not in parsed_report:
domain = msg_from["address"].split("@")[-1].lower()
parsed_report["reported_domain"] = domain
if "reply_to" in parsed_sample:
parsed_sample["reply_to"] = list(map(lambda x: convert_address(x),