spf

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NeutralQualifier  = "?"
	SoftfailQualifier = "~"
	FailQualifier     = "-"
)
View Source
const MaximumLookupLimit = 10
View Source
const Prefix = "v=spf1 "

Variables

View Source
var ErrUnexpectedMatchRule = errors.New("unexpected matching rule")
View Source
var SpfGrammar *abnf.Grammar

Functions

func ExtractIncludeValues

func ExtractIncludeValues(record *Record) []string

func ExtractNetworks

func ExtractNetworks(record *Record, passOnly bool) []*net.IPNet

func ExtractRedirectValues

func ExtractRedirectValues(record *Record) []string

Types

type Directive

type Directive struct {
	Index     int        `json:"index"`
	Qualifier string     `json:"qualifier,omitzero"`
	Mechanism *Mechanism `json:"mechanism,omitzero"`
}

type Mechanism

type Mechanism struct {
	Label string `json:"label,omitzero"`
	Value string `json:"value,omitzero"`
}

type Modifier

type Modifier struct {
	Index int    `json:"index"`
	Label string `json:"label,omitzero"`
	Value string `json:"value,omitzero"`
}

type Record

type Record struct {
	Domain string `json:"domain,omitzero"`
	Raw    string `json:"raw,omitzero"`
	Terms  []any  `json:"-" jsonschema:"-"`
}

func ParseSpfRecord

func ParseSpfRecord(data []byte) (*Record, error)

func (*Record) Directives

func (r *Record) Directives() []*Directive

func (*Record) Modifiers

func (r *Record) Modifiers() []*Modifier

type TermPtr

type TermPtr interface {
	*Modifier | *Directive
}

Jump to

Keyboard shortcuts

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