mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-07-28 19:34:55 +00:00
RFC 8460 §4.3 nests each failure detail inside a policy, but parsed_smtp_tls_reports_to_csv_rows only attached policy_domain and policy_type to the per-policy summary row. Failure-detail rows therefore had empty policy_domain/policy_type CSV columns, and flat-JSON consumers (syslog, GELF) could not attribute a failure detail to its policy — the Google SecOps parser in this PR could not even detect those rows as SMTP TLS reports, since they carried none of the shape-identifying fields. Also rebuild the row template per policy: policy_strings and mx_host_patterns from an earlier policy leaked into a later policy that did not define them, because the template dict was created once per report and mutated inside the policies loop. Both regression tests fail on the previous serializer with KeyError: 'policy_domain'. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>