Documentation
¶
Index ¶
- func NewServer(conf Config, logger *slog.Logger) (*smtp.Server, error)
- func NewService(conf Config, logger *slog.Logger) service.Service
- type Backend
- type Config
- type Server
- type Session
- func (s *Session) Auth(mech string) (sasl.Server, error)
- func (s *Session) AuthMechanisms() []string
- func (s *Session) Data(r io.Reader) error
- func (s *Session) Logout() error
- func (s *Session) Mail(from string, opts *smtp.MailOptions) error
- func (s *Session) Rcpt(to string, opts *smtp.RcptOptions) error
- func (s *Session) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements SMTP server methods.
type Config ¶
type Config struct {
Addr string // "localhost:1025"
Domain string // "localhost"
WriteTimeout int // 10 seconds
ReadTimeout int // 10 seconds
MaxMessageBytes int // 1024 * 1024
MaxRecipients int // 50
RequireAuth bool // false
AllowInsecureAuth bool // true
// TLS enables SMTPS mode when non-nil.
TLS *tlsprovider.Config
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an SMTP session.
func (*Session) AuthMechanisms ¶
AuthMechanisms returns available authentication mechanisms.
func (*Session) Mail ¶
func (s *Session) Mail(from string, opts *smtp.MailOptions) error
Mail handles MAIL FROM command.
Click to show internal directories.
Click to hide internal directories.