middleware

package module
v0.0.0-...-d61f019 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthenticationResult

func AddAuthenticationResult(hostname string, logger *slog.Logger) smtpx.Middleware

func AddDeliveredHeaders

func AddDeliveredHeaders() smtpx.Middleware

func AddReceivedHeaders

func AddReceivedHeaders(hostname string) smtpx.Middleware

func AddReturnPath

func AddReturnPath(next smtpx.HandlerFunc) smtpx.HandlerFunc

func FilterRecipientDomains

func FilterRecipientDomains(domain ...string) smtpx.Middleware

RecipientDomainsWhitelist Check if the recipient domain, extracted from "RCPT TO" command, is in the whitelist Example usage: server.Use(middleware.RecipientDomainsWhitelist("example.com", "other-domain.com"))

func Logger

func Logger(logger *slog.Logger, opts ...Option) smtpx.Middleware

func RecipientDomainsWhitelist

func RecipientDomainsWhitelist(domain ...string) smtpx.Middleware

RecipientDomainsWhitelist Check if the recipient domain, extracted from "RCPT TO" command, is in the whitelist Example usage: server.Use(middleware.RecipientDomainsWhitelist("example.com", "other-domain.com")) if any domain in RCPT TO is in whitelist the middleware will continue if no domain in RCPT TO is in whitelist the middleware will return stats code 550 envelope.Envelope.RcptTo is not filtered and will contain all that was recviced in RCPT TO

func Recover

func Recover(next smtpx.HandlerFunc) smtpx.HandlerFunc

func SenderDomainsWhitelist

func SenderDomainsWhitelist(domain ...string) smtpx.Middleware

SenderDomainsWhitelist Check if the sender domain, extracted from "MAIL FROM" command is in the whitelist example usage: server.Use(middleware.SenderDomainsWhitelist("example.com", "other-domain.com")) if domain is not in the whitelist, the middleware will stop and return stats code 550 to email client

Types

type LoggerSettings

type LoggerSettings struct {
	Skip       Skipper
	PreFields  []func(*envelope.Envelope) (string, any)
	PostFields []func(*envelope.Envelope, smtpx.Response) (string, any)
}

type Option

type Option func(*LoggerSettings)

func WithSkipper

func WithSkipper(s Skipper) Option

type Skipper

type Skipper func(*envelope.Envelope) bool

Directories

Path Synopsis
Package authres parses and formats Authentication-Results
Package authres parses and formats Authentication-Results
dkim
Package dkim creates and verifies DKIM signatures, as specified in RFC 6376.
Package dkim creates and verifies DKIM signatures, as specified in RFC 6376.
dmarc
Package dmarc implements DMARC as specified in RFC 7489.
Package dmarc implements DMARC as specified in RFC 7489.

Jump to

Keyboard shortcuts

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