Versions in this module Expand all Collapse all v0 v0.0.1 Jul 20, 2026 Changes in this version + var ErrClosed = errors.New("emailvalidator: closed") + var ErrReputationDisabled = errors.New("emailvalidator: reputation store is not configured") + func GenericWebhook(recorder ReputationRecorder, cfg GenericWebhookConfig) http.Handler + func IsFreeProviderDomain(domain string) bool + func IsRoleAccountLocal(local string) bool + func MailgunWebhook(recorder ReputationRecorder, cfg MailgunWebhookConfig) http.Handler + func PostmarkWebhook(recorder ReputationRecorder, cfg PostmarkWebhookConfig) http.Handler + func SESWebhook(recorder ReputationRecorder, cfg SESWebhookConfig) http.Handler + func SendGridWebhook(recorder ReputationRecorder, cfg SendGridWebhookConfig) http.Handler + type AddressOptions struct + AllowDomainLiteral bool + AllowQuotedLocal bool + AllowSMTPUTF8 bool + DomainMapper DomainMapper + type BulkItem struct + Email string + Error string + Index int + Result Result + type BulkOptions struct + ContinueOnError bool + Deduplicate bool + OnProgress func(BulkProgress) + Ordered bool + PerItemTimeout time.Duration + ProgressEvery int + QueueSize int + Workers int + type BulkProgress struct + Completed int + Duplicates int + Elapsed time.Duration + Failed int + RatePerSecond float64 + Submitted int + Total int + Unique int + type BulkResult struct + Duplicates int + Duration time.Duration + Failed int + Items []BulkItem + RatePerSecond float64 + Succeeded int + Total int + Unique int + Verdicts map[Verdict]int + type CatchAllStatus string + const CatchAllNo + const CatchAllNotChecked + const CatchAllUnknown + const CatchAllYes + type Config struct + Address AddressOptions + CheckDNS bool + DNS *DNSChecker + Disposable *DisposableDetector + FreeProviderDetector func(domain string) bool + Now func() time.Time + Observer Observer + Reputation ReputationStore + RoleAccountDetector func(local string) bool + SMTP *SMTPChecker + Scorer Scorer + func DefaultConfig() Config + type DNSChecker struct + CacheSize int + NegativeTTL time.Duration + PositiveTTL time.Duration + Resolver DNSResolver + Timeout time.Duration + func NewDNSChecker() *DNSChecker + func (d *DNSChecker) Check(ctx context.Context, domain string, literal bool) DNSResult + type DNSResolver interface + LookupIP func(context.Context, string, string) ([]net.IP, error) + LookupMX func(context.Context, string) ([]*net.MX, error) + type DNSResult struct + Duration time.Duration + Error string + HasA bool + HasAAAA bool + ImplicitMX bool + MX []MXRecord + NullMX bool + Status Status + type DisposableDetector struct + func NewDisposableDetector() *DisposableDetector + func (d *DisposableDetector) Count() int + func (d *DisposableDetector) IsDisposable(domain string) bool + func (d *DisposableDetector) ReplaceBlocklist(r io.Reader) error + func (d *DisposableDetector) SetAllowlist(domains []string) error + type DomainMapper interface + ToASCII func(string) (string, error) + type FileReputationOptions struct + BreakStaleLockAfter time.Duration + CompactAfterRecords uint64 + IdempotencyRetention time.Duration + MaxLogBytes int64 + Path string + Pepper []byte + SyncWrites bool + type FileReputationStore struct + func OpenFileReputationStore(opts FileReputationOptions) (*FileReputationStore, error) + func (s *FileReputationStore) Close() error + func (s *FileReputationStore) Compact() error + func (s *FileReputationStore) Lookup(ctx context.Context, email, domain string) (ReputationStats, error) + func (s *FileReputationStore) Record(ctx context.Context, e ReputationEvent) error + type GenericWebhookConfig struct + MaxBodyBytes int64 + MaxClockSkew time.Duration + Secret []byte + type MXRecord struct + Host string + Pref uint16 + type MailboxStatus string + const MailboxAcceptAll + const MailboxBlocked + const MailboxDisabled + const MailboxDoesNotExist + const MailboxExists + const MailboxFull + const MailboxNotChecked + const MailboxTemporarilyUnavailable + const MailboxUnknown + type MailgunWebhookConfig struct + MaxBodyBytes int64 + MaxClockSkew time.Duration + SigningKey []byte + type MemoryReputationStore struct + func NewMemoryReputationStore(pepper []byte) (*MemoryReputationStore, error) + func (s *MemoryReputationStore) Close() error + func (s *MemoryReputationStore) Lookup(ctx context.Context, email, domain string) (ReputationStats, error) + func (s *MemoryReputationStore) Record(ctx context.Context, e ReputationEvent) error + type Observer interface + ValidationCompleted func(context.Context, Result) + type PostmarkWebhookConfig struct + BasicPassword string + BasicUser string + MaxBodyBytes int64 + Token string + TokenHeader string + type Reason struct + Code string + Message string + Weight int + type ReputationEvent struct + At time.Time + Domain string + Email string + ID string + Type ReputationEventType + type ReputationEventType string + const EventComplaint + const EventDeferred + const EventDelivered + const EventHardBounce + const EventSoftBounce + const EventUnsubscribe + type ReputationRecorder interface + RecordReputationEvent func(context.Context, ReputationEvent) error + type ReputationStats struct + Complaints uint64 + Deferred uint64 + Delivered uint64 + HardBounces uint64 + LastEventAt time.Time + Score int + SoftBounces uint64 + Unsubscribes uint64 + type ReputationStore interface + Close func() error + Lookup func(context.Context, string, string) (ReputationStats, error) + Record func(context.Context, ReputationEvent) error + type Result struct + CheckedAt time.Time + DNS DNSResult + Disposable bool + Duration time.Duration + FreeProvider bool + Input string + Normalized string + Reasons []Reason + Reputation ReputationStats + RiskScore int + RoleAccount bool + SMTP SMTPResult + Syntax SyntaxResult + Verdict Verdict + type SESWebhookConfig struct + AllowedTopicARNs []string + HTTPClient *http.Client + MaxBodyBytes int64 + MaxClockSkew time.Duration + type SMTPChecker struct + Dialer SMTPDialer + IPResolver SMTPIPResolver + Options SMTPOptions + func NewSMTPChecker(opts SMTPOptions) *SMTPChecker + func (s *SMTPChecker) Check(ctx context.Context, address, domain string, dns DNSResult, smtpUTF8 bool) SMTPResult + type SMTPDialer interface + DialContext func(context.Context, string, string) (net.Conn, error) + type SMTPIPResolver interface + LookupIPAddr func(context.Context, string) ([]net.IPAddr, error) + type SMTPOptions struct + AllowPrivateIPs bool + CatchAllSamples int + CatchAllTTL time.Duration + CatchAllUnknownTTL time.Duration + DisableCatchAll bool + Enabled bool + HELODomain string + InsecureSkipVerify bool + MailFrom string + MaxConcurrent int + MaxMXAttempts int + MaxResponseBytes int + MinDomainInterval time.Duration + NegativeTTL time.Duration + Port int + PositiveTTL time.Duration + RequireTLS bool + TLSConfig *tls.Config + Timeout time.Duration + TrySTARTTLS bool + UnknownTTL time.Duration + func DefaultSMTPOptions() SMTPOptions + type SMTPResult struct + Attempts int + Cached bool + CatchAll CatchAllStatus + Code int + Duration time.Duration + EnhancedCode string + Error string + Host string + Mailbox MailboxStatus + Message string + Status Status + TLS bool + type Scorer interface + Score func(*Result) + type ScorerFunc func(*Result) + func (f ScorerFunc) Score(r *Result) + type SendGridWebhookConfig struct + MaxBodyBytes int64 + MaxClockSkew time.Duration + PublicKeyBase64 string + type Status string + const StatusFail + const StatusNotChecked + const StatusPass + const StatusUnknown + type SyntaxResult struct + Domain string + DomainLiteral bool + Error string + Local string + Normalized string + SMTPUTF8 bool + Status Status + func ValidateSyntax(input string, opts AddressOptions) SyntaxResult + type ValidationError struct + Code string + Msg string + func (e *ValidationError) Error() string + type Validator struct + func New(cfg Config) *Validator + func NewDefault() *Validator + func (v *Validator) Close() error + func (v *Validator) RecordReputation(ctx context.Context, email string, typ ReputationEventType, at time.Time) error + func (v *Validator) RecordReputationEvent(ctx context.Context, event ReputationEvent) error + func (v *Validator) Validate(ctx context.Context, input string) (Result, error) + func (v *Validator) ValidateBulk(ctx context.Context, emails []string, opts BulkOptions) (BulkResult, error) + func (v *Validator) ValidateMany(ctx context.Context, emails []string, workers int) ([]Result, error) + func (v *Validator) ValidateStream(ctx context.Context, input <-chan string, opts BulkOptions) <-chan BulkItem + type Verdict string + const VerdictDeliverable + const VerdictRisky + const VerdictUndeliverable + const VerdictUnknown + type WebhookResponse struct + Accepted int + Errors []string + Ignored int