Versions in this module Expand all Collapse all v1 v1.0.1 Sep 10, 2023 v1.0.0 Sep 10, 2023 Changes in this version + const ConnectionStage + const DefaultEmail + const DefaultHelloName + const DefaultSMTPPort + const DefaultTimeoutConnection + const DefaultTimeoutResponse + const ErrConnectionMsg + const ErrPrefix + const RandomRCPTStage + const TCPConnection + var DefaultFromEmail = evmail.FromString(DefaultEmail) + var DirectDialVar = DirectDial + var ErrConnection = NewError(ConnectionStage, errors.New(ErrConnectionMsg)) + var H12ioDialVar = socks.Dial + var SmtpNewClientVar = smtp.NewClient + func DefaultRandomCacheKeyGetter(email evmail.Address) interface + func DirectDial(ctx context.Context, addr, proxyURL string) (smtpclient.SMTPClient, error) + func ExtID() int8 + func H12IODial(ctx context.Context, addr, proxyURL string) (smtpclient.SMTPClient, error) + func SetExtID(rExt int8) + type ARandomRCPT struct + func (a *ARandomRCPT) Call(sm SendMail, email evmail.Address) []error + func (a *ARandomRCPT) Get() RandomRCPTFunc + func (a *ARandomRCPT) Set(fn RandomRCPTFunc) + type ASMTPError struct + func (a *ASMTPError) DecodeMsgpack(dec *msgpack.Decoder) error + func (a *ASMTPError) EncodeMsgpack(enc *msgpack.Encoder) error + func (a *ASMTPError) Error() string + func (a *ASMTPError) Stage() SendMailStage + func (a *ASMTPError) Unwrap() error + type AliasError error + func ErrorsToEVSMTPErrors(errs []error) (Errs []AliasError) + type Checker interface + Validate func(mxs MXs, input Input) []error + func NewChecker(dto CheckerDTO) Checker + func NewCheckerCacheRandomRCPT(checker CheckerWithRandomRCPT, cache evcache.Interface, ...) Checker + type CheckerCacheRandomRCPTStruct struct + Cache evcache.Interface + GetKey RandomCacheKeyGetter + RandomRCPTOpt RandomRCPT + func (c CheckerCacheRandomRCPTStruct) RandomRCPT(sm SendMail, email evmail.Address) (errs []error) + type CheckerDTO struct + Options Options + RandomEmail RandomEmail + SendMailFactory SendMailDialerFactory + type CheckerStruct struct + Auth smtp.Auth + Options Options + RandomEmail RandomEmail + SendMailFactory SendMailDialerFactory + func (c CheckerStruct) Validate(mxs MXs, input Input) (errs []error) + type CheckerWithRandomRCPT interface + type DefaultError struct + type DialFunc func(ctx context.Context, addr, proxyURL string) (smtpclient.SMTPClient, error) + type Error interface + Stage func() SendMailStage + Unwrap func() error + func NewError(stage SendMailStage, err error) Error + type FuncLookupMX func(domain string) (MXs, error) + type Input interface + Email func() evmail.Address + func NewInput(email evmail.Address, opts Options) Input + type InputStruct struct + EmailAddress evmail.Address + func (i *InputStruct) Email() evmail.Address + type MXs = []*net.MX + func LookupMX(domain string) (MXs, error) + type Options interface + EmailFrom func() evmail.Address + HelloName func() string + Port func() int + Proxy func() string + TimeoutConnection func() time.Duration + TimeoutResponse func() time.Duration + func DefaultOptions() Options + func EmptyOptions() Options + func NewOptions(dto OptionsDTO) Options + type OptionsDTO struct + EmailFrom evmail.Address + HelloName string + Port int + Proxy string + TimeoutCon time.Duration + TimeoutResp time.Duration + type OptionsStruct struct + EmailFromOption evmail.Address + HelloNameOption string + PortOption int + ProxyOption string + TimeoutConOption time.Duration + TimeoutRespOption time.Duration + func (i *OptionsStruct) EmailFrom() evmail.Address + func (i *OptionsStruct) HelloName() string + func (i *OptionsStruct) Port() int + func (i *OptionsStruct) Proxy() string + func (i *OptionsStruct) TimeoutConnection() time.Duration + func (i *OptionsStruct) TimeoutResponse() time.Duration + type RandomCacheKeyGetter func(email evmail.Address) interface + type RandomEmail func(domain string) (evmail.Address, error) + type RandomRCPT interface + Call func(sm SendMail, email evmail.Address) []error + Get func() RandomRCPTFunc + Set func(fn RandomRCPTFunc) + type RandomRCPTFunc func(sm SendMail, email evmail.Address) (errs []error) + type SafeSendMailStage struct + func (s *SafeSendMailStage) Get() SendMailStage + func (s *SafeSendMailStage) Set(val SendMailStage) + type SendMail interface + Auth func(a smtp.Auth) error + Client func() smtpclient.SMTPClient + Close func() error + Data func() (io.WriteCloser, error) + Hello func(helloName string) error + Mail func(from string) error + Quit func() error + RCPTs func(addrs []string) map[string]error + Write func(w io.WriteCloser, msg []byte) error + func NewSendMail(client smtpclient.SMTPClient, tlsConfig *tls.Config) SendMail + type SendMailDialerFactory func(ctx context.Context, host string, opts Options) (SendMail, error) + func NewSendMailCustom(dialFunc DialFunc, tlsConfig *tls.Config, factory SendMailFactory) SendMailDialerFactory + func NewSendMailFactory(dialFunc DialFunc, tlsConfig *tls.Config) SendMailDialerFactory + type SendMailFactory func(client smtpclient.SMTPClient, tlsConfig *tls.Config) SendMail + type SendMailStage uint8 + const AuthStage + const ClientStage + const CloseStage + const HelloStage + const MailStage + const QuitStage + const RCPTsStage + type SendMailStruct struct + SMTPClient smtpclient.SMTPClient + TLSConfig *tls.Config + func (s *SendMailStruct) Auth(a smtp.Auth) error + func (s *SendMailStruct) Client() smtpclient.SMTPClient + func (s *SendMailStruct) Close() error + func (s *SendMailStruct) Data() (io.WriteCloser, error) + func (s *SendMailStruct) Hello(helloName string) error + func (s *SendMailStruct) Mail(from string) error + func (s *SendMailStruct) Quit() error + func (s *SendMailStruct) RCPTs(addrs []string) map[string]error + func (s *SendMailStruct) Write(w io.WriteCloser, msg []byte) error