Documentation ¶
Index ¶
- Constants
- Variables
- func CheckDisposable(checkEmail 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 CheckWithContext(ctx context.Context, fromEmail, checkEmail string) (result Result, err error)
- type ResultState
Constants ¶
const ( ValidState ResultState = "valid" InvalidState = "invalid" ErrorState = "error" )
Variables ¶
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", "The email is a throw-away address."} 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."} )
var DisposableDomains = map[string]bool{}/* 1559 elements not displayed */
DisposableDomains is a list of fake mail providers. The list was taken from https://github.com/andreis/disposable License: MIT Last updated: Sa 4. Mär 21:33:31 CET 2017
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 CheckWithContext ¶
type ResultState ¶
type ResultState string
func (ResultState) String ¶
func (rs ResultState) String() string