Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var LogHandler func(message string, args ...interface{})
LogHandler is called for each log message. If nil, log messages will be output using log.Printf instead.
Functions ¶
This section is empty.
Types ¶
type Content ¶
Content represents the body content of an SMTP message
func ContentFromString ¶
ContentFromString parses SMTP content into separate headers and body
func (*Content) ParseMIMEBody ¶
ParseMIMEBody parses SMTP message content into multiple MIME parts
type MIMEBody ¶
type MIMEBody struct {
Parts []*Content
}
MIMEBody represents a collection of MIME parts
type Message ¶
type Message struct { ID MessageID From *Path To []*Path Content *Content Created time.Time MIME *MIMEBody // FIXME refactor to use Content.MIME Raw *SMTPMessage }
Message represents a parsed SMTP message
type MessageID ¶
type MessageID string
MessageID represents the ID of an SMTP message including the hostname part
func NewMessageID ¶
NewMessageID generates a new message ID
type Messages ¶
type Messages []Message
Messages represents an array of Messages - TODO is this even required?
type Path ¶
Path represents an SMTP forward-path or return-path
func PathFromString ¶
PathFromString parses a forward-path or reverse-path into its parts
type SMTPMessage ¶
SMTPMessage represents a raw SMTP message
func FromBytes ¶ added in v0.2.0
func FromBytes(b []byte) *SMTPMessage
FromBytes returns a SMTPMessage from raw message bytes (as output by SMTPMessage.Bytes())
func (*SMTPMessage) Bytes ¶ added in v0.2.0
func (m *SMTPMessage) Bytes() io.Reader
Bytes returns an io.Reader containing the raw message data
func (*SMTPMessage) Parse ¶
func (m *SMTPMessage) Parse(hostname string) *Message
Parse converts a raw SMTP message to a parsed MIME message