diff --git a/CHANGELOG.md b/CHANGELOG.md index b192d4e..b31dc26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ----- diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 740adcb..03c98e9 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -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),