Documentation ¶
Index ¶
- Constants
- Variables
- func FormatReply(r Reply) string
- func IsSuccess(r Reply) bool
- func LastLine(r Reply) string
- type Client
- func (c *Client) Get(key string) interface{}
- func (c *Client) GetBool(key string) bool
- func (c *Client) GetString(key string) string
- func (c *Client) GetStringSlice(key string) []string
- func (c *Client) MakeReader()
- func (c *Client) Receive() (Command, error)
- func (c *Client) ResetData()
- func (c *Client) SaveData()
- func (c *Client) Send(r Reply)
- func (c *Client) Set(key string, value interface{})
- type Command
- type Reply
- type SessionState
- type StatusCode
Constants ¶
View Source
const ( Ignore StatusCode = -1 Ready = 220 Closing = 221 AuthenticationSuccessful = 235 Ok = 250 StartAuth = 334 StartSending = 354 LocalError = 451 CommandSyntaxError = 500 ArgumentSyntaxError = 501 BadSequence = 503 CommandNotImplemented = 504 AuthenticationRequired = 530 AuthenticationInvalid = 535 TransactionFailed = 554 )
Variables ¶
View Source
var ( RxDomain *regexp.Regexp = regexp.MustCompile(`^([a-zA-Z0-9]{1}[a-zA-Z0-9_-]{1,62}){1}(\.[a-zA-Z0-9]{1}[a-zA-Z0-9_-]{1,62})+$`) RxIP *regexp.Regexp = regexp.MustCompile("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$") RxEmailAddress *regexp.Regexp = regexp.MustCompile("^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\\])$") )
View Source
var Extensions []string = []string{
"PIPELINING",
"8BITMIME",
}
packages should append() during init()
Functions ¶
func FormatReply ¶
Types ¶
type Client ¶
type Client struct { Conn net.Conn ID string State SessionState Rdr *bufio.ReadWriter Data map[string]interface{} // contains filtered or unexported fields }
func (*Client) GetStringSlice ¶
func (*Client) MakeReader ¶
func (c *Client) MakeReader()
type Reply ¶
type Reply struct { Result StatusCode Message string }
type SessionState ¶
type SessionState int
const ( Any SessionState = iota Connected Identified //after EHLO before MAIL ReceivingHeaders //after MAIL before/during RCPT ReceivingBody //after DATA Disconnected )
type StatusCode ¶
type StatusCode int
Click to show internal directories.
Click to hide internal directories.