Concepts
Email Normalization
Many email providers let several spellings of an address deliver to the same mailbox, whether through subaddress tags (user+anything@), ignored characters, or alternate domains. Normalization folds these conventions away so that every spelling of a mailbox resolves to the same canonical address.
The result is returned by the email endpoint as normalized_email, and is available in Gates as email.normalized.
Examples
| Input | normalized_email |
Why |
|---|---|---|
[email protected] |
[email protected] |
Gmail ignores dots and anything after + |
[email protected] |
[email protected] |
Alternate domain for the same mailbox |
[email protected] |
[email protected] |
Yahoo uses - for disposable aliases |
[email protected] |
[email protected] |
Lowercased, subaddress tag stripped |
Provider rules
Each provider has its own aliasing conventions: which tags it ignores, which characters are interchangeable, and which alternate domains deliver to the same mailbox. Normalization applies the conventions of the address's provider, so what gets folded away for a Gmail address is not the same as for a Yahoo or Proton one, and the rules are kept up to date as providers change them.
The examples above show the effect rather than the full rule set, which is not documented and changes over time.
Do not send mail to the normalized address
normalized_email is an identity key, not a delivery address. Folding alternate domains into a primary one can produce an address that does not accept mail: [email protected] normalizes to [email protected], because protonmail.com was Proton's original domain, and mail sent to that form may bounce even though the submitted address works.
Store both values. Keep the address exactly as the user submitted it and send to that one, and keep normalized_email alongside it as the value you enforce uniqueness on and match against existing accounts.
Comparing against the submitted address
The email field always returns the address exactly as it was submitted, so comparing it with normalized_email tells you whether the submitted spelling was an alias of a plainer address:
email |
normalized_email |
Same? |
|---|---|---|
[email protected] |
[email protected] |
No, the address carries a subaddress tag |
[email protected] |
[email protected] |
Yes, the address is already canonical |
This comparison replaces the deprecated alias field.
For a walkthrough of how aliasing works across providers, see How to Normalize Email Addresses.