Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusPasswordNeeded = 432 StatusMessageError = 450 StatusMessageExceedStorage = 452 StatusTempAuthFailure = 454 StatusAuthInvalid = 535 StatusAuthRequired = 530 StatusEncryptionRequired = 538 StatusServerError = 550 StatusExceedStorage = 552 )
Variables ¶
View Source
var ( ErrPasswordNeeded = Error{Code: StatusPasswordNeeded, Message: StatusString(StatusPasswordNeeded)} ErrMessageError = Error{Code: StatusMessageError, Message: StatusString(StatusMessageError)} ErrMessageExceedStorage = Error{Code: StatusMessageExceedStorage, Message: StatusString(StatusMessageExceedStorage)} ErrTempAuthFailure = Error{Code: StatusTempAuthFailure, Message: StatusString(StatusTempAuthFailure)} ErrAuthInvalid = Error{Code: StatusAuthInvalid, Message: StatusString(StatusAuthInvalid)} ErrAuthRequired = Error{Code: StatusAuthRequired, Message: StatusString(StatusAuthRequired)} ErrServerError = Error{Code: StatusServerError, Message: StatusString(StatusServerError)} ErrExceedStorage = Error{Code: StatusExceedStorage, Message: StatusString(StatusExceedStorage)} )
Functions ¶
func StatusString ¶
Types ¶
type Connection ¶
type Connection struct { Server *Server HeloName string Protocol Protocol Addr net.Addr TLS *tls.ConnectionState Envelope *Envelope Environment map[string]interface{} // contains filtered or unexported fields }
func (*Connection) Error ¶
func (c *Connection) Error(err error)
type Delivery ¶
type Delivery interface {
HandleDelivery(func(conn *Connection)) func(conn *Connection)
}
Delivery is called after the whole MIME message is sent to the server.
type DeliveryFunc ¶
type DeliveryFunc func(func(conn *Connection)) func(conn *Connection)
func (DeliveryFunc) HandleDelivery ¶
func (d DeliveryFunc) HandleDelivery(x func(conn *Connection)) func(conn *Connection)
type Envelope ¶
func (*Envelope) AddReceivedLine ¶
func (e *Envelope) AddReceivedLine(c *Connection)
type Recipient ¶
type Recipient interface {
HandleRecipient(func(conn *Connection)) func(conn *Connection)
}
Recipient is called whenever client sents a RCPT command to the server.
type RecipientFunc ¶
type RecipientFunc func(func(conn *Connection)) func(conn *Connection)
func (RecipientFunc) HandleRecipient ¶
func (r RecipientFunc) HandleRecipient(x func(conn *Connection)) func(conn *Connection)
type Sender ¶
type Sender interface {
HandleSender(func(conn *Connection)) func(conn *Connection)
}
Sender allows data preloading whenever a new envelope is created.
type SenderFunc ¶
type SenderFunc func(func(conn *Connection)) func(conn *Connection)
func (SenderFunc) HandleSender ¶
func (s SenderFunc) HandleSender(x func(conn *Connection)) func(conn *Connection)
type Server ¶
type Server struct { Hostname string WelcomeMessage string ReadTimeout time.Duration WriteTimeout time.Duration DataTimeout time.Duration MaxConnections int MaxMessageSize int MaxRecipients int WrapperChain []Wrapper SenderChain []Sender RecipientChain []Recipient DeliveryChain []Delivery TLSConfig *tls.Config ForceTLS bool // contains filtered or unexported fields }
func (*Server) ListenAndServe ¶
type Wrapper ¶
type Wrapper interface {
Wrap(func()) func()
}
Wrapper is used for surrounding whole calls with defer etc.
type WrapperFunc ¶
type WrapperFunc func(func()) func()
func (WrapperFunc) Wrap ¶
func (w WrapperFunc) Wrap(x func()) func()
Click to show internal directories.
Click to hide internal directories.