pop3

package
v3.1.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 15 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 defines an instance of the POP3 server.

func NewServer

func NewServer(pop3Config config.POP3, store storage.Store) (*Server, error)

NewServer creates a new, unstarted, POP3 server.

func (*Server) Drain

func (s *Server) Drain()

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

func (*Server) Notify

func (s *Server) Notify() <-chan error

Notify allows the running POP3 server to be monitored for a fatal error.

func (*Server) Start

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

Start the server and listen for connections

type Session

type Session struct {
	*Server // Reference to the server we belong to.
	// contains filtered or unexported fields
}

Session defines an active POP3 session

func NewSession

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

NewSession creates a new POP3 session

func (*Session) String

func (s *Session) String() string

type State

type State int

State tracks the current mode of our POP3 state machine

const (
	// AUTHORIZATION state: the client must now identify and authenticate
	AUTHORIZATION State = iota
	// TRANSACTION state: mailbox open, client may now issue commands
	TRANSACTION
	// QUIT state: client requests us to end 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