Skip to main content

Detect disposable / temporary email addresses, and distinguish them from legitimate forwarding aliases (EmailAlias.io, SimpleLogin, addy.io, DuckDuckGo, Firefox Relay, Apple Hide My Email).

Project description

disposable-email-detector

Detect disposable / temporary email addresses, and tell them apart from legitimate forwarding aliases like EmailAlias.io, SimpleLogin, addy.io, DuckDuckGo Email Protection, Firefox Relay, and Sign in with Apple's Hide My Email.

Most disposable-email blocklists treat every "unusual" email domain the same. This one separates two distinct categories:

Category Example Action
Disposable — mailbox expires, abandoned by design foo@mailinator.com, bar@10minutemail.com Block at signup
Forwarding alias — permanent address, forwards to a real inbox the user controls user@emailalias.io, u@sl.email, foo@duck.com Do NOT block — this is a real customer using privacy tooling
OK — unknown / probably legit mailbox jane@gmail.com Allow

Try the hosted checker at emailalias.io/tools/disposable-email-checker.

Install

pip install disposable-email-detector

Python 3.9+. No runtime dependencies.

Usage

from disposable_email_detector import check, is_disposable, is_forwarding_alias

is_disposable("foo@mailinator.com")        # True
is_disposable("user@emailalias.io")        # False — it's a forwarding alias

is_forwarding_alias("user@emailalias.io")  # True

check("user@emailalias.io")
# {
#   "verdict": "forwarding_alias",
#   "provider": "EmailAlias.io",
#   "reason": "Address is a forwarding alias … Do NOT treat as disposable.",
#   "email": "user@emailalias.io",
#   "domain": "emailalias.io",
#   "local": "user"
# }

check() returns one of: "disposable" | "forwarding_alias" | "suspicious" | "ok" | "invalid".

What gets detected

  1. Disposable domain list (~74,000 providers — Mailinator, 10MinuteMail, GuerrillaMail, YOPmail, Temp-Mail, and the long tail of obscure throwaway services). Synced weekly from upstream MIT-licensed community lists.
  2. Personally-observed list — domains seen directly in EmailAlias.io abuse logs, with provenance notes (Cloudflare Email Routing MX, NameSilo mail-only, etc.). Survives every upstream refresh.
  3. Forwarding-alias provider list — used to flip the verdict from disposable to forwarding_alias and tell the integrator who NOT to block.
  4. Heuristics on the local part and TLD:
    • Suspicious TLDs: .tk, .ml, .ga, .cf, .gq
    • Local part looks randomly generated
    • Local part starts with a throwaway keyword (temp, throw, trash, spam, junk, …)

Two or more heuristic hits flips the verdict to suspicious. One hit alone is left at ok — single signals are too noisy on real addresses.

Why split disposable from forwarding alias?

Mail to a Mailinator address lands in a public inbox that anyone can read. Mail to a DuckDuckGo or EmailAlias.io address forwards to the user's real inbox. Site owners blocking both end up rejecting privacy-conscious customers — exactly the audience least likely to come back. Splitting the verdict lets you block disposable and allow forwarding_alias with one library.

License

MIT. Source and bug reports: github.com/emailalias/disposable-email-detector. The JavaScript/TypeScript sibling package is at @emailalias/disposable-email-detector on npm.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

disposable_email_detector-0.1.2-py3-none-any.whl (440.6 kB view details)

Uploaded Python 3

File details

Details for the file disposable_email_detector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for disposable_email_detector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 41f23a988d099af22bd23b72c379e0bf864786d42330b5244b964d35f0dff2e4
MD5 ff54e00e60215c145eaf05cd023d60b2
BLAKE2b-256 b51142b36a7282544d908dcd0e1ba3afcadcacceea531b65b2f175163482644c

See more details on using hashes here.

Provenance

The following attestation bundles were made for disposable_email_detector-0.1.2-py3-none-any.whl:

Publisher: publish.yml on emailalias/disposable-email-detector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page