Versions in this module Expand all Collapse all v0 v0.55.0 May 4, 2024 v0.54.0 Apr 4, 2024 Changes in this version + const CommandAUTH + const CommandDATA + const CommandEHLO + const CommandEXPN + const CommandHELO + const CommandHELP + const CommandMAIL + const CommandNOOP + const CommandQUIT + const CommandRCPT + const CommandRSET + const CommandVRFY + const CommandZERO + const StatusAddressChange + const StatusAddressChangeAborted + const StatusAuthMechanismTooWeak + const StatusAuthReady + const StatusAuthenticated + const StatusClosing + const StatusCmdBadSequence + const StatusCmdNotImplemented + const StatusCmdSyntaxError + const StatusCmdTooLong + const StatusCmdUnknown + const StatusDataReady + const StatusHelp + const StatusInvalidCredential + const StatusLocalError + const StatusMailNoStorage + const StatusMailRcptParamUnknown + const StatusMailboxIncorrect + const StatusMailboxNotFound + const StatusMailboxUnavailable + const StatusNoStorage + const StatusNotAuthenticated + const StatusOK + const StatusParamUnimplemented + const StatusParameterUnprocessable + const StatusPasswordTransitionNeeded + const StatusReady + const StatusShuttingDown + const StatusSystem + const StatusTemporaryAuthFailure + const StatusTransactionFailed + const StatusVerifyFailed + var ErrInvalidCredential = &errors.E + func ParseMailbox(data []byte) (mailbox []byte) + func ParsePath(path []byte) (mailbox []byte, err error) + type Account struct + HashPass string + func NewAccount(name, local, domain, pass string) (acc *Account, err error) + func (acc *Account) Authenticate(pass string) (err error) + func (acc *Account) Short() (out string) + func (acc *Account) String() (out string) + type Client struct + ServerInfo *ServerInfo + func NewClient(opts ClientOptions) (cl *Client, err error) + func (cl *Client) Authenticate(mech SaslMechanism, username, password string) (res *Response, err error) + func (cl *Client) Expand(mlist string) (res *Response, err error) + func (cl *Client) Help(cmdName string) (res *Response, err error) + func (cl *Client) MailTx(mail *MailTx) (res *Response, err error) + func (cl *Client) Noop(msg string) (res *Response, err error) + func (cl *Client) Quit() (res *Response, err error) + func (cl *Client) Reset() (res *Response, err error) + func (cl *Client) SendCommand(cmd []byte) (res *Response, err error) + func (cl *Client) SendEmail(from string, to []string, subject, bodyText, bodyHTML []byte) (err error) + func (cl *Client) StartTLS() (res *Response, err error) + func (cl *Client) Verify(mailbox string) (res *Response, err error) + type ClientOptions struct + AuthMechanism SaslMechanism + AuthPass string + AuthUser string + Insecure bool + LocalName string + ServerURL string + type Command struct + Arg string + Kind CommandKind + Param string + Params map[string]string + type CommandKind int + type DKIMOptions struct + PrivateKey *rsa.PrivateKey + Signature *dkim.Signature + type Domain struct + Accounts map[string]*Account + Name string + func NewDomain(name string, dkimOpts *DKIMOptions) (domain *Domain) + type Environment struct + PrimaryDomain *Domain + VirtualDomains map[string]*Domain + type Extension interface + Name func() string + Params func() string + ValidateCommand func(cmd *Command) error + type Handler interface + ServeAuth func(username, password string) (*Response, error) + ServeBounce func(mail *MailTx) (*Response, error) + ServeExpand func(mailingList string) (*Response, error) + ServeMailTx func(mail *MailTx) (*Response, error) + ServeVerify func(username string) (*Response, error) + type LocalHandler struct + func NewLocalHandler(env *Environment) (local *LocalHandler) + func (lh *LocalHandler) ServeAuth(username, password string) (res *Response, err error) + func (lh *LocalHandler) ServeBounce(_ *MailTx) (res *Response, err error) + func (lh *LocalHandler) ServeExpand(_ string) (res *Response, err error) + func (lh *LocalHandler) ServeMailTx(_ *MailTx) (res *Response, err error) + func (lh *LocalHandler) ServeVerify(username string) (res *Response, err error) + type LocalStorage struct + func NewLocalStorage(dir string) (storage *LocalStorage, err error) + func (fs *LocalStorage) MailBounce(id string) error + func (fs *LocalStorage) MailDelete(id string) (err error) + func (fs *LocalStorage) MailLoad(id string) (mail *MailTx, err error) + func (fs *LocalStorage) MailLoadAll() (mails []*MailTx, err error) + func (fs *LocalStorage) MailSave(mail *MailTx) (err error) + type MailTx struct + Data []byte + From string + ID string + Postpone time.Time + Received time.Time + Recipients []string + Retry int + func NewMailTx(from string, to []string, data []byte) (mail *MailTx) + func (mail *MailTx) Reset() + type Mailbox struct + Domain string + Local string + Name string + type Response struct + Body []string + Code int + Message string + func NewResponse(raw []byte) (res *Response, err error) + type SaslMechanism int + const SaslMechanismPlain + type Server struct + Env *Environment + Exts []Extension + Handler Handler + TLSCert *tls.Certificate + func (srv *Server) LoadCertificate(certFile, keyFile string) (err error) + func (srv *Server) Start() (err error) + func (srv *Server) Stop() + type ServerInfo struct + Domain string + Exts map[string][]string + Info string + func NewServerInfo(res *Response) (srvInfo *ServerInfo) + type Storage interface + MailBounce func(id string) error + MailDelete func(id string) error + MailLoad func(id string) (mail *MailTx, err error) + MailLoadAll func() (mail []*MailTx, err error) + MailSave func(mail *MailTx) error