Documentation
¶
Index ¶
Constants ¶
const DefaultTimeout = 5 * time.Second
DefaultTimeout is default timeout
const DiscardFlag = "discard"
DiscardFlag makes, while being set, message to be silently discarded by all compatible msmtpd.DataHandler's
Variables ¶
var TemporaryError = msmtpd.ErrorSMTP{
Code: 451,
Message: "temporary errors, please, try again later",
}
TemporaryError means backend is malfunctioning, but you can try to deliver later
var UnknownRecipientError = msmtpd.ErrorSMTP{
Code: 521,
Message: "i have no idea about recipient you want to deliver message to",
}
UnknownRecipientError means backend is unaware of recipient you want to deliver too
Functions ¶
func ViaLocalMailTransferProtocol ¶
func ViaLocalMailTransferProtocol(opts LMTPOptions) msmtpd.DataHandler
ViaLocalMailTransferProtocol sends email message via LMTP protocol
func ViaSMTPProxy ¶
func ViaSMTPProxy(opts SMTPProxyOptions) msmtpd.DataHandler
ViaSMTPProxy adds DataHandler that performs delivery via 3rd party SMTP server
func ViaSendmail ¶
func ViaSendmail(opts *SendmailOptions) msmtpd.DataHandler
ViaSendmail sends email message via sendmail command
Types ¶
type LMTPOptions ¶
type LMTPOptions struct { // Network can be `unix`, `tcp`, `tcp4` or `tcp6` Network string // Address shows where we connect Address string // LHLO is greeting to LMTP server LHLO string // Timeout limits time of LMTP server interactions Timeout time.Duration }
LMTPOptions allows us to tune how we connect to LMTP server
func (*LMTPOptions) String ¶
func (opts *LMTPOptions) String() string
String returns where options urges to connect to
type SMTPProxyOptions ¶
type SMTPProxyOptions struct { // Network defines how we dial SMTP Proxy, can be tcp or unix Network string // Address defines where remote SMTP Proxy is available Address string // HELO sets greeting for remote server HELO string // TLS, if not null, enables STARTTLS with this options TLS *tls.Config // Auth sets authentication mechanism for proxy backend Auth smtp.Auth // MailFrom defines senders override, if empty, value from Transaction.MailFrom will be used MailFrom string // RcptTo defines recipients' override, if empty, values from Transaction.Aliases or Transaction.RcptTo will be used RcptTo []string }
SMTPProxyOptions used to configure ViaSMTPProxy
func (*SMTPProxyOptions) String ¶
func (so *SMTPProxyOptions) String() string
type SendmailOptions ¶
type SendmailOptions struct { // PathToExecutable PathToExecutable string // UseMinusTFlag UseMinusTFlag bool }
SendmailOptions defines how we start sendmail executable