Documentation
¶
Overview ¶
Package emailaddr checks and classifies email addresses for the audience and the importer: syntax, role addresses, disposable domains, likely typos, spam-trap-like patterns, mailbox providers and masking.
Index ¶
- Constants
- Variables
- func Check(s string) (string, string)
- func Domain(email string) string
- func HostingFromMX(host string) string
- func InboxLink(email, sender string) (name, link string, ok bool)
- func IsDisposable(domain string) bool
- func IsRole(email string) bool
- func Local(email string) string
- func MailboxKey(email string) string
- func MailboxName(key string) string
- func MailboxProvider(domain string) string
- func Mask(email string) string
- func Normalize(s string) string
- func TrapLike(email string) bool
- func TypoFix(domain string) (string, bool)
- func Valid(s string) bool
Constants ¶
const ( ProblemNoDomain = "no domain" ProblemDoubleDot = "double dot" ProblemNotAnAddress = "not an address" ProblemTooLong = "too long" )
Problems returned by Check. They are short phrases shown next to the raw value in import previews and reports.
const ( Gmail = "gmail" Outlook = "outlook" Yahoo = "yahoo" ICloud = "icloud" Other = "other" )
Mailbox providers, in the order the charts use.
const ( HostGoogleWorkspace = "Google Workspace" HostMicrosoft365 = "Microsoft 365" HostOutlookCom = "Outlook.com" HostYahoo = "Yahoo Mail" HostICloud = "iCloud Mail" )
Hosting names of company domains whose mail a mailbox provider filters.
Variables ¶
MailboxProviders lists the keys in chart order.
Functions ¶
func Check ¶
Check normalizes s and reports why it isn't a deliverable address, or "" when the syntax is fine. It does not look up DNS.
func HostingFromMX ¶
HostingFromMX names the hosting of a domain from one of its MX hosts: "Google Workspace", "Microsoft 365", "Fastmail", "Proton", "Zoho Mail". A host counts only when it is the provider's domain or one of its subdomains: anyone can name their MX mx.evilgoogle.com or mx.xyahoodns.net, and their domain must not pass for Gmail's or Yahoo's.
func InboxLink ¶
InboxLink is the web mail app of a consumer address, to open after a signup ("Open Gmail"): the provider's name (never translated) and an address that searches for mail from sender where the app can, else opens the inbox. ok is false for other domains, company ones included, and for AOL addresses (Yahoo filters their mail, but mail.yahoo.com doesn't sign them in).
func IsDisposable ¶
IsDisposable reports whether domain belongs to a temporary-inbox service.
func MailboxKey ¶
MailboxKey folds the addresses that reach the same mailbox: it normalizes the address, drops a plus tag and the dots of a Gmail address, and reads googlemail.com as gmail.com. Sam.Rivera+news@gmail.com and samrivera@googlemail.com give the same key.
func MailboxName ¶
MailboxName is the display name of a mailbox provider key.
func MailboxProvider ¶
MailboxProvider classifies a consumer domain into the mailbox provider that filters its mail. Company domains hosted by a mailbox provider (Google Workspace, Microsoft 365) stay "other" here; internal/mailbox classifies them from their MX records (see HostingFromMX).
func TrapLike ¶
TrapLike reports addresses that look like spam traps: honeypot local parts and catch-all scraper patterns. HostRepute knows real trap networks; this is the offline heuristic.
Types ¶
This section is empty.