Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to de-duplicate e-mail addresses [closed]

Is there a way to reliably get a unique e-mail address from one put in from a user? The problem is services such as GMail allow you to put a period in the address and it's stripped out whereas with other services this is not the case.

GMail:

[email protected]
[email protected]
[email protected]

All of these are the same

Other service:

[email protected]
[email protected]

These are unique.

Other than having special logic specifically for GMail is there a better way?

like image 983
Chad Moran Avatar asked May 16 '11 15:05

Chad Moran


2 Answers

Each email server will have varying rules about what is, and isn't allowed. You specified you don't want to have specific logic for each client, and for this reason you have to have specific logic.

You could strip out all dots, but other clients might count dotted email addresses as distinct.

I would highly recommend not attempting to try this, as it will be a maintenance nightmare, especially when overnight one of the email services changes their policy. Also, the benefits of such a system are small, users would just be motivated to register a new email address which is only marginally more difficult than dotting their actual one.

like image 199
Tom Gullen Avatar answered Nov 15 '22 11:11

Tom Gullen


This is not possible as each individual email service may choose to interpret the "local part" of the email address (the portion before the @) it's own way. [email protected] and [email protected] may route to the same mailbox, but a different provider may route them to separate mailboxes.

From wikipedia:

Interpretation of the local-part of an email address is dependent on the conventions and policies implemented in the mail server. For example, case-sensitivity may distinguish mailboxes differing only in capitalization of characters of the local-part, although this is not very common.

like image 27
matt b Avatar answered Nov 15 '22 09:11

matt b