Documentation ¶
Overview ¶
Package smtptester implements a simple SMTP server for testing. All received mails are saved in a sync.Map with a key:
From+Recipient1+Recipient2
Mails to the same sender and recipients will overwrite a previous received mail, when the recipients slice has the same order as in the mail received before.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
Backend is the backend for out test server. It contains a sync.Map with all mails received.
func GetBackend ¶
func GetBackend(s *smtp.Server) *Backend
GetBackend returns the concrete type *Backend from SMTP server.
func NewBackend ¶
func NewBackend() *Backend
NewBackend returns a new Backend with an empty (not nil) Mails map.
func (*Backend) Load ¶
Load loads mail from 'from' to recipients 'recipients'. The ok result indicates whether value was found in the map.
func (*Backend) NewSession ¶
NewSession returns a new Session.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A Session is returned after successful login.