Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to normalize an email address?

Tags:

In this example, Django talks about normalizing an email address with self.normalize_email(email) where self is BaseUserManager. When I search for "normalizing emails" it seems to be a practice across all platforms. I see tutorials of how to do it, but nothing really explaining what it is and what it's used for.

like image 223
User Avatar asked Jan 14 '15 06:01

User


People also ask

What does it mean to normalize the name?

Name Normalization analyzes email document headers to identify all aliases (proper names, email addresses, etc.) and the entities (person, distribution group, etc.) those aliases belong to. Name normalization automatically merges entities with those created by Legal Hold, Processing, or Case Dynamics.

Should Address be normalized?

It is best to standardize your addresses first, because duplicates will be much easier to spot and confirm. Without standardizing addresses first, it will be difficult to tell if addresses are in fact duplicates. However, with address normalization complete, it is extremely easy to find the duplicates.

What are the two main goals of normalization?

There are two main objectives of the normalization process: eliminate redundant data (storing the same data in more than one table) and ensure data dependencies make sense (only storing related data in a table).

What is normalize a signal?

Normalizing the amplitude of a signal is to change the amplitude to meet a particular criterion. One type of normalization is to change the amplitude such that the signal's peak magnitude equals a specified level. By convention in Matlab, the amplitude of an audio signal can span a range between -1 and +1.


2 Answers

For email addresses, [email protected] and [email protected] are equivalent; the domain part is case-insensitive according to the RFC specs. Normalizing means providing a canonical representation, so that any two equivalent email strings normalize to the same thing.

The comments on the Django method explain:

Normalize the email address by lowercasing the domain part of it.

like image 105
Amit Kumar Gupta Avatar answered Sep 26 '22 06:09

Amit Kumar Gupta


One application of normalizing emails is to prevent multiple signups. If your application lets the public to sign up, your application might attract the "unkind" types, and they could attempt to sign up multiple times with the same email address by mixing symbols, upper and lower cases to make variants of the same email address.

From Django's repository, the docstring of normalize_email is the following:

Normalize the email address by lowercasing the domain part of it.

What this method does is to lowercase the domain part of an email, so this part is case insensitive, so consider the following examples:

>>> from django.contrib.auth.models import BaseUserManager
>>> BaseUserManager.normalize_email("[email protected]")
[email protected]
>>> BaseUserManager.normalize_email("[email protected]")
[email protected]
>>> BaseUserManager.normalize_email("[email protected]")
[email protected]
>>> BaseUserManager.normalize_email("[email protected]")
[email protected]
>>> BaseUserManager.normalize_email("[email protected]")
[email protected]

As you can see all emails are equivalent because the case after @ is irrelevant.

like image 23
lmiguelvargasf Avatar answered Sep 24 '22 06:09

lmiguelvargasf