Download the PHP package thedomeffm/email-canonicalizer without Composer

On this page you can find all versions of the php package thedomeffm/email-canonicalizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package email-canonicalizer

Email Canonicalizer

This library will canonicalize public email service providers addresses. Most common example are Gmail addresses. Example: [email protected] can also use [email protected] or [email protected]. You should consider this library when you want to limit multiple accounts in your app via the same email.

[!IMPORTANT] Never use the canonicalized email address for login or communication!

Installation

Usage

Addresses at unknown domains are only trimmed and lowercased: [email protected] becomes [email protected] (provider lowercase).

Examples

Results of EmailCanonicalizer::default(). These are checked by tests/Unit/ReadmeExamplesTest.php.

One example per provider:

Input Canonical Provider What happens
[email protected] [email protected] gmail lowercased, +tag and dots removed, googlemail.com becomes gmail.com
[email protected] [email protected] outlook lowercased, +tag removed, dots stay
[email protected] [email protected] proton lowercased, +tag removed, dots, underscores and hyphens removed
[email protected] [email protected] fastmail subdomain addressing: john becomes the local part
[email protected] [email protected] fastmail +tag removed, the domain stays as it is
[email protected] [email protected] yandex +tag removed, yandex.ru becomes yandex.com
[email protected] [email protected] posteo +filter removed, the domain stays as it is
[email protected] [email protected] mailbox-org +extension removed
[email protected] [email protected] lowercase unknown domain: only lowercased, +tag stays

Where rules deliberately do not apply:

Input Canonical Provider Why
[email protected] [email protected] lowercase A custom domain can be hosted at Google Workspace or Exchange, where dots count and admins configure +tag. The domain doesn't show who hosts it.
[email protected] [email protected] lowercase Microsoft documents +tag only for outlook.com.
[email protected] [email protected] lowercase Yahoo documents no rule for -, and it is part of real names.
[email protected] [email protected] lowercase Apple doesn't document that me.com and icloud.com are the same mailbox.
[email protected] [email protected] proton +tag is removed, but protonmail.com is not merged into proton.me.

See docs/providers.md for the sources.

Choosing providers

The first provider whose domain matcher matches wins. A provider is configuration: a name, a DomainMatcherInterface and ordered rules. The canonicalizer lowercases the local part and applies the rules.

Requirements

Versioning

The canonical address is meant to be stored, so its stability is part of the API. There is no changelog file. Every release's GitHub release notes list each added provider and each changed rule or domain:

Supported Providers

Every address is trimmed first and its domain is lowercased. Each provider lowercases the local part, then applies its rules:

Provider Class Primary domain Other domains Removes +tag Removes dots Subdomain addressing
Gmail GmailProvider gmail.com googlemail.com (rewritten to gmail.com) yes yes no
Outlook.com OutlookProvider outlook.com yes no no
Proton Mail ProtonProvider proton.me protonmail.com, protonmail.ch, pm.me (kept as they are) yes yes (also _ and -) no
Fastmail FastmailProvider fastmail.com 115 more official Fastmail domains, e.g. fastmail.fm, sent.com (kept as they are) yes no yes: [email protected] becomes [email protected]
Yandex YandexProvider yandex.com yandex.ru, yandex.by, yandex.kz, ya.ru (rewritten to yandex.com) yes no no
Posteo PosteoProvider posteo.de 12 more Posteo registration domains, e.g. posteo.com, posteo.net (kept as they are) yes no no
mailbox.org MailboxOrgProvider mailbox.org yes no no
Lowercase LowercaseProvider every domain fallback, always last no no no

Only rules that the provider documents officially are applied.

When we are not sure, we prefer a possible duplicate account over a wrong canonical address: a missing rule only lets a duplicate slip through, but a wrong rule merges two different people and blocks a real user. That's why providers without official documentation (e.g. Hotmail, iCloud, Yahoo, Zoho, GMX) are left out for now.

[!NOTE] This list is outdated the moment a version is released, because providers change their domains and rules without notice. We try to keep it up to date as far as possible. If you notice a change, please open an issue or pull request with a link to the official source.

See docs/providers.md for an overview of all rules with their official sources, for providers that are not supported yet, and for rules other libraries apply that we deliberately don't.

Alternatives

Other PHP libraries solve the same problem with different trade-offs (last commits checked on 2026-10-15):

Library Approach Last commit Notes
sunaoka/email-normalizer-php Detects the provider by DNS MX lookup, or by domain with skipDns 2026-10 Covers more providers (e.g. Apple, Zoho, Rackspace), and also recognizes custom domains hosted at a provider. The result depends on DNS and the network.
rezozero/canonical-email Strategies per provider (Gmail, Outlook, Google Workspace via MX lookup) 2024-12 Small and simple, but only a few providers.
Gabrola/email-normalizer Static rule tables per domain, no network access 2021-11 Many domains, but some rules merge different mailboxes, see rules we deliberately don't apply.

This library applies only rules that the provider documents officially, never makes network requests, and tries not to merge addresses of different people. In return, it covers fewer providers. Pick another library if you need broader coverage and accept that trade-off.


All versions of email-canonicalizer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thedomeffm/email-canonicalizer contains the following files

Loading the files please wait ...