smtp

package
v0.9.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBanned returned to banned hosts
	ErrBanned = &smtp.SMTPError{
		Code:         554,
		EnhancedCode: smtp.EnhancedCode{5, 5, 4},
		Message:      "please, don't bother me anymore, kupo.",
	}
	// ErrNoUser returned when no such mailbox found
	ErrNoUser = &smtp.SMTPError{
		Code:         550,
		EnhancedCode: smtp.EnhancedCode{5, 5, 0},
		Message:      "no such user here, kupo.",
	}
)

Functions

This section is empty.

Types

type Caller added in v0.9.10

type Caller interface {
	SetSendmail(func(string, string, string) error)
}

Caller is Sendmail caller

type Config added in v0.9.1

type Config struct {
	Domains []string
	Port    string

	TLSCerts    []string
	TLSKeys     []string
	TLSPort     string
	TLSRequired bool

	LogLevel string
	MaxSize  int
	Bot      matrixbot
	Callers  []Caller
}

type Listener added in v0.9.9

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

Listener that rejects connections from banned hosts

func NewListener added in v0.9.9

func NewListener(actual net.Listener, isBanned func(net.Addr) bool, log *logger.Logger) *Listener

func (*Listener) Accept added in v0.9.9

func (l *Listener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener.

func (*Listener) Addr added in v0.9.9

func (l *Listener) Addr() net.Addr

Addr returns the listener's network address.

func (*Listener) Close added in v0.9.9

func (l *Listener) Close() error

Close closes the listener. Any blocked Accept operations will be unblocked and return errors.

type Manager added in v0.9.9

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

func NewManager added in v0.9.9

func NewManager(cfg *Config) *Manager

NewManager creates new SMTP server manager

func (*Manager) Start added in v0.9.9

func (m *Manager) Start() error

Start SMTP server

func (*Manager) Stop added in v0.9.9

func (m *Manager) Stop()

Stop SMTP server

Jump to

Keyboard shortcuts

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