smtp

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: MIT Imports: 19 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(
	smtpConfig config.SMTP,
	globalShutdown chan bool,
	manager message.Manager,
	apolicy *policy.Addressing,
) *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 {
	*Server // Server this session belongs to.
	// contains filtered or unexported fields
}

Session holds the state of an SMTP session

func NewSession

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

NewSession creates a new Session for the given connection

func (*Session) String

func (s *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