checks

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package checks runs a domain's mail-posture checks and scores them. Each check resolves the records it needs, applies a pure parser from the records package, and returns a Result with a status, findings, and the fix to apply. A Scanner threads data discovered early (the MX hosts and their IPs) into the later checks that need it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Resolver    string        // pinned nameserver, or "" for the system resolver
	Selector    string        // DKIM selector override
	Timeout     time.Duration // per-lookup timeout
	SkipNetwork bool          // skip checks that open TCP connections (MX reachability, STARTTLS)
	SendingIPs  []string      // extra IPs to reverse-check and run against blocklists
}

Options tunes a scan.

type Report

type Report struct {
	Domain  string   `json:"domain"`
	Results []Result `json:"results"`
	Score   int      `json:"score"`
	Grade   string   `json:"grade"`
}

Report is a full scan of one domain.

func Run

func Run(domain string, opts Options) Report

Run scans a domain and returns a scored report. Checks run in a fixed order; the MX check runs first because later checks reuse its discovered hosts.

func (Report) Verdict added in v0.2.0

func (r Report) Verdict() string

Verdict returns a one-line, plain-English summary of a report: the headline problem to fix, or confirmation that the setup is sound.

type Result

type Result struct {
	Name     string   `json:"name"`
	Status   Status   `json:"status"`
	Summary  string   `json:"summary"`
	Findings []string `json:"findings,omitempty"`
	Fixes    []string `json:"fixes,omitempty"`
	// contains filtered or unexported fields
}

Result is one check's outcome.

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner holds a scan's shared state: the resolver and the MX data the MX check discovers for the reachability, PTR, STARTTLS, and DANE checks to reuse.

type Status

type Status int

Status is the outcome of a single check.

const (
	// Pass: configured well.
	Pass Status = iota
	// Warn: works but weak (for example DMARC p=none).
	Warn
	// Fail: missing or broken, and it affects deliverability.
	Fail
	// NA: legitimately not applicable (for example BIMI, or no MX on a
	// non-sending domain). Never penalized.
	NA
	// Skip: could not test from this machine (for example port 25 blocked).
	// Never penalized, since it reflects the runner, not the domain.
	Skip
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL