Documentation ¶
Index ¶
Constants ¶
const ( ErrUnexpectedResponse = "Unexpected response from deliverabler" // Standard Errors ErrTimeout = "The connection to the mail server has timed out" ErrNoSuchHost = "Mail server does not exist" ErrBlocked = "Blocked by mail server" // RCPT Errors ErrTryAgainLater = "Try again later" ErrFullInbox = "Recipient out of disk space" ErrTooManyRCPT = "Too many recipients" ErrNoRelay = "Not an open relay" ErrMailboxBusy = "Mailbox busy" ErrExceededMessagingLimits = "Messaging limits have been exceeded" ErrNotAllowed = "Not Allowed" ErrNeedMAILBeforeRCPT = "Need MAIL before RCPT" ErrRCPTHasMoved = "Recipient has moved" )
Variables ¶
var ErrNoAtChar = errors.New("No '@' character found on email address")
ErrNoAtChar is thrown when no '@' character is found on an email address
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct{ Address, Username, Domain, MD5Hash string }
Address stores all information about an email Address
func ParseAddress ¶
ParseAddress attempts to parse an email address and return it in the form of an Address struct pointer - domain case insensitive
type Deliverabler ¶
type Deliverabler struct {
// contains filtered or unexported fields
}
Deliverabler contains the context and smtp.Client needed to check email address deliverability
func NewDeliverabler ¶
func NewDeliverabler(domain, hostname, sourceAddr string, timeout time.Duration, maxAttempts int) (*Deliverabler, error)
NewDeliverabler generates a new Deliverabler reference
func (*Deliverabler) Close ¶
func (d *Deliverabler) Close()
Close closes the Deliverablers SMTP client connection
func (*Deliverabler) HasCatchAll ¶
func (d *Deliverabler) HasCatchAll(retry int) bool
HasCatchAll checks the deliverability of a randomly generated address in order to verify the existence of a catch-all
func (*Deliverabler) IsDeliverable ¶
func (d *Deliverabler) IsDeliverable(email string, maxAttempts int) error
IsDeliverable takes an email address and performs the operation of adding the email to the envelope. It also receives the maximum number of retries to reconnect to the MX server before erring out. If a 250 is received the email is valid
type LookupError ¶
type LookupError struct { Message string `json:"message" xml:"message"` Details string `json:"details" xml:"details"` }
LookupError is an error
func ParseSMTPError ¶
func ParseSMTPError(err error) *LookupError
ParseSMTPError receives an MX Servers response message and generates the cooresponding MX error
func (*LookupError) Error ¶
func (e *LookupError) Error() string
Error satisfies the error interface
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier contains all dependencies needed to perform educated email verification lookups
func NewVerifier ¶
NewVerifier generates a new Verifier using the passed hostname and source email address