Documentation
¶
Overview ¶
Package mtasts provides types for building and serving an MTA-STS policy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPolicy ¶
FormatPolicy https://www.mailhardener.com/kb/mta-sts TODO: use text/template for this stuff?
func HTTPHandler ¶
func HTTPHandler(p *Policy) (http.HandlerFunc, error)
HTTPHandler returns a handler serving p's policy document. p is a pointer, not a snapshot: the policy is rendered fresh on every request, so mutations made to *p after HTTPHandler returns (e.g. rotating MX hosts) are reflected on the next request.
Types ¶
type Config ¶
type Config struct {
Mode Mode `mapstructure:"mode"`
MX []string `mapstructure:"mx"`
MaxAge uint32 `mapstructure:"max-age"`
}
Config represents MTA-STS configuration used to create a policy.
type Mode ¶
type Mode string
Mode represents an MTA-STS mode (none, testing, enforce).
MTA-STS modes, per RFC 8461 section 3.
type Policy ¶
Policy represents an MTA-STS policy.
func PolicyFromConfig ¶
PolicyFromConfig builds a Policy from cfg, using the fixed "STSv1" version.
type Record ¶
Record represents an MTA-STS DNS TXT record.
func (*Record) RecordPrefix ¶
RecordPrefix returns the DNS owner label prefix for an MTA-STS record, always "_mta-sts.".
func (*Record) RecordType ¶
RecordType returns the DNS record type string, "TXT".
func (*Record) RecordValue ¶
RecordValue returns the wire-ready, quoted MTA-STS record value.