smtpMessage

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: MIT-0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MailPath

type MailPath struct {
	Relays  []string
	Mailbox string
	Domain  string
	Params  string
}

MailPath represents an SMTP forward-path or return-path

func MailPathFromString

func MailPathFromString(path string) *MailPath

MailPathFromString parses a forward-path or reverse-path into its parts

func (*MailPath) Address

func (path *MailPath) Address() string

type MessageID

type MessageID string

MessageID represents the ID of an SMTP message

func NewMessageID

func NewMessageID() MessageID

NewMessageID generates a new mail identificatior

type SMTPMail

type SMTPMail struct {
	ID     MessageID
	From   *MailPath
	To     []*MailPath
	Email  *email.Email
	Origin *SMTPMessage
}

SMTPMail represents parsed SMTPMessage what allow easily get and manipulate data

type SMTPMessage

type SMTPMessage struct {
	From string
	To   []string
	Data string
	Helo string
}

SMTPMessage represents a raw SMTP message

func FromString

func FromString(messageString string) *SMTPMessage

FromString returns a SMTPMessage from raw message bytes (as output by SMTPMessage.ToReader())

func (*SMTPMessage) ToReader

func (message *SMTPMessage) ToReader() io.Reader

ToReader returns an io.Reader containing the raw message data

func (*SMTPMessage) ToSMTPMail

func (message *SMTPMessage) ToSMTPMail(id MessageID) (*SMTPMail, error)

ToSMTPMail converts SMTPMassage to SMTPMail structure In case if `id` is empty will be automatically generated new identificator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL