Skip to content

Add TLSRPT, BIMI, full DMARC parsing and TLS certificate details - #79

Merged
steffenfritz merged 1 commit into
mainfrom
feature/email-auth-checks
Mar 28, 2026
Merged

Add TLSRPT, BIMI, full DMARC parsing and TLS certificate details#79
steffenfritz merged 1 commit into
mainfrom
feature/email-auth-checks

Conversation

@steffenfritz

Copy link
Copy Markdown
Owner

Summary

This PR extends mxcheck's email authentication and TLS inspection capabilities with four improvements:

DMARC full parsing

Previously getDMARC() stored only the raw TXT record string. It now parses all standard DMARC tags (p, sp, adkim, aspf, fo, rua, ruf, pct, ri, rf) into the existing dmarc struct fields. The console output shows each relevant field individually instead of the raw record dump.

TLSRPT lookup (RFC 8460)

New getTLSRPT() function queries _smtp._tls.<domain> TXT records and extracts the reporting URI (rua). Useful for identifying whether a mail server operator has enabled TLS failure reporting — a common gap in hardened configurations.

BIMI lookup

New getBIMI() function queries default._bimi.<domain> TXT records and extracts the SVG logo URI (l) and optional VMC authority URI (a). Completes the full picture of a domain's email authentication stack.

TLS certificate details (port 465)

tlsCheck() now returns a tlscertinfo struct instead of bare (string, bool, bool). The struct adds expiry date, Subject CN, Issuer CN, and DNS SANs extracted from the leaf certificate. These fields are printed to the console and written to the TSV report, making expired or misconfigured certificates immediately visible.

Changes

File Change
dns.go Parse DMARC fields; add getTLSRPT() and getBIMI()
tlscheck.go New tlscertinfo struct; updated tlsCheck() signature
tlsrpt.go New file — tlsrpt struct
bimi.go New file — bimi struct
main.go Wire up new lookups; display parsed fields and cert details
output.go Expand TSV with DMARC fields, TLSRPT, BIMI, TLS cert details

Test plan

  • go build ./... passes
  • go vet ./... passes
  • go test -v ./... — all 12 tests pass

🤖 Generated with Claude Code

- dns: parse all DMARC fields (p, sp, adkim, aspf, fo, rua, ruf, pct, ri, rf)
  instead of storing only the raw record string
- dns: add getTLSRPT() to query _smtp._tls.<domain> TXT records (RFC 8460)
- dns: add getBIMI() to query default._bimi.<domain> TXT records
- tlscheck: introduce tlscertinfo struct; tlsCheck() now returns expiry date,
  subject CN, issuer CN and SANs in addition to TLS version and validity flags
- main: display parsed DMARC fields, TLSRPT RUA, BIMI logo/authority URIs,
  and certificate details (expiry, subject, issuer, SANs) for port 465
- output: expand TSV report with individual DMARC fields, TLSRPT, BIMI,
  and per-MX TLS certificate details

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Steffen Fritz <steffen@fritz.wtf>
@steffenfritz steffenfritz self-assigned this Mar 28, 2026
@steffenfritz steffenfritz added this to the v1.9.0 milestone Mar 28, 2026
@steffenfritz
steffenfritz merged commit dc99deb into main Mar 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant