emails-import
importRefreshes the free and disposable email domain lists the crate embeds, data/free-domains.txt and data/disposable-domains.txt, from their sources, and reports statistics about them.
cargo run -p utopia-emails --bin emails-import -- disposable --commit=true
cargo run -p utopia-emails --bin emails-import -- statsAn update fetches every source of the list (or the one --source names),
keeps the domains that parse with a known name and suffix and are not test
domains, merges them with the manual list (data/*-domains-manual.txt),
removes duplicates and sorts them. It only previews the changes unless
--commit=true is given, and stops early when nothing changed unless
--force=true is. A source that fails is reported and skipped. Rebuild
the crate after a commit: the lists are embedded at compile time.
Commands
disposableupdate the disposable domains from the manual list, martenson (disposable-email-domains), disposable, wesbos, fakefilter and adamloving.
freeupdate the free domains from the manual list and kikobeats.
alldisposable, then free, both from every source.
statscount the domains of both lists, by section and by TLD.
Arguments
--commit=<bool>write the updated list (default false: preview the changes). Not for stats.
--force=<bool>update even when the list did not change (default false). Not for stats.
--source=<key>only this source, such as martenson or kikobeats (default: every source). disposable and free only.
Environment
UTOPIA_EMAILS_DATA_DIRthe directory the lists are read from and written to (default: the crate's data/).
UTOPIA_EMAILS_<TYPE>_<SOURCE>_URLwhere to download one source from, such as UTOPIA_EMAILS_DISPOSABLE_MARTENSON_URL or UTOPIA_EMAILS_FREE_KIKOBEATS_URL.
Exit codes
0done, including a preview, a list already up to date (which ends all before the free domains), an unknown command and invalid arguments (which print nothing).
1no source given or found, every source failed, or the list could not be written; the reason is on standard error.
255no command.
Writes
crates/utopia/emails/data/disposable-domains.txtcrates/utopia/emails/data/free-domains.txt
The crate embeds these files when it is compiled: rebuild after running the task.