Documentation
¶
Index ¶
- Variables
- func CheckDisposable(email string) bool
- func CheckSyntax(checkEmail string) bool
- type Result
- func Check(fromEmail, checkEmail string) (result Result, err error)
- func CheckMailbox(fromEmail, checkEmail string) (result Result, err error)
- func CheckMailboxWithContext(ctx context.Context, fromEmail, checkEmail string) (result Result, err error)
- func CheckSyntaxAndBad(checkEmail string) (result Result, err error)
- func CheckWithContext(ctx context.Context, fromEmail, checkEmail string) (result Result, err error)
- type ResultState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Valid = Result{ValidState, "mailboxChecked", "The email address is valid."} InvalidSyntax = Result{InvalidState, "invalidSyntax", "The email format is invalid."} InvalidDomain = Result{InvalidState, "invalidDomain", "The email domain does not exist."} Disposable = Result{InvalidState, "disposable", "You cannot use disposable email addresses."} MailserverError = Result{ErrorState, "mailserverError", "The target mailserver responded with an error."} TimeoutError = Result{ErrorState, "timeoutError", "The connection with the mailserver timed out."} NetworkError = Result{ErrorState, "networkError", "The connection to the mailserver could not be made."} ServiceError = Result{ErrorState, "serviceError", "An internal error occured while checking."} ClientError = Result{ErrorState, "clientError", "The request was was invalid."} )
View Source
var DisposableDomains = map[string]bool{}/* 3929 elements not displayed */
Functions ¶
func CheckDisposable ¶
CheckDisposable returns true if the mail is a disposal mail, false otherwise
func CheckSyntax ¶
CheckSyntax returns true for a valid email, false otherwise
Types ¶
type Result ¶
type Result struct { Result ResultState `json:"result"` ResultDetail string `json:"resultDetail"` Message string `json:"message"` }
Result contains the information about an email check.
func Check ¶
Check checks the syntax and if valid, it checks the mailbox by connecting to the target mailserver The fromEmail is used as from address in the communication to the foreign mailserver.
func CheckMailbox ¶
CheckMailbox checks the checkEmail by connecting to the target mailbox and returns the result. The fromEmail is used as from address in the communication to the foreign mailserver.
func CheckMailboxWithContext ¶
func CheckSyntaxAndBad ¶
Check checks the syntax and if valid and checks the bad domain list does not do mailbox checking - an RP tweak
func CheckWithContext ¶
type ResultState ¶
type ResultState string
const ( ValidState ResultState = "valid" InvalidState ResultState = "invalid" ErrorState ResultState = "error" )
func (ResultState) String ¶
func (rs ResultState) String() string
Click to show internal directories.
Click to hide internal directories.