Documentation
¶
Index ¶
- Variables
- func CanonicalizeEmail(local string) string
- func Handle(pattern string, handler Handler)
- func HandleFunc(pattern string, handler func(envelope *Envelope) error)
- func ListenAndServe(addr string, handler Handler) error
- func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error
- func SplitAddress(address string) (string, string, error)
- type Envelope
- type Handler
- type HandlerFunc
- type ServeMux
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( ErrorRequestedActionAbortedLocalError = errors.New("Requested action aborted: local error in processing") ErrorTransactionFailed = errors.New("Transaction failed") ErrorServiceNotAvailable = errors.New("Service not available, closing transmission channel") ErrorRequestedActionAbortedExceededStorage = errors.New("Requested mail action aborted: exceeded storage allocation") )
var DefaultServeMux = NewServeMux()
Functions ¶
func CanonicalizeEmail ¶
I'm following googles example here. Basically all '.' dont matter in the local portion. Also you can append a '+' section to the end of your email and it will still route to you. This allows categorization of emails when they are given out. The muxer will canonicalize incoming email addresses to route them to a handler. The handler will still see the original email in the to portion.
func HandleFunc ¶
func ListenAndServe ¶
func ListenAndServeTLS ¶
Types ¶
type HandlerFunc ¶
func (HandlerFunc) ServeSMTP ¶
func (f HandlerFunc) ServeSMTP(envelope *Envelope) error
type ServeMux ¶
type ServeMux struct {
// contains filtered or unexported fields
}
func NewServeMux ¶
func NewServeMux() *ServeMux
func (*ServeMux) Handle ¶
Handle will register the given email pattern to be handled with the given handler. The Canonacalize method will be called on the pattern to help ensure expected matches will come through. The special '*' wildcard can be used for the local portion or the domain portion to broaden the match.
func (*ServeMux) HandleFunc ¶
type Server ¶
type Server struct { Name string Addr string Handler Handler // If a tls config is set then this server will broadcast support // for the STARTTLS (RFC3207) extension. TLSConfig *tls.Config // Auth specifies an optional callback function that is called // when a client attempts to authenticate. If left nil (the default) // then the AUTH extension will not be supported. Auth func(username, password, remoteAddress string) error // Addressable specifies an optional callback function that is called // when a client attempts to send a message to the given address. This // allows the server to refuse messages that it doesn't own. If left nil // (the default) then the server will assume true Addressable func(user, address string) bool Debug bool ErrorLog *log.Logger }