smtp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidError = errors.New("Invalid SMTP envelope")

Functions

func Serve

func Serve(listen, domain string, backend Backend) error

Types

type Backend

type Backend struct {
	Db           db.DB
	FromRe       *regexp.Regexp
	ShutdownChan chan struct{}
	To           string
	Dkim         string
	Delegate     bool
	LocalDkim    bool
}

The Backend implements SMTP server methods.

func (*Backend) NewSession

func (bkd *Backend) NewSession(c *smtp.Conn) (smtp.Session, error)

NewSession is called after client greeting (EHLO, HELO).

type Session

type Session struct {
	Backend *Backend
	From    *string
}

A Session is returned after successful login.

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, opts *smtp.RcptOptions) 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