mtasts

package module
v0.0.0-...-6420d2f Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: MIT Imports: 6 Imported by: 0

README

go-mtasts

GoDoc

A Go library for SMTP MTA Strict Transport Security.

License

MIT

Documentation

Overview

Package mtasts handles SMTP MTA Strict Transport Security.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Version string `json:"version"`
	// The expected behavior of a sending MTA in the case of a policy validation
	// failure.
	Mode PolicyMode `json:"mode"`
	// Max lifetime of the policy, in seconds.
	MaxAge time.Duration `json:"max_age"`
	// One or more patterns matching the expected MX for this domain.
	MX []string `json:"mx"`
}

A Policy is a committment by the Policy Domain to support PKIX authenticated TLS for the specified MX hosts.

func Fetch

func Fetch(domain string) (*Policy, error)

Fetch retrieves the MTA STS policy for a domain. It returns a nil policy if no policy is available.

Example
policy, err := mtasts.Fetch("gmail.com")
if err != nil {
	log.Fatal(err)
}

log.Printf("%+v\n", policy)

type PolicyMode

type PolicyMode string

A PolicyMode describes the expected behavior of a sending MTA in the case of a policy validation failure.

const (
	// Sending MTAs treat STS policy failures as a mail delivery error, and MUST
	// NOT deliver the message to this host.
	ModeEnforce PolicyMode = "enforce"
	// Sending MTAs merely send a report indicating policy application failures.
	ModeReport = "report"
)

Jump to

Keyboard shortcuts

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