mtasts

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatPolicy

func FormatPolicy(p *Policy) (string, error)

FormatPolicy https://www.mailhardener.com/kb/mta-sts TODO: use text/template for this stuff?

func HTTPHandler

func HTTPHandler(p *Policy) (http.HandlerFunc, error)

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).

const (
	ModeNone    Mode = "none"
	ModeTesting Mode = "testing"
	ModeEnforce Mode = "enforce"
)

type Policy

type Policy struct {
	Version string
	Mode    Mode
	MX      []string
	MaxAge  uint32
}

Policy represents an MTA-STS policy.

func PolicyFromConfig

func PolicyFromConfig(cfg Config) *Policy

type Record

type Record struct {
	Version string `mapstructure:"version"`
	ID      string `mapstructure:"id"`
}

Record represents an MTA-STS DNS TXT record.

func (*Record) RecordPrefix

func (r *Record) RecordPrefix() string

func (*Record) RecordType

func (r *Record) RecordType() string

func (*Record) RecordValue

func (r *Record) RecordValue() string

func (*Record) String

func (r *Record) String() string

Jump to

Keyboard shortcuts

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