Versions in this module Expand all Collapse all v0 v0.11.2 May 21, 2019 Changes in this version + var EnhancedCodeNotSet = EnhancedCode + var ErrAuthRequired = errors.New("Please authenticate first") + var ErrAuthUnsupported = errors.New("Authentication not supported") + var ErrDataTooLarge = &SMTPError + var NoEnhancedCode = EnhancedCode + func SendMail(addr string, a sasl.Client, from string, to []string, r io.Reader, useTLS bool) error + type Backend interface + AnonymousLogin func(state *ConnectionState) (Session, error) + Login func(state *ConnectionState, username, password string) (Session, error) + type Client struct + Text *textproto.Conn + func Dial(addr string) (*Client, error) + func DialTLS(addr string, tlsConfig *tls.Config) (*Client, error) + func NewClient(conn net.Conn, host string) (*Client, error) + func NewClientLMTP(conn net.Conn, host string) (*Client, error) + func (c *Client) Auth(a sasl.Client) error + func (c *Client) Close() error + func (c *Client) Data() (io.WriteCloser, error) + func (c *Client) Extension(ext string) (bool, string) + func (c *Client) Hello(localName string) error + func (c *Client) Mail(from string) error + func (c *Client) Noop() error + func (c *Client) Quit() error + func (c *Client) Rcpt(to string) error + func (c *Client) Reset() error + func (c *Client) StartTLS(config *tls.Config) error + func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool) + func (c *Client) Verify(addr string) error + type Conn struct + func (c *Conn) Close() error + func (c *Conn) ReadLine() (string, error) + func (c *Conn) Reject() + func (c *Conn) Server() *Server + func (c *Conn) Session() Session + func (c *Conn) SetSession(session Session) + func (c *Conn) State() ConnectionState + func (c *Conn) TLSConnectionState() (state tls.ConnectionState, ok bool) + func (c *Conn) WriteResponse(code int, enhCode EnhancedCode, text ...string) + type ConnectionState struct + Hostname string + RemoteAddr net.Addr + TLS tls.ConnectionState + type EnhancedCode [3]int + type SMTPError struct + Code int + EnhancedCode EnhancedCode + Message string + func (err *SMTPError) Error() string + type SaslServerFactory func(conn *Conn) sasl.Server + type Server struct + Addr string + AllowInsecureAuth bool + AuthDisabled bool + Backend Backend + Debug io.Writer + Domain string + LMTP bool + MaxMessageBytes int + MaxRecipients int + ReadTimeout time.Duration + Strict bool + TLSConfig *tls.Config + WriteTimeout time.Duration + func NewServer(be Backend) *Server + func (s *Server) Close() + func (s *Server) EnableAuth(name string, f SaslServerFactory) + func (s *Server) ForEachConn(f func(*Conn)) + func (s *Server) ListenAndServe() error + func (s *Server) ListenAndServeTLS() error + func (s *Server) Serve(l net.Listener) error + type Session interface + Data func(r io.Reader) error + Logout func() error + Mail func(from string) error + Rcpt func(to string) error + Reset func()