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:
chad.moran@gmail.c开发者_如何学运维om
c..hadmoran@gmail.com
c.h.a.d.m.o.r.a.n@gmail.com
All of these are the same
Other service:
chad.moran@---.com
c..hadmoran@---.com
These are unique.
Other than having special logic specifically for GMail is there a better way?
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.
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. chad.moran@gmail.com
and chadmoran@gmail.com
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.
精彩评论