Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCredentials = errors.New("InvalidCredentialsError")
ErrInvalidCredentials denotes incorrect credentials.
Functions ¶
This section is empty.
Types ¶
type AuthBackend ¶
type AuthBackend interface { // Login checks whether the credentials of a user are valid. // returns ErrInvalidCredentials if credentials not valid. Login(state *smtp.State, username string, password string) (User, error) }
AuthBackend represents a pluggable authentication backend for the MTA
type AuthBackendMemory ¶
AuthBackendMemory is a simple in-memory implementation of AuthBackend for testing purpose.
func NewAuthBackendMemory ¶
func NewAuthBackendMemory(credentials map[string]string) *AuthBackendMemory
NewAuthBackendMemory creates a new in-memory AuthBackend
type Blacklist ¶
type Blacklist interface { // CheckIp will return true if the IP is blacklisted and false if the IP was not found in a blacklist CheckIp(ip string) bool }
Interface for handling blaclists it is meant to be replaced by your own implementation
type DefaultMta ¶
type DefaultMta struct {
Server *Server
}
Same as the Mta struct but has methods for handling socket connections.
func NewDefault ¶
func NewDefault(c Config, h Handler) *DefaultMta
NewDefault Create a new SMTP server with a socket protocol implementation.
func (*DefaultMta) ListenAndServe ¶
func (s *DefaultMta) ListenAndServe() error
func (*DefaultMta) Stop ¶
func (s *DefaultMta) Stop()
type HandlerFunc ¶
HandlerFunc is a wrapper to allow normal functions to be used as a handler.
type SMTPUser ¶
type SMTPUser struct {
// contains filtered or unexported fields
}
SMTPUser is a quick implementation of the User interface
type Server ¶
type Server struct { // The handler to be called when a mail is received. MailHandler Handler // The config for tls connection. Nil if not supported. TlsConfig *tls.Config AuthBackend AuthBackend // contains filtered or unexported fields }
Server Represents an SMTP server
func (*Server) HandleClient ¶
HandleClient Start communicating with a client