Documentation
¶
Overview ¶
Package mail receives SMTP for forwarded addresses and relays each message on to its destinations.
Index ¶
Constants ¶
const (
DefaultMaxSize = 25 << 20
)
Variables ¶
This section is empty.
Functions ¶
func IsSRS ¶
IsSRS reports whether addr's local part is shaped like a rewritten sender, valid or not.
func IsTemporary ¶
Types ¶
type Error ¶
Error carries an SMTP-shaped outcome: Temporary asks the sender to retry later instead of bouncing.
type Forwarder ¶
type Relay ¶
type Relay struct {
Host, Port, User, Pass, From string
}
Relay is an upstream SMTP server that sends on our behalf, for hosts that can't reach port 25 directly.
func RelayFromEnv ¶
func RelayFromEnv() *Relay
type Rules ¶
Rules maps a domain to its aliases; the "*" alias catches every other address on that domain.
func LoadRules ¶
LoadRules reads the forwarding table; a missing file means nothing is forwarded, while an unreadable one is an error so callers keep their last good copy.
type SRS ¶
type SRS struct{ Key []byte }
SRS rewrites a forwarded message's sender onto the forwarding domain so SPF keeps passing, while still routing bounces home.
type Server ¶
type Server struct {
Hostname string
Rules func() Rules
TLSConfig *tls.Config
Forwarder *Forwarder
MaxSize int64
Logf func(format string, args ...any)
// contains filtered or unexported fields
}
Server accepts mail only for addresses its Rules know, so it can never be used as an open relay.