Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Domain string AllowedDomains []string TLSConfig *tls.Config MaxRecipients int BackgroundContext func() context.Context Logger *slog.Logger AuthorizeFunc func(ctx context.Context, id string) (context.Context, error) CreateAlertFunc func(ctx context.Context, a *alert.Alert) error }
Config is used to configure the SMTP server.
type SMTPLogger ¶ added in v0.32.0
type SMTPLogger struct {
// contains filtered or unexported fields
}
SMTPLogger implements the smtp.Logger interface using the main app Logger.
func (*SMTPLogger) Printf ¶ added in v0.32.0
func (l *SMTPLogger) Printf(format string, v ...interface{})
Printf adheres to smtp.Server's Logger interface.
func (*SMTPLogger) Println ¶ added in v0.32.0
func (l *SMTPLogger) Println(v ...interface{})
Print adheres to smtp.Server's Logger interface.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements an SMTP server that creates alerts.
func (*Server) NewSession ¶
NewSession implements the smtp.Backend interface.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session implements an SMTP session that creates alerts.
func (*Session) AuthPlain ¶
AuthPlain is called when a client attempts to authenticate using the PLAIN auth mechanism. It always returns an error, indicating that PLAIN auth is not supported.
func (*Session) Mail ¶
Mail is called when a new SMTP message is received (MAIL FROM). It checks that the sender is valid and stores it in the session.