Versions in this module Expand all Collapse all v0 v0.4.0 Aug 11, 2026 Changes in this version + func IsValidSMTPUTF8(input string) bool type Email + func (e *Email) IsValidSMTPUTF8() bool + func (e *Email) ValidateSyntaxSMTPUTF8() error v0.3.0 Aug 11, 2026 Changes in this version + var ErrInvalidPunycode = errors.New("emailx: invalid punycode label") + func AllDisposableDomains() iter.Seq[string] + func AllProviders() iter.Seq[*Provider] + func DisposableDomains() []string + func ProviderCount() int + func ProviderDomainCount() int + func ProviderDomains() []string type Provider + func ProviderByID(id string) *Provider + func ProviderForDomain(domain string) *Provider + func Providers() []*Provider v0.2.0 Aug 11, 2026 v0.1.0 Aug 11, 2026 Changes in this version + const DefaultCacheSize + var CommonDKIMSelectors = []string + var ErrDomainTooLong = errors.New("emailx: domain too long") + var ErrEmpty = errors.New("emailx: empty input") + var ErrInvalidDomain = errors.New("emailx: invalid domain") + var ErrInvalidLocalPart = errors.New("emailx: invalid local part") + var ErrInvalidSyntax = errors.New("emailx: invalid syntax") + var ErrInvalidTLD = errors.New("emailx: invalid top-level domain") + var ErrInvalidUnicode = errors.New("emailx: invalid unicode") + var ErrLocalPartTooLong = errors.New("emailx: local part too long") + var MinCacheTTL = 30 * time.Second + func DefaultTimeout() time.Duration + func DisposableDomainCount() int + func HasDKIM(domain, selector string) bool + func HasDKIMContext(ctx context.Context, domain, selector string) bool + func HasDMARC(domain string) bool + func HasDMARCContext(ctx context.Context, domain string) bool + func HasDNSSEC(domain string) bool + func HasDNSSECContext(ctx context.Context, domain string) bool + func HasMX(domain string) bool + func HasMXContext(ctx context.Context, domain string) bool + func HasSPF(domain string) bool + func HasSPFContext(ctx context.Context, domain string) bool + func IsDisposableDomain(domain string) bool + func IsValid(input string) bool + func Normalize(input string) (string, error) + func NormalizeMany(inputs []string) []string + func SetDefaultTimeout(d time.Duration) + func SetResolver(r Resolver) + func Unique(inputs []string) []string + func ValidateMany(inputs []string, opts ...BatchOptions) map[string]ValidationResult + type BIMIInfo struct + Enabled bool + LogoURL string + Raw string + VMC string + Version string + func BIMI(domain string) *BIMIInfo + func BIMIContext(ctx context.Context, domain string) *BIMIInfo + func HasBIMI(domain string) *BIMIInfo + func HasBIMIContext(ctx context.Context, domain string) *BIMIInfo + type BatchOptions struct + Concurrency int + func WithConcurrency(n int) BatchOptions + type CachingResolver struct + func EnableCache(ttl time.Duration) *CachingResolver + func NewCachingResolver(next Resolver, ttl time.Duration) *CachingResolver + func (c *CachingResolver) Len() int + func (c *CachingResolver) LookupMX(ctx context.Context, domain string) ([]*net.MX, error) + func (c *CachingResolver) LookupTXT(ctx context.Context, name string) ([]string, error) + func (c *CachingResolver) Purge() + func (c *CachingResolver) SetMaxSize(n int) + type DKIM struct + Errors []string + Flags []string + Found bool + HashAlgos []string + KeyType string + PublicKey string + Raw string + Revoked bool + Selector string + Tags map[string]string + Testing bool + Version string + func LookupDKIM(domain string, selectors ...string) *DKIM + func LookupDKIMContext(ctx context.Context, domain string, selectors ...string) *DKIM + func LookupDKIMSelector(domain, selector string) *DKIM + func LookupDKIMSelectorContext(ctx context.Context, domain, selector string) *DKIM + type DMARC struct + DKIMAlignment DMARCAlignment + Errors []string + Found bool + Percent int + Policy DMARCPolicy + RUA []string + RUF []string + Raw string + SPFAlignment DMARCAlignment + SubdomainPolicy DMARCPolicy + Tags map[string]string + Version string + func LookupDMARC(domain string) *DMARC + func LookupDMARCContext(ctx context.Context, domain string) *DMARC + func (d *DMARC) IsEnforcing() bool + type DMARCAlignment string + const AlignmentRelaxed + const AlignmentStrict + type DMARCPolicy string + const DMARCNone + const DMARCQuarantine + const DMARCReject + type DNSInfo struct + DKIM *DKIM + DMARC *DMARC + Domain string + MX []MXRecord + MXErr error + SPF *SPF + func LookupDNSInfo(domain string, selectors ...string) DNSInfo + func LookupDNSInfoContext(ctx context.Context, domain string, selectors ...string) DNSInfo + func (d DNSInfo) HasMX() bool + func (d DNSInfo) IsProtected() bool + type Deliverability struct + CatchAll bool + DKIM bool + DMARC bool + DMARCEnforcing bool + Disposable bool + MX bool + Reasons []string + SMTP bool + SPF bool + SPFBroken bool + SPFStrict bool + Score int + type DomainHealth struct + BIMI bool + DKIM bool + DMARC bool + DNS DNSInfo + DNSSEC bool + Domain string + MTASTS bool + MX bool + SPF bool + TLSRPT bool + func CheckDomainHealth(domain string, selectors ...string) *DomainHealth + func CheckDomainHealthContext(ctx context.Context, domain string, selectors ...string) *DomainHealth + func (h *DomainHealth) Protected() bool + type Email struct + func Parse(input string) (*Email, error) + func ParseAddress(input string) (*Email, error) + func ParseMany(inputs []string) []*Email + func (e *Email) Address() string + func (e *Email) BIMI() *BIMIInfo + func (e *Email) BIMIContext(ctx context.Context) *BIMIInfo + func (e *Email) BaseLocalPart() string + func (e *Email) Country() string + func (e *Email) DKIM(selectors ...string) *DKIM + func (e *Email) DKIMContext(ctx context.Context, selectors ...string) *DKIM + func (e *Email) DMARC() *DMARC + func (e *Email) DMARCContext(ctx context.Context) *DMARC + func (e *Email) DNSInfo(selectors ...string) DNSInfo + func (e *Email) DNSInfoContext(ctx context.Context, selectors ...string) DNSInfo + func (e *Email) Deliverability() *Deliverability + func (e *Email) DeliverabilityContext(ctx context.Context) *Deliverability + func (e *Email) DisposableProvider() string + func (e *Email) Domain() string + func (e *Email) DomainASCII() (string, error) + func (e *Email) DomainHealth(selectors ...string) *DomainHealth + func (e *Email) DomainHealthContext(ctx context.Context, selectors ...string) *DomainHealth + func (e *Email) DomainName() string + func (e *Email) DomainSimilarity(target string) float64 + func (e *Email) DomainUnicode() (string, error) + func (e *Email) Equal(other *Email) bool + func (e *Email) EqualExact(other *Email) bool + func (e *Email) EqualNormalized(other *Email) bool + func (e *Email) Fingerprint(opts ...FingerprintOptions) string + func (e *Email) HasDKIM(selector string) bool + func (e *Email) HasDKIMContext(ctx context.Context, selector string) bool + func (e *Email) HasDMARC() bool + func (e *Email) HasDMARCContext(ctx context.Context) bool + func (e *Email) HasDNSSEC() bool + func (e *Email) HasDNSSECContext(ctx context.Context) bool + func (e *Email) HasDot() bool + func (e *Email) HasMX() bool + func (e *Email) HasMXContext(ctx context.Context) bool + func (e *Email) HasPlusTag() bool + func (e *Email) HasSPF() bool + func (e *Email) HasSPFContext(ctx context.Context) bool + func (e *Email) HashSHA256() string + func (e *Email) HashSHA512() string + func (e *Email) IsDisposable() bool + func (e *Email) IsFree() bool + func (e *Email) IsPossible() bool + func (e *Email) IsRole() bool + func (e *Email) IsRoleWithPrefixes(prefixes ...string) bool + func (e *Email) IsValid() bool + func (e *Email) LocalPart() string + func (e *Email) MTASTS() *MTASTSInfo + func (e *Email) MTASTSContext(ctx context.Context) *MTASTSInfo + func (e *Email) MX() ([]MXRecord, error) + func (e *Email) MXContext(ctx context.Context) ([]MXRecord, error) + func (e *Email) Mask(opts ...MaskOptions) string + func (e *Email) Normalize() + func (e *Email) PlusTag() string + func (e *Email) Provider() *Provider + func (e *Email) ProviderID() string + func (e *Email) Risk() *Risk + func (e *Email) RiskContext(ctx context.Context) *Risk + func (e *Email) SPF() *SPF + func (e *Email) SPFContext(ctx context.Context) *SPF + func (e *Email) Scan(value interface{}) error + func (e *Email) String() string + func (e *Email) Subdomain() string + func (e *Email) Suggestion() string + func (e *Email) TLD() string + func (e *Email) TLSRPT() *TLSRPTInfo + func (e *Email) TLSRPTContext(ctx context.Context) *TLSRPTInfo + func (e *Email) UnmarshalJSON(data []byte) error + func (e *Email) UnmarshalText(text []byte) error + func (e *Email) Validate() ValidationResult + func (e *Email) ValidateDomain() error + func (e *Email) ValidateSyntax() error + func (e *Email) VerifySMTP(opts ...SMTPOptions) *SMTPResult + func (e *Email) VerifySMTPContext(ctx context.Context, opts ...SMTPOptions) *SMTPResult + func (e Email) MarshalJSON() ([]byte, error) + func (e Email) MarshalText() ([]byte, error) + func (e Email) Value() (driver.Value, error) + type EmailIndex struct + func NewIndex() *EmailIndex + func (idx *EmailIndex) Add(e *Email) + func (idx *EmailIndex) Exists(input string) bool + func (idx *EmailIndex) FindByDomain(domain string) []*Email + func (idx *EmailIndex) FindByProvider(providerID string) []*Email + type EmailSet struct + func NewSet() *EmailSet + func (s *EmailSet) Add(input string) error + func (s *EmailSet) ByDomain(domain string) []*Email + func (s *EmailSet) Len() int + type ErrorCode string + const ErrorCodeDomainTooLong + const ErrorCodeEmpty + const ErrorCodeInvalidDomain + const ErrorCodeInvalidLocalPart + const ErrorCodeInvalidSyntax + const ErrorCodeInvalidTLD + const ErrorCodeInvalidUnicode + const ErrorCodeLocalPartTooLong + type FingerprintOptions struct + Secret string + func WithSecret(secret string) FingerprintOptions + type Limiter interface + Wait func(ctx context.Context) error + type MTASTSInfo struct + Enabled bool + Raw string + func HasMTASTS(domain string) *MTASTSInfo + func HasMTASTSContext(ctx context.Context, domain string) *MTASTSInfo + func MTASTS(domain string) *MTASTSInfo + func MTASTSContext(ctx context.Context, domain string) *MTASTSInfo + type MXRecord struct + Host string + Priority uint16 + func LookupMX(domain string) ([]MXRecord, error) + func LookupMXContext(ctx context.Context, domain string) ([]MXRecord, error) + type MaskOptions struct + LocalPrefix int + LocalSuffix int + MaskChar rune + type ParseError struct + Code ErrorCode + Input string + Position int + func (e *ParseError) Error() string + type Profile struct + Address string + BIMI *BIMIInfo + DKIM bool + DMARC bool + DNS DNSInfo + DNSSEC bool + Deliverability *Deliverability + Disposable bool + Domain string + Free bool + LocalPart string + MTASTS *MTASTSInfo + MX bool + Protected bool + Provider *Provider + Risk *Risk + Role bool + SPF bool + Suggestion string + TLSRPT *TLSRPTInfo + Valid bool + func Analyze(input string) (*Profile, error) + func AnalyzeContext(ctx context.Context, input string) (*Profile, error) + type Provider struct + Domains []string + Free bool + ID string + Name string + type RateLimiter struct + func NewRateLimiter(perSecond float64, burst int) *RateLimiter + func (l *RateLimiter) Wait(ctx context.Context) error + type Resolver interface + LookupMX func(ctx context.Context, domain string) ([]*net.MX, error) + LookupTXT func(ctx context.Context, name string) ([]string, error) + func CurrentResolver() Resolver + func NewResolver(addr string, timeout time.Duration) Resolver + type Risk struct + Level RiskLevel + Score int + Signals []Signal + type RiskLevel string + const RiskHigh + const RiskLow + const RiskMedium + type SMTPOptions struct + FromAddress string + HelloName string + Limiter Limiter + Port string + SkipCatchAllCheck bool + Timeout time.Duration + type SMTPResult struct + CatchAll bool + Code int + Duration time.Duration + Err error + Greylisted bool + MXHost string + Message string + STARTTLS bool + Status SMTPStatus + func VerifySMTP(address string, opts ...SMTPOptions) *SMTPResult + func VerifySMTPContext(ctx context.Context, address string, opts ...SMTPOptions) *SMTPResult + type SMTPStatus string + const SMTPCatchAll + const SMTPInvalid + const SMTPUnknown + const SMTPValid + type SPF struct + All SPFQualifier + Errors []string + Found bool + Includes []string + Lookups int + Mechanisms []SPFMechanism + Modifiers map[string]string + Raw string + TooManyLookups bool + Version string + func LookupSPF(domain string) *SPF + func LookupSPFContext(ctx context.Context, domain string) *SPF + func (s *SPF) IsStrict() bool + type SPFMechanism struct + Name string + Qualifier SPFQualifier + Value string + func (m SPFMechanism) String() string + type SPFQualifier string + const SPFFail + const SPFNeutral + const SPFPass + const SPFSoftFail + type Signal struct + Description string + Impact int + type TLSRPTInfo struct + Enabled bool + RUAs []string + Raw string + func HasTLSRPT(domain string) *TLSRPTInfo + func HasTLSRPTContext(ctx context.Context, domain string) *TLSRPTInfo + func TLSRPT(domain string) *TLSRPTInfo + func TLSRPTContext(ctx context.Context, domain string) *TLSRPTInfo + type TTLResolver interface + LookupMXTTL func(ctx context.Context, domain string) ([]*net.MX, time.Duration, error) + LookupTXTTTL func(ctx context.Context, name string) ([]string, time.Duration, error) + func NewDNSResolver(addr string, timeout time.Duration) TTLResolver + type ValidationResult struct + DMARCValid bool + Disposable bool + DomainValid bool + MXValid bool + Role bool + SPFValid bool + SyntaxValid bool + Valid bool