Add TLSRPT, BIMI, full DMARC parsing and TLS certificate details - #79
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 existingdmarcstruct 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 queriesdefault._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 atlscertinfostruct 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
dns.gogetTLSRPT()andgetBIMI()tlscheck.gotlscertinfostruct; updatedtlsCheck()signaturetlsrpt.gotlsrptstructbimi.gobimistructmain.gooutput.goTest plan
go build ./...passesgo vet ./...passesgo test -v ./...— all 12 tests pass🤖 Generated with Claude Code