smtp

package
v0.0.0-...-f39c8f6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	END_DATA_COMMAND_SEQUENCE         = ".\r\n"
	END_DATA_INVALID_COMMAND_SEQUENCE = "\n\n.\n"
)
View Source
const (
	COMMANDACTION_CONTINUE = CommandAction(1)
	COMMANDACTION_EXIT     = CommandAction(2)
	COMMANDACTION_NONE     = CommandAction(3)
)
View Source
const (
	SMTP_SESSION_STATE_INVALID = SmtpSessionState(iota)
	SMTP_SESSION_STATE_PREAUTH
	SMTP_SESSION_STATE_AUTHOK
	SMTP_SESSION_STATE_MAIL
	SMTP_SESSION_STATE_RCPT
	SMTP_SESSION_STATE_DATA
	SMTP_SESSION_STATE_SUBMIT
	SMTP_SESSION_STATE_CLOSED
)
View Source
const (
	SMTP_COMMAND_STATUS_NONE                     = SmtpCommandStatus(0)
	SMTP_COMMAND_STATUS_SERVICE_READY            = SmtpCommandStatus(220)
	SMTP_COMMAND_STATUS_MAIL_ACTION_OK           = SmtpCommandStatus(250)
	SMTP_COMMAND_STATUS_SERVICE_CLOSING_CHANNEL  = SmtpCommandStatus(221)
	SMTP_COMMAND_STATUS_START_MAIL_INPUT         = SmtpCommandStatus(354)
	SMTP_COMMAND_STATUS_REQUESTED_ACTION_ABORTED = SmtpCommandStatus(451)
	SMTP_COMMAND_STATUS_COMMAND_NOT_IMPLEMENTED  = SmtpCommandStatus(502)
	SMTP_COMMAND_STATUS_BAD_COMMAND_SEQUENCE     = SmtpCommandStatus(503)
)
View Source
const (
	SMTP_COMMAND_MAIL = SmtpCommandVerb("MAIL")

	SMTP_COMMAND_RCPT = SmtpCommandVerb("RCPT")
	SMTP_COMMAND_DATA = SmtpCommandVerb("DATA")
	SMTP_COMMAND_DONE = SmtpCommandVerb("QUIT")
)
View Source
const (
	SESSION_DATA_KEY_CLIENT_ID = "client_id"
	SESSION_DATA_KEY_MAIL_TO   = "to"
	SESSION_DATA_KEY_MAIL_FROM = "from"
	SESSION_DATA_KEY_BUFFER    = "buffer"
)
View Source
const (
	SMTP_CHANNEL_MESSAGE_QUEUE_SUBMIT = iota
)
View Source
const (
	SMTP_SERVER_BUILD_STRING = "Milhaux SMTP Server"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelMessageType

type ChannelMessageType uint8

type CommandAction

type CommandAction uint16

func (CommandAction) String

func (s CommandAction) String() string

type CommandResponse

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

type SmtpCommandProcessor

type SmtpCommandProcessor struct {
}

func NewCommandProcessor

func NewCommandProcessor() SmtpCommandProcessor

func (*SmtpCommandProcessor) HandleCommand

func (s *SmtpCommandProcessor) HandleCommand(smtpSession *SmtpSession, commandLine string) CommandResponse

type SmtpCommandStatus

type SmtpCommandStatus uint16

func (SmtpCommandStatus) String

func (s SmtpCommandStatus) String() string

type SmtpCommandVerb

type SmtpCommandVerb string

func (SmtpCommandVerb) String

func (s SmtpCommandVerb) String() string

type SmtpServer

type SmtpServer interface {
	Start() error

	ObtainListenerChannel() chan SmtpServerChannelMessage
	// contains filtered or unexported methods
}

func NewSmtpServer

func NewSmtpServer(config *common.ApplicationConfig) SmtpServer

type SmtpServerChannelMessage

type SmtpServerChannelMessage struct {
	MessageType ChannelMessageType
	Data        *common.MailMessage
}

type SmtpServer_impl

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

func (*SmtpServer_impl) ObtainListenerChannel

func (s *SmtpServer_impl) ObtainListenerChannel() chan SmtpServerChannelMessage

func (*SmtpServer_impl) Start

func (s *SmtpServer_impl) Start() error

type SmtpSession

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

func NewSmtpSession

func NewSmtpSession(serverInstance SmtpServer_impl, conn net.Conn, messageChannel chan SmtpServerChannelMessage) *SmtpSession

type SmtpSessionState

type SmtpSessionState uint8

func (SmtpSessionState) String

func (s SmtpSessionState) String() string

Jump to

Keyboard shortcuts

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