diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 5afc1d2..f2d7125 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -698,7 +698,7 @@ def parsed_aggregate_reports_to_csv_rows(reports): row["dmarc_aligned"] = record["alignment"]["dmarc"] row["disposition"] = record["policy_evaluated"]["disposition"] policy_override_reasons = list(map( - lambda r_: r_["type"], + lambda r_: r_["type"] or "none", record["policy_evaluated"] ["policy_override_reasons"])) policy_override_comments = list(map( diff --git a/samples/aggregate/empty_reason.xml b/samples/aggregate/empty_reason.xml new file mode 100644 index 0000000..dfccafc --- /dev/null +++ b/samples/aggregate/empty_reason.xml @@ -0,0 +1,56 @@ + + + 1.0 + + example.org + noreply-dmarc-support@example.org + https://support.example.org/dmarc + 20240125141224705995 + + 1706159544 + 1706185733 + + + + example.com + r + r +

quarantine

+ quarantine + 100 + 1 +
+ + + 198.51.100.123 + 2 + + none + pass + fail + + + + + + + + example.net + example.edu + example.com + + + + example.com + example + pass + 2048-bit key + + + example.edu + mfrom + pass + + + +