verifier

package
v0.0.0-...-c1adc34 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTryAgainLater      = errors.New("Try again later")
	ErrNoSuchRCPT         = errors.New("No such recipient")
	ErrFullInbox          = errors.New("Recipient out of disk space")
	ErrTooManyRCPT        = errors.New("Too many recipients")
	ErrNoRelay            = errors.New("Not an open relay")
	ErrMailboxBusy        = errors.New("Mailbox busy")
	ErrNeedMAILBeforeRCPT = errors.New("Need MAIL before RCPT")
	ErrRCPTHasMoved       = errors.New("Recipient has moved")
)

Functions

func HasGravatar

func HasGravatar(a *Address) bool

HasGravatar performs an http HEAD request to check if the email is associated with a gravatar account

Types

type Address

type Address struct{ Username, Domain, Address string }

Address stores all information about an email Address

func ParseAddress

func ParseAddress(email string) (*Address, error)

ParseAddress attempts to parse an email address and return it in the form of an Address struct pointer

func (*Address) MD5

func (a *Address) MD5() string

MD5 takes a calculation of the md5 Hash and returns a string representation

type Deliverabler

type Deliverabler interface {
	IsDeliverable(email string, retry int) error
	HasCatchAll(domain string, retry int) bool
	Close()
}

Deliverabler defines all functionality for checking an email addresses deliverability

func NewDeliverabler

func NewDeliverabler(domain, host, sourceAddr string) (Deliverabler, error)

NewDeliverabler generates a new Deliverabler

type Disposabler

type Disposabler interface {
	IsDisposable(domain string) bool
}

Disposabler defines all functionality for checking if an email address is disposable

func NewDisposabler

func NewDisposabler() Disposabler

NewDisposabler creates a new Disposabler and starts a domain farmer that retrieves all known disposable domains periodically

type Lookup

type Lookup struct {
	XMLName      xml.Name `json:"-" xml:"lookup"`
	Address      string   `json:"address,omitempty" xml:"address,omitempty"`
	Username     string   `json:"username,omitempty" xml:"username,omitempty"`
	Domain       string   `json:"domain,omitempty" xml:"domain,omitempty"`
	HostExists   bool     `json:"hostExists" xml:"hostExists"`
	Deliverable  bool     `json:"deliverable" xml:"deliverable"`
	FullInbox    bool     `json:"fullInbox" xml:"fullInbox"`
	CatchAll     bool     `json:"catchAll" xml:"catchAll"`
	Disposable   bool     `json:"disposable" xml:"disposable"`
	Gravatar     bool     `json:"gravatar" xml:"gravatar"`
	Error        string   `json:"error,omitempty" xml:"error,omitempty"`
	ErrorDetails string   `json:"errorDetails,omitempty" xml:"errorDetails,omitempty"`
}

Lookup contains all output data for an email validation Lookup

type Verifier

type Verifier interface {
	Verify(emails ...string) []*Lookup
}

Verifier defines all functionality for fully validating email addresses

func NewVerifier

func NewVerifier(maxWorkerCount int, hostname, sourceAddr string) Verifier

NewVerifier generates a new AddressVerifier reference

Jump to

Keyboard shortcuts

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