Documentation
¶
Index ¶
- Variables
- func ListenAndServe(cfg *ServerConfig) error
- func ListenAndServeTLS(cfg *ServerConfig) error
- func SetDefaultServerConfig(cfg *ServerConfig)
- func SplitAddress(address string) (string, string, error)
- type Attachment
- type AuthFunc
- type Backend
- type Context
- func (c Context) From() *mail.Address
- func (c Context) Mailable() (bool, error)
- func (c Context) Parse() (*Email, error)
- func (c Context) Read(p []byte) (int, error)
- func (c Context) RemoteAddr() net.Addr
- func (c Context) SPF() (SPFResult, string, error)
- func (c Context) TLS() *tls.ConnectionState
- func (c Context) To() *mail.Address
- func (c Context) User() (string, string, error)
- type Email
- type EmbeddedFile
- type HandlerFunc
- type SPFResult
- type ServerConfig
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAuthDisabled = errors.New("auth is disabled")
)
Functions ¶
func ListenAndServe ¶
func ListenAndServe(cfg *ServerConfig) error
func ListenAndServeTLS ¶
func ListenAndServeTLS(cfg *ServerConfig) error
func SetDefaultServerConfig ¶
func SetDefaultServerConfig(cfg *ServerConfig)
Types ¶
type Attachment ¶
Attachment with filename, content type and data (as a io.Reader)
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
The Backend implements SMTP server methods.
func NewBackend ¶
func NewBackend(auther AuthFunc, handler HandlerFunc) *Backend
func (*Backend) AnonymousLogin ¶
AnonymousLogin requires clients to authenticate using SMTP AUTH before sending emails
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (Context) RemoteAddr ¶
func (Context) TLS ¶
func (c Context) TLS() *tls.ConnectionState
type Email ¶
type Email struct {
Header mail.Header
Subject string
Sender *mail.Address
From []*mail.Address
ReplyTo []*mail.Address
To []*mail.Address
Cc []*mail.Address
Bcc []*mail.Address
Date time.Time
MessageID string
InReplyTo []string
References []string
ResentFrom []*mail.Address
ResentSender *mail.Address
ResentTo []*mail.Address
ResentDate time.Time
ResentCc []*mail.Address
ResentBcc []*mail.Address
ResentMessageID string
ContentType string
Content io.Reader
HTMLBody string
TextBody string
Attachments []Attachment
EmbeddedFiles []EmbeddedFile
}
Email with fields for all the headers defined in RFC5322 with it's attachments and
type EmbeddedFile ¶
EmbeddedFile with content id, content type and data (as a io.Reader)
type HandlerFunc ¶
type ServerConfig ¶
type Session ¶
type Session struct {
From *mail.Address
To *mail.Address
// contains filtered or unexported fields
}
A Session is returned after successful login.
func NewSession ¶
func NewSession(state *smtp.ConnectionState, handler HandlerFunc, username, password *string) *Session
NewSession initialize a new session
Click to show internal directories.
Click to hide internal directories.