Versions in this module Expand all Collapse all v0 v0.2.1 Jul 25, 2026 Changes in this version type Resolver + NegativeTTL time.Duration v0.2.0 Jul 25, 2026 Changes in this version type EvalInput + AllowInsecureDowngrade bool v0.1.1 Jul 23, 2026 Changes in this version + const ModeEnforce + const ModeNone + const ModeTesting + const Version + var ErrNoPolicy = errors.New("mtasts: no policy") + func Evaluate(in EvalInput) error + func HTTPFetch(ctx context.Context, url string, insecure bool) ([]byte, error) + func PolicyURL(domain string) string + func TXTName(domain string) string + type EnforceError struct + Domain string + MXHost string + Reason string + func (e *EnforceError) Error() string + type EvalInput struct + CertValid bool + Domain string + MXHost string + Mode string + Policy *Policy + STARTTLS bool + type FetchPolicyFunc func(ctx context.Context, url string) ([]byte, error) + type LookupTXTFunc func(ctx context.Context, name string) ([]string, error) + type Policy struct + MX []string + MaxAge int + Mode string + Version string + func ParsePolicy(body []byte) (*Policy, error) + func (p *Policy) MatchesCert(cert *x509.Certificate) bool + func (p *Policy) MatchesMX(host string) bool + type Resolver struct + FetchPolicy FetchPolicyFunc + LookupTXT LookupTXTFunc + Now func() time.Time + func NewResolver() *Resolver + func (r *Resolver) Resolve(ctx context.Context, domain string) (*Policy, error)