Fix blank SMTP TLS failure-detail fields crashing saves; read RFC 8460 additional-information (11.0.3) (#916)

* Treat blank SMTP TLS failure-detail fields as absent; read RFC 8460 additional-information

Some reporters send optional failure-details fields as empty strings
(e.g. "sending-mta-ip": "" on sts-policy-fetch-error). The parser copied
them verbatim, so the PostgreSQL save failed on the INET columns
("invalid input syntax for type inet") and the Elasticsearch/OpenSearch
saves failed Ip() validation, discarding the whole report. Blank or
whitespace-only optional values are now omitted.

RFC 8460 section 4.4 names the URI key "additional-information"; the
parser only read "additional-info-uri" (the schema's value placeholder),
so conformant reports lost the URI. The RFC key is now read, with the old
key kept as a fallback.

Bump version to 11.0.3.

Closes #915

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Import parse_report_file directly in the ES/OpenSearch tests

Addresses github-code-quality's "Module is imported with 'import' and
'import from'" findings on tests/test_elastic.py and
tests/test_opensearch.py.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sean Whalen
2026-09-24 10:42:34 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 6648be7d02
commit e077136b60
8 changed files with 307 additions and 23 deletions
@@ -0,0 +1,38 @@
{
"organization-name":"Reporter Example",
"date-range":{
"start-datetime":"2024-06-01T00:00:00Z",
"end-datetime":"2024-06-01T23:59:59Z"
},
"contact-info":"smtp-tls-reporting@reporter.example",
"report-id":"2024-06-01T00:00:00Z_example.com",
"policies":[
{
"policy":{
"policy-type":"sts",
"policy-string":[
"version: STSv1",
"mode: enforce",
"mx: example.com",
"max_age: 86400"
],
"policy-domain":"example.com"
},
"summary":{
"total-successful-session-count":0,
"total-failure-session-count":1
},
"failure-details":[
{
"result-type":"sts-policy-fetch-error",
"sending-mta-ip":"",
"receiving-ip":"",
"receiving-mx-hostname":"",
"failed-session-count":1,
"additional-information":"",
"failure-reason-code":"no-policy-served"
}
]
}
]
}