recipient

package
v0.0.0-...-6618439 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: BSD-3-Clause Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inst

func Inst() common.SendingService

Types

type BaseState

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

func (BaseState) Check

func (b BaseState) Check(line []byte, cmd []byte, cmdLen int) bool

func (BaseState) GetError

func (b BaseState) GetError() *StateError

func (BaseState) GetId

func (b BaseState) GetId() uint

func (BaseState) GetNext

func (b BaseState) GetNext() State

func (BaseState) GetPossibles

func (b BaseState) GetPossibles() []State

func (BaseState) IsUseCurrent

func (b BaseState) IsUseCurrent() bool

func (BaseState) Read

func (b BaseState) Read(conn *textproto.Conn) []byte

func (*BaseState) SetEvent

func (b *BaseState) SetEvent(event *Event)

func (*BaseState) SetId

func (b *BaseState) SetId(id uint)

func (*BaseState) SetNext

func (b *BaseState) SetNext(next State)

func (*BaseState) SetPossibles

func (b *BaseState) SetPossibles(possibles []State)

type Code

type Code int
const (
	StatusCode              Code = 211
	HelpCode                Code = 214
	ReadyCode               Code = 220
	CloseCode               Code = 221
	CompleteCode            Code = 250
	ForwardCode             Code = 251
	AttemptDeliveryCode     Code = 252
	StartInputCode          Code = 354
	NotAvailableCode        Code = 421
	MailboxUnavailableCode  Code = 450
	AbortedCode             Code = 451
	NotTakenCode            Code = 452
	UnableAcceptParamsCode  Code = 455
	SyntaxErrorCode         Code = 500
	SyntaxParamErrorCode    Code = 501
	NotImplementedCode      Code = 502
	BadSequenceCode         Code = 503
	ParamNotImplementedCode Code = 504
	UserNotFoundCode        Code = 550
	UserNotLocalCode        Code = 551
	ExceededStorageCode     Code = 552
	NameNotAllowedCode      Code = 553
	TransactionFailedCode   Code = 554
	ParamsNotRecognizedCode Code = 555
)

func (Code) GetFormattedName

func (c Code) GetFormattedName() string

func (Code) GetName

func (c Code) GetName() string

type Config

type Config struct {
	ListenerCount int    `yaml:"listenerCount"`
	Inbox         string `yaml:"inbox"`
	MxHostnames   []string
}

type ConnectState

type ConnectState struct {
	BaseState
}

func (*ConnectState) GetCmd

func (c *ConnectState) GetCmd() ([]byte, int)

func (*ConnectState) Process

func (c *ConnectState) Process(line []byte) StateStatus

func (*ConnectState) Read

func (c *ConnectState) Read(conn *textproto.Conn) []byte

func (*ConnectState) Write

func (c *ConnectState) Write(conn *textproto.Conn)

type DataState

type DataState struct {
	BaseState
}

func (*DataState) GetCmd

func (d *DataState) GetCmd() ([]byte, int)

func (*DataState) Process

func (d *DataState) Process(line []byte) StateStatus

func (*DataState) Write

func (d *DataState) Write(conn *textproto.Conn)

type EhloState

type EhloState struct {
	BaseState
	// contains filtered or unexported fields
}

func (*EhloState) Check

func (e *EhloState) Check(line []byte, cmd []byte, cmdLen int) bool

func (*EhloState) GetCmd

func (e *EhloState) GetCmd() ([]byte, int)

func (*EhloState) Process

func (e *EhloState) Process(line []byte) StateStatus

func (*EhloState) Write

func (e *EhloState) Write(conn *textproto.Conn)

type Event

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

type InputState

type InputState struct {
	BaseState
}

func (*InputState) GetCmd

func (i *InputState) GetCmd() ([]byte, int)

func (*InputState) Process

func (i *InputState) Process(line []byte) StateStatus

func (*InputState) Read

func (i *InputState) Read(conn *textproto.Conn) []byte

func (*InputState) Write

func (i *InputState) Write(conn *textproto.Conn)

type MailState

type MailState struct {
	BaseState
}

func (*MailState) GetCmd

func (m *MailState) GetCmd() ([]byte, int)

func (*MailState) Process

func (m *MailState) Process(line []byte) StateStatus

func (*MailState) Write

func (m *MailState) Write(conn *textproto.Conn)

type NoopState

type NoopState struct {
	BaseState
}

func (*NoopState) GetCmd

func (n *NoopState) GetCmd() ([]byte, int)

func (NoopState) IsUseCurrent

func (n NoopState) IsUseCurrent() bool

func (*NoopState) Process

func (n *NoopState) Process(line []byte) StateStatus

func (*NoopState) Write

func (n *NoopState) Write(conn *textproto.Conn)

type QuitState

type QuitState struct {
	BaseState
}

func (*QuitState) GetCmd

func (q *QuitState) GetCmd() ([]byte, int)

func (*QuitState) Process

func (q *QuitState) Process(line []byte) StateStatus

func (*QuitState) Write

func (q *QuitState) Write(conn *textproto.Conn)

type RcptState

type RcptState struct {
	BaseState
}

func (*RcptState) GetCmd

func (r *RcptState) GetCmd() ([]byte, int)

func (*RcptState) Process

func (r *RcptState) Process(line []byte) StateStatus

func (*RcptState) Write

func (r *RcptState) Write(conn *textproto.Conn)

type Recipient

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

type RsetState

type RsetState struct {
	BaseState
}

func (*RsetState) GetCmd

func (r *RsetState) GetCmd() ([]byte, int)

func (*RsetState) Process

func (r *RsetState) Process(line []byte) StateStatus

func (*RsetState) Write

func (r *RsetState) Write(conn *textproto.Conn)

type Service

type Service struct {
	Configs map[string]*Config `yaml:"postmans"`
}

func (*Service) Events

func (s *Service) Events() chan *common.SendEvent

func (*Service) OnFinish

func (s *Service) OnFinish()

func (*Service) OnInit

func (s *Service) OnInit(event *common.ApplicationEvent)

func (*Service) OnRun

func (s *Service) OnRun()

type State

type State interface {
	SetEvent(*Event)
	GetNext() State
	SetNext(State)
	GetPossibles() []State
	SetPossibles([]State)
	Read(*textproto.Conn) []byte
	Process([]byte) StateStatus
	Write(*textproto.Conn)
	GetId() uint
	SetId(uint)
	IsUseCurrent() bool
	GetCmd() ([]byte, int)
	Check([]byte, []byte, int) bool
	GetError() *StateError
}

type StateError

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

type StateStatus

type StateStatus int
const (
	FailureStatus StateStatus = iota + 1
	ReadStatus
	WriteStatus
	PossibleStatus
	QuitStatus
)

type StateStatuses

type StateStatuses chan StateStatus

func (StateStatuses) Add

func (s StateStatuses) Add(status StateStatus)

type VrfyState

type VrfyState struct {
	BaseState
}

func (*VrfyState) GetCmd

func (v *VrfyState) GetCmd() ([]byte, int)

func (VrfyState) IsUseCurrent

func (v VrfyState) IsUseCurrent() bool

func (*VrfyState) Process

func (v *VrfyState) Process(line []byte) StateStatus

func (*VrfyState) Write

func (v *VrfyState) Write(conn *textproto.Conn)

Jump to

Keyboard shortcuts

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