helo

package module
v0.0.0-...-25b06d9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2015 License: MIT Imports: 12 Imported by: 0

README

#helo a discarding stmp/s server.

helo represents the full helo smtp spec and portions ehlo (extended spec). It discards all incoming commands, while sending the correct response.

for use as a benchmarking/testing server.

DOCS LICENSE

Documentation

Index

Constants

View Source
const (
	MaxMessageSize = 32 << 20 // 32 mb

	// smtp
	CommandHelo = "HELO"
	CommandMail = "MAIL"
	CommandRcpt = "RCPT"
	CommandData = "DATA"
	CommandRset = "RSET"
	CommandSend = "SEND"
	CommandSoml = "SOML"
	CommandSaml = "SAML"
	CommandVrfy = "VRFY"
	CommandExpn = "EXPN"
	CommandHelp = "HELP"
	CommandNoop = "NOOP"
	CommandQuit = "QUIT"
	CommandTurn = "TURN"

	// esmtp
	CommandEhlo       = "EHLO"
	Command8bitmime   = "8BITMIME"
	CommandAtrn       = "ATRN"
	CommandAuth       = "AUTH"
	CommandChunking   = "CHUNKING"
	CommandDsn        = "DSN"
	CommandEtrn       = "ETRN"
	CommandPipelining = "PIPELINING"
	CommandSize       = "SIZE"
	CommandStarttls   = "STARTTLS"
	CommandSmtputf8   = "SMTPUTF8"
)

Variables

View Source
var (
	BadSyntaxError   = errors.New("bad syntax error")
	MessageSizeError = errors.New("max message size exceeded")
)
View Source
var (
	AlreadyRunningError = errors.New("helo already running")
)

Functions

This section is empty.

Types

type Reader

type Reader struct {
	*bufio.Reader
	// contains filtered or unexported fields
}

func (*Reader) ReadCommand

func (r *Reader) ReadCommand() (string, string, error)

func (*Reader) ReadData

func (r *Reader) ReadData() (string, error)

type Reply

type Reply int
const (
	ReplySystemReply                                         Reply = 211
	ReplyHelpMessage                                         Reply = 214
	ReplyServiceReady                                        Reply = 220
	ReplyServiceClosingTransmissionChannel                   Reply = 221
	ReplyOk                                                  Reply = 250
	ReplyUserNotLocalWillForwardTo                           Reply = 251
	ReplyStartMailInputEndWith                               Reply = 354
	ReplyServiceNotAvailable                                 Reply = 421
	ReplyRequestedMailActionNotTakenMailboxUnavailable       Reply = 450
	ReplyRequestedActionAbortedInProcessing                  Reply = 451
	ReplyRequestedActionNotTakenInsufficientSystemStorage    Reply = 452
	ReplySyntaxErrorCommandUnrecognized                      Reply = 500
	ReplySyntaxErrorInParametersOrArguments                  Reply = 501
	ReplyCommandNotImplemented                               Reply = 502
	ReplyBadSequenceOfCommands                               Reply = 503
	ReplyCommandParameterNotImplemented                      Reply = 504
	ReplyRequestedActionNotTakenMailboxUnavailable           Reply = 550
	ReplyUserNotLocalPleaseTry                               Reply = 551
	ReplyRequestedMailActionAbortedExceededStorageAllocation Reply = 552
	ReplyRequestedActionNotTakenMailboxNameNotAllowed        Reply = 553
	ReplyTransactionFailed                                   Reply = 554
)

type SmtpServer

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

func NewSmtpServer

func NewSmtpServer(host string) *SmtpServer

func (*SmtpServer) SetLogger

func (s *SmtpServer) SetLogger(logger *log.Logger)

func (*SmtpServer) Start

func (s *SmtpServer) Start() error

func (*SmtpServer) Stop

func (s *SmtpServer) Stop()

type SmtpsServer

type SmtpsServer struct {
	*SmtpServer
	// contains filtered or unexported fields
}

func NewSmtpsServer

func NewSmtpsServer(host, cert, key string) *SmtpsServer

func (*SmtpsServer) Start

func (s *SmtpsServer) Start() error

type Writer

type Writer struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*Writer) WriteContinuedReply

func (w *Writer) WriteContinuedReply(code Reply, message string, args ...interface{}) error

func (*Writer) WriteReply

func (w *Writer) WriteReply(code Reply, message string, args ...interface{}) error

func (*Writer) WriteReplyCode

func (w *Writer) WriteReplyCode(code Reply, args ...interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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