smtp

package
v0.0.0-...-74f1e5b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = &smtp.SMTPError{
	Code:         541,
	EnhancedCode: smtp.EnhancedCode{5, 4, 1},
	Message:      "Your message has been detected and labeled as spam. You must ask the recipient to whitelist you.",
}

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager of SMTP proxy

func New

func New(
	backends []string,
	tarpit time.Duration,
	enforce validator.Enforce,
	dkim bool,
	q *queue.Queue,
	maxSize int,
	tlsCerts,
	tlsKeys []string,
	log *logger.Logger,
) *Manager

New proxy manager

func (*Manager) Start

func (m *Manager) Start(port string) error

Start server

func (*Manager) Stop

func (m *Manager) Stop()

Stop the server

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(
	addr net.Addr,
	username string,
	password string,
	tarpit time.Duration,
	enforce validator.Enforce,
	dkim bool,
	ping func() bool,
	send func(*queue.Item) error,
	enqueue func(*queue.Item) error,
	log *logger.Logger,
) *Session

NewSession creates new a new SMTP session

func (*Session) Data

func (s *Session) Data(r io.Reader) error

func (*Session) Logout

func (s *Session) Logout() error

func (*Session) Mail

func (s *Session) Mail(from string, opts smtp.MailOptions) error

func (*Session) Rcpt

func (s *Session) Rcpt(to string) error

func (*Session) Reset

func (s *Session) Reset()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL