emailvalid

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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."}
	MailboxUnavailable = Result{InvalidState, "mailboxUnavailable", "The email username 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

func CheckDisposable(email string) bool

CheckDisposable returns true if the mail is a disposal mail, false otherwise

func CheckSyntax

func CheckSyntax(checkEmail string) bool

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

func Check(fromEmail, checkEmail string) (result Result, err error)

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

func CheckMailbox(fromEmail, checkEmail string) (result Result, err error)

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 CheckMailboxWithContext(ctx context.Context, fromEmail, checkEmail string) (result Result, err error)

func CheckSyntaxAndBad

func CheckSyntaxAndBad(checkEmail string) (result Result, err error)

Check checks the syntax and if valid and checks the bad domain list does not do mailbox checking - an RP tweak

func CheckWithContext

func CheckWithContext(ctx context.Context, fromEmail, checkEmail string) (result Result, err error)

func (Result) IsError

func (r Result) IsError() bool

func (Result) IsInvalid

func (r Result) IsInvalid() bool

func (Result) IsValid

func (r Result) IsValid() bool

type ResultState

type ResultState string
const (
	ValidState   ResultState = "valid"
	InvalidState ResultState = "invalid"
	ErrorState   ResultState = "error"
)

func (ResultState) String

func (rs ResultState) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL