Documentation ¶
Overview ¶
Package smtpsrv implements chasquid's SMTP server and connection handler.
Index ¶
- Variables
- type Conn
- func (c *Conn) AUTH(params string) (code int, msg string)
- func (c *Conn) Close()
- func (c *Conn) DATA(params string) (code int, msg string)
- func (c *Conn) EHLO(params string) (code int, msg string)
- func (c *Conn) EXPN(params string) (code int, msg string)
- func (c *Conn) HELO(params string) (code int, msg string)
- func (c *Conn) HELP(params string) (code int, msg string)
- func (c *Conn) Handle()
- func (c *Conn) MAIL(params string) (code int, msg string)
- func (c *Conn) NOOP(params string) (code int, msg string)
- func (c *Conn) RCPT(params string) (code int, msg string)
- func (c *Conn) RSET(params string) (code int, msg string)
- func (c *Conn) STARTTLS(params string) (code int, msg string)
- func (c *Conn) VRFY(params string) (code int, msg string)
- type Server
- func (s *Server) AddAddr(a string, m SocketMode)
- func (s *Server) AddAliasesFile(domain, f string) error
- func (s *Server) AddCerts(certPath, keyPath string) error
- func (s *Server) AddDomain(d string)
- func (s *Server) AddListeners(ls []net.Listener, m SocketMode)
- func (s *Server) AddUserDB(domain string, db *userdb.DB)
- func (s *Server) InitQueue(path string, localC, remoteC courier.Courier)
- func (s *Server) ListenAndServe()
- func (s *Server) Reload()
- func (s *Server) SetAliasesConfig(suffixSep, dropChars string)
- func (s *Server) SetAuthFallback(be auth.Backend)
- func (s *Server) SetDomainInfo(dinfo *domaininfo.DB)
- type SocketMode
Constants ¶
This section is empty.
Variables ¶
var ( ModeSMTP = SocketMode{IsSubmission: false, TLS: false} ModeSubmission = SocketMode{IsSubmission: true, TLS: false} ModeSubmissionTLS = SocketMode{IsSubmission: true, TLS: true} )
Valid socket modes.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents an incoming SMTP connection.
func (*Conn) Handle ¶
func (c *Conn) Handle()
Handle implements the main protocol loop (reading commands, sending replies).
type Server ¶
type Server struct { // Main hostname, used for display only. Hostname string // Maximum data size. MaxDataSize int64 // Use HAProxy on incoming connections. HAProxyEnabled bool // Path to the hooks. HookPath string // contains filtered or unexported fields }
Server represents an SMTP server instance.
func (*Server) AddAddr ¶
func (s *Server) AddAddr(a string, m SocketMode)
AddAddr adds an address for the server to listen on.
func (*Server) AddAliasesFile ¶
AddAliasesFile adds an aliases file for the given domain.
func (*Server) AddListeners ¶
func (s *Server) AddListeners(ls []net.Listener, m SocketMode)
AddListeners adds listeners for the server to listen on.
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
ListenAndServe on the addresses and listeners that were previously added. This function will not return.
func (*Server) SetAliasesConfig ¶
SetAliasesConfig sets the aliases configuration options.
func (*Server) SetAuthFallback ¶
SetAuthFallback sets the authentication backend to use as fallback.
func (*Server) SetDomainInfo ¶ added in v1.13.0
func (s *Server) SetDomainInfo(dinfo *domaininfo.DB)
SetDomainInfo sets the domain info database to use.
type SocketMode ¶
type SocketMode struct { // Is this mode submission? IsSubmission bool // Is this mode TLS-wrapped? That means that we don't use STARTTLS, the // connection is directly established over TLS (like HTTPS). TLS bool }
SocketMode represents the mode for a socket (listening or connection). We keep them distinct, as policies can differ between them.
func (SocketMode) String ¶
func (mode SocketMode) String() string