Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessagePath ¶
MessagePath represents an SMTP "MAIL FROM" or "RCPT TO" string content converted to object.
func MessagePathFromString ¶
func MessagePathFromString(path string) (*MessagePath, error)
MessagePathFromString parses a forward-path or reverse-path into its parts According rfc5321, message path have format "<[RELAYS:]BOX@DOMAIN>[ <EMAIL_PARAMS>]" so all of these examples are possible "<quix@quib.com> <foo,bar>" "<@foo,@bar,@baz:quix@quib.com>" "<@foo,@bar,@baz:quix@quib.com> <foo,bar>"
func (*MessagePath) Address ¶
func (path *MessagePath) Address() string
Address returns full address form path eg: "mailbox@domain".
func (*MessagePath) ToString ¶
func (path *MessagePath) ToString() string
ToString convert path object to standard rfc5321 path string.
type SmtpMessage ¶
type SmtpMessage struct { ID MessageID Helo string From *MessagePath To []*MessagePath // contains filtered or unexported fields }
SmtpMessage represents parsed SMTP message what allows easily get and manipulate data
func FromString ¶
func FromString(messageString string, messageId MessageID) *SmtpMessage
FromString returns a SmtpMessage from raw message bytes (as output by SmtpMessage.ToReader())
func (*SmtpMessage) GetEmail ¶
func (message *SmtpMessage) GetEmail() *email.Email
GetEmail data object (parsed origin value)
func (*SmtpMessage) GetOrigin ¶
func (message *SmtpMessage) GetOrigin() string
GetOrigin data value (string)
func (*SmtpMessage) SetOrigin ¶
func (message *SmtpMessage) SetOrigin(origin string) error
SetOrigin add to object new Origin Data and automatically parse it to email structure
func (*SmtpMessage) ToReader ¶
func (message *SmtpMessage) ToReader() io.Reader
ToReader returns an io.Reader containing the raw message data