Documentation
¶
Index ¶
Constants ¶
const ( // Signals a positive delivery action. EnhancedStatusCodeClassSuccess int = 2 // Signals that there is a temporary failure in positively delivery action. EnhancedStatusCodeClassPersistentTransientFailure int = 4 // Signals that there is a permanent failure in the delivery action. EnhancedStatusCodeClassPermanentFailure int = 5 )
const ( // ReplyCodeSystemStatus is the status code for the system status. ReplyCodeSystemStatus = 211 // ReplyCodeHelpMessage is the status code for the help message. ReplyCodeHelpMessage = 214 // ReplyCodeServiceReady is the status code for the service ready. ReplyCodeServiceReady = 220 // ReplyCodeServiceClosing is the status code for the service closing. ReplyCodeServiceClosing = 221 // ReplyCodeAuthenticationSuccessful is the status code for the authentication successful. ReplyCodeMailActionOkay = 250 // ReplyCodeUserNotLocal is the status code for the user not local. ReplyCodeMailActionCompleted = 250 // ReplyCodeCannotVerifyUser is the status code for the cannot verify user. ReplyCodeUserNotLocal = 251 // ReplyCodeStartMailInput is the status code for the start mail input. ReplyCodeCannotVerifyUser = 252 ReplyCodeStartMailInput = 354 ReplyCodeServiceNotAvailable = 421 ReplyCodeLocalError = 451 ReplyCodeInsufficientStorage = 452 ReplyCodeSyntaxError = 500 ReplyCodeSyntaxErrorInParameters = 501 ReplyCodeCommandNotImplemented = 502 ReplyCodeCommandBadSequence = 503 ReplyCodeCommandParameterNotImplemented = 504 ReplyCodeRequestActionNotTaken = 550 ReplyCodeUserNotLocalForThisHost = 551 ReplyCodeRequestedActionAborted = 552 ReplyCodeRequestedActionNotTaken = 553 ReplyCodeTransactionFailed = 554 ReplyCodeMailFromOrRcptToError = 555 )
const (
Network = "tcp"
)
Variables ¶
This section is empty.
Functions ¶
func ErrorFromStatus ¶
func ErrorFromStatus(s *StatusCode) error
ErrorFromStatus returns an error from a status code.
Types ¶
type EnhancedMailSystemStatusCode ¶
type EnhancedMailSystemStatusCode [3]int
EnhancedMailSystemStatusCode ... https://datatracker.ietf.org/doc/html/rfc3463
var EnhancedStatusCodeUnknown EnhancedMailSystemStatusCode = EnhancedMailSystemStatusCode{-1, -1, -1}
EnhancedStatusCodeUnknown is the default value for the enhanced status code.
func (EnhancedMailSystemStatusCode) String ¶ added in v0.5.9
func (e EnhancedMailSystemStatusCode) String() string
String returns the string representation of the enhanced status code.
type EnhancedStatusCode ¶
type EnhancedStatusCode [3]int
EnhancedStatusCode is a data structure to contain enhanced mail system status codes from RFC 3463 (https://datatracker.ietf.org/doc/html/rfc3463).
func (EnhancedStatusCode) Class ¶ added in v0.5.9
func (e EnhancedStatusCode) Class() int
Class returns the class of the enhanced status code.
func (EnhancedStatusCode) Detail ¶ added in v0.5.9
func (e EnhancedStatusCode) Detail() int
Detail returns the detail of the enhanced status code.
func (EnhancedStatusCode) Subject ¶ added in v0.5.9
func (e EnhancedStatusCode) Subject() int
Subject returns the subject of the enhanced status code.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an error as defined in RFC 5321.
type Header ¶ added in v0.5.9
type Header string
Header ...
const Bcc Header = "Bcc"
Bcc ...
const Cc Header = "Cc"
Cc ...
const Date Header = "Date"
Date ...
const From Header = "From"
From ...
const ReplyTo Header = "Reply-To"
ReplyTo ...
const Subject Header = "Subject"
Subject ...
const To Header = "To"
To ...
type Message ¶ added in v0.5.9
type Message struct { // ID ... ID string `json:"id" yaml:"id"` // Headers ... Headers map[Header][]string `json:"headers" yaml:"headers"` }
Message ...
type Session ¶ added in v0.5.8
type Session struct { // Text is the textproto.Conn of the connection. Text *textproto.Conn sync.Mutex // contains filtered or unexported fields }
Session ...
type StatusCode ¶
type StatusCode struct {
// contains filtered or unexported fields
}
StatusCode is a status code as defined in RFC 5321.
func NewStatusCode ¶ added in v0.5.9
func NewStatusCode(replyCode ReplyCode, enhancedCode EnhancedMailSystemStatusCode, message string) *StatusCode
NewStatusCode returns a new status code.
func (*StatusCode) Clone ¶ added in v0.5.9
func (s *StatusCode) Clone() *StatusCode
Clone returns a clone of the status code.
func (*StatusCode) EnhancedStatusCode ¶
func (s *StatusCode) EnhancedStatusCode() EnhancedMailSystemStatusCode
EnhancedStatusCode returns the enhanced status code.
func (*StatusCode) ReplyCode ¶
func (s *StatusCode) ReplyCode() int
ReplyCode returns the reply code.
func (*StatusCode) Reset ¶ added in v0.5.9
func (s *StatusCode) Reset()
Reset resets the status code.
type Verb ¶ added in v0.5.9
type Verb string
Verb is a command verb of SMTP.
const ( // HELO is the SMTP verb for HELO. HELO Verb = "HELO" // EHLO is the SMTP verb for EHLO. EHLO Verb = "EHLO" // MAIL is the SMTP verb for MAIL. MAIL Verb = "MAIL" // RCPT is the SMTP verb for RCPT. RCPT Verb = "RCPT" // DATA is the SMTP verb for DATA. DATA Verb = "DATA" // QUI is the SMTP verb for QUIT. QUIT Verb = "QUIT" // RSET is the SMTP verb for RSET. RSET Verb = "RSET" // NOOP is the SMTP verb for NOOP. NOOP Verb = "NOOP" // HELP is the SMTP verb for HELP. HELP Verb = "HELP" // STARTTLS is the SMTP verb for STARTTLS. STARTTLS Verb = "STARTTLS" // AUTH is the SMTP verb for AUTH. AUTH Verb = "AUTH" )