Files
parsedmarc/tests
Sean WhalenandClaude Fable 5 0e3f5f37bc Include policy identity on SMTP TLS failure-detail rows
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>
2026-07-11 14:10:05 -04:00
..