Documentation ¶
Index ¶
- Constants
- Variables
- func BenchDelivery(b *testing.B, target module.DeliveryTarget, sender string, ...)
- func CheckMsg(t *testing.T, msg *Msg, sender string, rcpt []string)
- func CheckMsgID(t *testing.T, msg *Msg, sender string, rcpt []string, id string) string
- func CheckSMTPConnLeak(t *testing.T, srv *smtp.Server)
- func CheckSMTPErr(t *testing.T, err error, code int, enchCode exterrors.EnhancedCode, msg string)
- func CheckTestMessage(t *testing.T, tgt *Target, indx int, sender string, rcpt []string)
- func Dir(t *testing.T) string
- func DoTestDelivery(t *testing.T, tgt module.DeliveryTarget, from string, to []string) string
- func DoTestDeliveryErr(t *testing.T, tgt module.DeliveryTarget, from string, to []string) (string, error)
- func DoTestDeliveryErrMeta(t *testing.T, tgt module.DeliveryTarget, from string, to []string, ...) (string, error)
- func DoTestDeliveryMeta(t *testing.T, tgt module.DeliveryTarget, from string, to []string, ...) string
- func DoTestDeliveryNonAtomic(t *testing.T, c module.StatusCollector, tgt module.DeliveryTarget, from string, ...) string
- func FailOnConn(t *testing.T, addr string) net.Listener
- func Logger(t *testing.T, name string) log.Logger
- func RandomMsg(b *testing.B) (module.MsgMetadata, textproto.Header, buffer.Buffer)
- func WaitForConnsClose(t *testing.T, srv *smtp.Server)
- type Check
- func (c *Check) CheckConnection(ctx context.Context, state *smtp.ConnectionState) error
- func (c *Check) CheckStateForMsg(ctx context.Context, msgMeta *module.MsgMetadata) (module.CheckState, error)
- func (c *Check) Init(*config.Map) error
- func (c *Check) InstanceName() string
- func (c *Check) Name() string
- type Modifier
- type Msg
- type SMTPBackend
- func SMTPServer(t *testing.T, addr string, fn ...SMTPServerConfigureFunc) (*SMTPBackend, *smtp.Server)
- func SMTPServerSTARTTLS(t *testing.T, addr string, fn ...SMTPServerConfigureFunc) (*tls.Config, *SMTPBackend, *smtp.Server)
- func SMTPServerTLS(t *testing.T, addr string, fn ...SMTPServerConfigureFunc) (*tls.Config, *SMTPBackend, *smtp.Server)
- type SMTPMessage
- type SMTPServerConfigureFunc
- type Table
- type Target
Constants ¶
View Source
const ( MessageBodySize = 100 * 1024 ExtraMessageHeaderFields = 10 ExtraMessageHeaderFieldSize = 50 )
Empirically observed "around average" values.
View Source
const DeliveryData = "A: 1\n" +
"B: 2\n" +
"\n" +
"foobar\n"
Variables ¶
View Source
var ( AuthDisabled = func(s *smtp.Server) { s.AuthDisabled = true } )
Functions ¶
func BenchDelivery ¶
func CheckMsgID ¶
func CheckSMTPConnLeak ¶
func CheckSMTPErr ¶
func CheckTestMessage ¶
func DoTestDelivery ¶
func DoTestDeliveryErr ¶
func DoTestDeliveryErrMeta ¶
func DoTestDeliveryErrMeta(t *testing.T, tgt module.DeliveryTarget, from string, to []string, msgMeta *module.MsgMetadata) (string, error)
func DoTestDeliveryMeta ¶
func DoTestDeliveryMeta(t *testing.T, tgt module.DeliveryTarget, from string, to []string, msgMeta *module.MsgMetadata) string
func DoTestDeliveryNonAtomic ¶
func DoTestDeliveryNonAtomic(t *testing.T, c module.StatusCollector, tgt module.DeliveryTarget, from string, to []string) string
func FailOnConn ¶
FailOnConn fails the test if attempt is made to connect the specified endpoint.
func WaitForConnsClose ¶
Types ¶
type Check ¶
type Check struct { InitErr error EarlyErr error ConnRes module.CheckResult SenderRes module.CheckResult RcptRes module.CheckResult BodyRes module.CheckResult ConnCalls int SenderCalls int RcptCalls int BodyCalls int UnclosedStates int InstName string }
func (*Check) CheckConnection ¶
func (*Check) CheckStateForMsg ¶
func (c *Check) CheckStateForMsg(ctx context.Context, msgMeta *module.MsgMetadata) (module.CheckState, error)
func (*Check) InstanceName ¶
type Modifier ¶
type Modifier struct { InstName string InitErr error MailFromErr error RcptToErr error BodyErr error MailFrom map[string]string RcptTo map[string]string AddHdr textproto.Header UnclosedStates int }
func (Modifier) InstanceName ¶
func (Modifier) ModStateForMsg ¶
func (m Modifier) ModStateForMsg(ctx context.Context, msgMeta *module.MsgMetadata) (module.ModifierState, error)
type SMTPBackend ¶
type SMTPBackend struct { Messages []*SMTPMessage MailFromCounter int AuthErr error MailErr error RcptErr map[string]error DataErr error }
func SMTPServer ¶
func SMTPServer(t *testing.T, addr string, fn ...SMTPServerConfigureFunc) (*SMTPBackend, *smtp.Server)
func SMTPServerSTARTTLS ¶
func SMTPServerSTARTTLS(t *testing.T, addr string, fn ...SMTPServerConfigureFunc) (*tls.Config, *SMTPBackend, *smtp.Server)
SMTPServerSTARTTLS starts a server listening on the specified addr with the STARTTLS extension supported.
Returned *tls.Config is for the client and is set to trust the server certificate.
func SMTPServerTLS ¶
func SMTPServerTLS(t *testing.T, addr string, fn ...SMTPServerConfigureFunc) (*tls.Config, *SMTPBackend, *smtp.Server)
SMTPServerTLS starts a SMTP server listening on the specified addr with Implicit TLS.
func (*SMTPBackend) AnonymousLogin ¶
func (be *SMTPBackend) AnonymousLogin(state *smtp.ConnectionState) (smtp.Session, error)
func (*SMTPBackend) Login ¶
func (be *SMTPBackend) Login(state *smtp.ConnectionState, username, password string) (smtp.Session, error)
type SMTPMessage ¶
type SMTPServerConfigureFunc ¶
type SMTPServerConfigureFunc func(*smtp.Server)
Click to show internal directories.
Click to hide internal directories.