Documentation ¶
Index ¶
- Constants
- Variables
- func BenchDelivery(b *testing.B, target module.DeliveryTarget, sender string, ...)
- func BodyFromStr(t *testing.T, literal string) (textproto.Header, buffer.MemoryBuffer)
- 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 FailingBuffer
- type Modifier
- type Msg
- type MultiTable
- 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\r\n" +
"B: 2\r\n" +
"\r\n" +
"foobar\r\n"
Variables ¶
View Source
var AuthDisabled = func(s *smtp.Server) { s.AuthDisabled = true }
Functions ¶
func BenchDelivery ¶
func BodyFromStr ¶ added in v0.3.0
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 FailingBuffer ¶ added in v0.3.0
func (FailingBuffer) Len ¶ added in v0.3.0
func (fb FailingBuffer) Len() int
func (FailingBuffer) Open ¶ added in v0.3.0
func (fb FailingBuffer) Open() (io.ReadCloser, error)
func (FailingBuffer) Remove ¶ added in v0.3.0
func (fb FailingBuffer) Remove() error
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 MultiTable ¶ added in v0.6.0
func (MultiTable) LookupMulti ¶ added in v0.6.0
type SMTPBackend ¶
type SMTPBackend struct { Messages []*SMTPMessage MailFromCounter int SessionCounter int SourceEndpoints map[string]struct{} AuthErr error MailErr error RcptErr map[string]error DataErr error LMTPDataErr []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) NewSession ¶ added in v0.5.2
func (be *SMTPBackend) NewSession(state smtp.ConnectionState, _ string) (smtp.Session, error)
type SMTPMessage ¶
type SMTPServerConfigureFunc ¶
type SMTPServerConfigureFunc func(*smtp.Server)
Click to show internal directories.
Click to hide internal directories.