From 446732dad22e9f398ff45864cf819d42de3cee70 Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Fri, 19 Oct 2018 11:07:35 -0400 Subject: [PATCH] 4.3.6 - Be more forgiving for forensic reports with missing fields --- CHANGELOG.md | 5 +++++ parsedmarc/__init__.py | 6 ++++++ parsedmarc/__version__.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 005e891..aff1d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +4.3.6 +----- + +- Be more forgiving for forensic reports with missing fields + 4.3.5 ----- diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 65f45d2..d68324a 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -523,6 +523,12 @@ def parse_forensic_report(feedback_report, sample, msg_date, if "arrival_date" not in parsed_report: parsed_report["arrival_date"] = msg_date + if "version" not in parsed_report: + parsed_report["version"] = 1 + + if "user_agent" not in parsed_report: + parsed_report["user_agent"] = None + arrival_utc = human_timestamp_to_datetime( parsed_report["arrival_date"], to_utc=True) arrival_utc = arrival_utc.strftime("%Y-%m-%d %H:%M:%S") diff --git a/parsedmarc/__version__.py b/parsedmarc/__version__.py index 648f1fe..00aa9e1 100644 --- a/parsedmarc/__version__.py +++ b/parsedmarc/__version__.py @@ -2,7 +2,7 @@ import platform -__version__ = "4.3.5" +__version__ = "4.3.6" USER_AGENT = "Mozilla/5.0 ((0 {1})) parsedmarc/{2}".format( platform.system(),