Documentation
¶
Overview ¶
Package dnsauth checks the DNS records that decide whether other mail servers accept your mail: MX, SPF, DKIM, DMARC and PTR/FCrDNS.
Index ¶
Constants ¶
const ( OK = "ok" Warn = "warn" Fail = "fail" Info = "info" )
Status of one check.
Variables ¶
var CommonSelectors = []string{"default", "mail", "dkim", "s1", "s2", "selector1", "selector2", "google", "k1", "smtp", "postfix", "key1", "sig1"}
CommonSelectors are probed when no selector is known.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
Name string `json:"check"`
Status string `json:"status"`
Record string `json:"record,omitempty"`
Message string `json:"message"`
}
Check is one finding.
type Options ¶
type Options struct {
Domain string
IPs []string // sending IPs to check SPF authorisation and PTR for
HELO string // myhostname, compared against PTR
Selectors []string // DKIM selectors; if empty, CommonSelectors are probed
}
Options for Run.
type Report ¶
type Report struct {
Domain string `json:"domain"`
IPs []string `json:"sending_ips,omitempty"`
Checks []Check `json:"checks"`
}
Report is the result for one domain.
type Resolver ¶
type Resolver interface {
LookupTXT(ctx context.Context, name string) ([]string, error)
LookupMX(ctx context.Context, name string) ([]*net.MX, error)
LookupAddr(ctx context.Context, addr string) ([]string, error)
LookupIP(ctx context.Context, network, host string) ([]net.IP, error)
}
Resolver is the subset of *net.Resolver used here (mockable in tests).
func NewResolver ¶
NewResolver returns the system resolver, or one that queries server ("1.1.1.1" or "1.1.1.1:53") directly.