Utopia Emails
Email addresses split, checked and made canonical per provider, and their domains classified as free or disposable.
This library is maintained by the Appwrite team.
Getting started
[]
= { = "https://github.com/appwrite/appwrite" }
Split and check an address
Email::new trims and lower-cases the address and splits it at its single @. It holds bytes, as a PHP string does.
use Email;
let email = new?;
assert_eq!;
assert_eq!;
assert_eq!;
assert!;
# Ok::
Canonical forms
A provider's aliases are removed: Gmail drops dots and +tags, Outlook and iCloud drop +tags, and each uses its canonical domain.
use Email;
let email = new?;
assert_eq!;
assert_eq!;
# Ok::
Free and disposable domains
The lists are embedded. A disposable provider listed by its registrable domain owns its subdomains, so pass the registrable domain (from utopia-domains) too.
use Lists;
let lists = global;
assert!;
assert!;
assert!;
Contributing
Test
Compare with PHP
The utopia PHP extension serves this crate as Utopia\Emails\Email, which no longer has a PHP implementation. crates/extension/tests/run.sh runs packages/emails/tests on it in the development image.
Domain lists
data/free-domains.txt and data/disposable-domains.txt are packages/emails/data/{free,disposable}-domains.php in the crate's format. After refreshing the package's lists (composer import:all in packages/emails), regenerate them from the repository root:
License
BSD-3-Clause. See LICENSE.