Documentation
¶
Index ¶
- Constants
- type Command
- type CommandName
- type ConversationState
- type Protocol
- func (protocol *Protocol) EHLO(command *Command) *Reply
- func (protocol *Protocol) HELO(command *Command) *Reply
- func (protocol *Protocol) HandleReceivedLine(receivedLine string) *Reply
- func (protocol *Protocol) MAIL(command *Command) *Reply
- func (protocol *Protocol) ParseFROM(mail string) (string, error)
- func (protocol *Protocol) ParseRCPT(mail string) (string, error)
- func (protocol *Protocol) RCPT(command *Command) *Reply
- func (protocol *Protocol) RSET(command *Command) *Reply
- func (protocol *Protocol) SayHi(identification string) *Reply
- type Reply
- func ReplyAuthCredentials(response string) *Reply
- func ReplyAuthFailed() *Reply
- func ReplyAuthOk() *Reply
- func ReplyBye() *Reply
- func ReplyCommandNotImplemented() *Reply
- func ReplyExceededStorage(response string) *Reply
- func ReplyLineTooLong() *Reply
- func ReplyMailData() *Reply
- func ReplyMailbox404(response string) *Reply
- func ReplyOk(message ...string) *Reply
- func ReplyServiceReady(identification string) *Reply
- func ReplyUnrecognisedCommand() *Reply
- type Scene
- type Validation
Constants ¶
View Source
const ( COMMAND_HELO = CommandName("HELO") COMMAND_EHLO = CommandName("EHLO") COMMAND_AUTH = CommandName("AUTH") COMMAND_MAIL = CommandName("MAIL") COMMAND_RSET = CommandName("RSET") COMMAND_RCPT = CommandName("RCPT") COMMAND_DATA = CommandName("DATA") COMMAND_QUIT = CommandName("QUIT") )
RSET
View Source
const ( STATE_CONVERSATION = ConversationState("conversation") STATE_WAITING_AUTH = ConversationState("waiting_auth") STATE_DATA = ConversationState("data") STATE_CUSTOM_SCENE = ConversationState("custom_scene") )
View Source
const ( CODE_SYSTEM_STATUS = 211 CODE_HELP_MESSAGE = 214 CODE_SERVICE_READY = 220 CODE_SERVICE_CLOSING = 221 CODE_AUTHENTICATION_SUCCESS = 235 CODE_ACTION_OK = 250 CODE_USER_IS_NOT_LOCAL = 251 // will forward to <forward-path> CODE_USER_NOT_VERIFIED = 252 CODE_AUTH_CREDENTIALS = 334 CODE_MAIL_DATA = 354 CODE_SERVICE_NOT_AVAILABLE = 421 CODE_MAILBOX_UNAVAILABLE = 450 CODE_LOCAL_ERROR = 451 CODE_EXCEEDED_SYSTEM_STORAGE = 452 CODE_COMMAND_SYNTAX_ERROR = 500 CODE_PARAMETER_SYNTAX_ERROR = 501 CODE_COMMAND_NOT_IMPLEMENTED = 502 CODE_COMMANDS_BAD_SEQUENCE = 503 CODE_PARAMETER_NOT_IMPLEMENTED = 504 CODE_AUTH_FAILED = 535 CODE_MAILBOX_404 = 550 CODE_USER_NOT_LOCAL = 551 // please try <forward-path> CODE_EXCEEDED_STORAGE = 552 CODE__MAILBOX_NAME_INCORRECT = 553 CODE_TRANSACTION_FAILED = 554 )
View Source
const COMMAND_END_SYMBOL = "\r\n"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a struct representing an SMTP command (verb + arguments)
func CommandFromLine ¶
type CommandName ¶
type CommandName string
type ConversationState ¶
type ConversationState string
type Protocol ¶
type Protocol struct {
Hostname string
State ConversationState
Message *dto.SMTPMessage
AuthenticationMechanismsCallback func() []string
MessageReceivedCallback func(message *dto.SMTPMessage) (string, error)
CreateCustomSceneCallback func(sceneName string) Scene
// contains filtered or unexported fields
}
func CreateProtocol ¶
func CreateProtocol(hostname string, validation *Validation) *Protocol
func (*Protocol) HandleReceivedLine ¶
type Reply ¶
type Reply struct {
Status int
// contains filtered or unexported fields
}
Reply is a struct representing an SMTP reply (status code + lines)
func ReplyAuthCredentials ¶
ReplyAuthCredentials creates reply with a 334 code and requests a username
func ReplyAuthFailed ¶
func ReplyAuthFailed() *Reply
ReplyAuthFailed creates reply with auth failed response
func ReplyCommandNotImplemented ¶
func ReplyCommandNotImplemented() *Reply
func ReplyExceededStorage ¶
func ReplyLineTooLong ¶
func ReplyLineTooLong() *Reply
ReplyLineTooLong due to exceeding these limits
func ReplyMailData ¶
func ReplyMailData() *Reply
func ReplyMailbox404 ¶
func ReplyServiceReady ¶
ReplyServiceReady creates a welcome reply
func ReplyUnrecognisedCommand ¶
func ReplyUnrecognisedCommand() *Reply
type Validation ¶
Click to show internal directories.
Click to hide internal directories.