verifier

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: BSD-3-Clause Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrUnexpectedResponse = "Unexpected response from deliverabler"

	// Standard Errors
	ErrTimeout           = "The connection to the mail server has timed out"
	ErrNoSuchHost        = "Mail server does not exist"
	ErrServerUnavailable = "Mail server is unavailable"
	ErrBlocked           = "Blocked by mail server"
	ErrSPF               = "SPF Error"

	// 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

View Source
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

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

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) (*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, retry int) error

IsDeliverable takes an email address and performs the operation of adding the email to the envelope. It also receives a number of retries to reconnect to the MX server before erring out. If a 250 is received the email is valid

type Disposabler

type Disposabler struct {
	// contains filtered or unexported fields
}

Disposabler contains the map of known disposable email domains

func NewDisposabler

func NewDisposabler() *Disposabler

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

func (*Disposabler) IsDisposable

func (d *Disposabler) IsDisposable(domain string) bool

IsDisposable tests whether a string is among the known set of disposable mailbox domains. Returns true if the address is disposable

type Lookup

type Lookup struct {
	Address
	ValidFormat, Deliverable, FullInbox, HostExists, CatchAll, Disposable bool
	ErrorDetails                                                          string
}

Lookup contains all output data for an email verification Lookup

type LookupError

type LookupError struct {
	Message string `json:"message" xml:"message"`
	Details string `json:"details" xml:"details"`
	Fatal   bool   `json:"fatal" xml:"fatal"`
}

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

func NewVerifier(hostname, sourceAddr string) *Verifier

NewVerifier generates a new Verifier using the passed hostname and source email address

func (*Verifier) Verify

func (v *Verifier) Verify(email string) (*Lookup, error)

Verify performs an email verification on the passed email address

Jump to

Keyboard shortcuts

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