smtpd

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server holds the configuration and state of our SMTP server

func NewServer

func NewServer(
	cfg config.SMTPConfig,
	globalShutdown chan bool,
	ds datastore.DataStore,
	msgHub *msghub.Hub) *Server

NewServer creates a new Server instance with the specificed config

func (*Server) Drain

func (s *Server) Drain()

Drain causes the caller to block until all active SMTP sessions have finished

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Start the listener and handle incoming connections

type Session

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

Session holds the state of an SMTP session

func NewSession

func NewSession(server *Server, id int, conn net.Conn) *Session

NewSession creates a new Session for the given connection

func (*Session) String

func (ss *Session) String() string

type State

type State int

State tracks the current mode of our SMTP state machine

const (
	// GREET State: Waiting for HELO
	GREET State = iota
	// READY State: Got HELO, waiting for MAIL
	READY
	// MAIL State: Got MAIL, accepting RCPTs
	MAIL
	// DATA State: Got DATA, waiting for "."
	DATA
	// QUIT State: Client requested end of session
	QUIT
)

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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