Documentation
¶
Overview ¶
Package inbound is the SMTP server on port 25: it receives mail for lfr's domains, refuses abuse as early and cheaply as possible, authenticates and scores what remains, and hands accepted messages to the engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Envelope ¶
type Envelope struct {
From string
Rcpts []string
Raw []byte // with lfr's Received and Authentication-Results fields
Parsed *msg.Parsed
Auth mailauth.Result
Verdict spam.Verdict
IP net.IP
Helo string
TLS bool
}
Envelope is an accepted message.
type Server ¶
type Server struct {
Hostname func(ctx context.Context) string
Config config.Config
DNS dnsx.Resolver
DNSBL *dnsbl.Checker
Log *slog.Logger
TLS *tls.Config
Now func() time.Time
// Accept decides at RCPT time whether lfr takes mail for an address.
Accept func(ctx context.Context, rcpt string) (bool, error)
// System reports addresses lfr handles itself (bounces, reports), which skip spam scoring.
System func(rcpt string) bool
// Classify scores a message; KnownContact reports earlier correspondence.
Classify func(ctx context.Context, in spam.Input) spam.Verdict
KnownContact func(ctx context.Context, email string) bool
// Local reports whether lfr serves a domain.
Local func(ctx context.Context, domain string) bool
// Deliver stores or processes an accepted message.
Deliver func(ctx context.Context, e *Envelope) error
// contains filtered or unexported fields
}
Server receives mail.
func (*Server) NewSession ¶
NewSession implements smtp.Backend.
Click to show internal directories.
Click to hide internal directories.