Documentation
¶
Overview ¶
Package smtprelay delivers emulated SES mail to a real SMTP server using the standard library, asynchronously through a bounded queue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoRecipients is returned when a message has no deliverable recipient. ErrNoRecipients = errors.New("smtprelay: no recipients") // ErrPlaintextCredentials is returned when AUTH would send credentials unencrypted to a non-local host. ErrPlaintextCredentials = errors.New( "smtprelay: refusing to send credentials over an unencrypted non-local connection", ) )
View Source
var ErrHeaderInjection = errors.New("smtprelay: header value contains a line break")
ErrHeaderInjection is returned when a header value contains CR or LF.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
Date time.Time
ID string
From string
Subject string
Text string
HTML string
// EnvelopeFrom overrides From as the SMTP MAIL FROM (e.g. a SES ReturnPath).
EnvelopeFrom string
Raw []byte
To []string
Cc []string
Bcc []string
ReplyTo []string
}
Message is one outbound email. When Raw is set it is sent verbatim and only the envelope fields (EnvelopeFrom, To, Cc, Bcc) are used.
type Option ¶
type Option func(*Relay)
Option customises a Relay.
func WithQueueSize ¶
WithQueueSize sets the bounded queue capacity; values below 1 are ignored.
func WithTLSConfig ¶
WithTLSConfig overrides the STARTTLS client configuration (tests use it to trust a self-signed cert).
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay queues messages and delivers them from a single worker goroutine.
Click to show internal directories.
Click to hide internal directories.