I know that gmail lets a user insert as many periods as he/she wants in an email address before the @ sign. Gmail also lets users append the email address like this: [email protected]. All those "different" email addresses are essentially the same address. (Link to google blog describing these "features")
I want to prevent users from creating multiple accounts with what is essentially the same email address. I decided to store email addresses in my database with those periods and anything following and including a + sing stripped, but now I am wondering: Is it a standard to ignore periods in front of the @ sign that email providers are mostly following?
If someone accidentally adds dots to your address when emailing you, you'll still get that email. For example, if your email is [email protected], you own all dotted versions of your address: [email protected].
Dots in a Gmail address don't matter While some e-mail providers allow for address variations using dots, Google has decided to ignore periods in its users' e-mail addresses altogether. Translation: Any combination of your e-mail address and those little dots is sent to the exact same inbox.
Google's Gmail service does indeed ignore periods in the address before the @gmail.com. In fact, a Google support page states that “dots don't matter in Gmail addresses,” and in your example, you could even get a message sent to [email protected].
This is really specific to gmail, but this applies to google apps for domain as well, so you would only be able to do it for @gmail.com
I wouldn't do this, this is only going to alienate your honest users and not prevent anyone determined to create multiple accounts.
Over the last few days, I encountered the same problem. After researching on the web and checking a few things, I found that:
Source: An article on Slate
I came to the conclusion that a majority of users use services offered by Microsoft, Google, or Yahoo. So I can have an application-specific regex like this.
var eml_exp = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@(gmail.com)$/i; if(eml_exp.test("email@addrss")) //if it's a gmail address, then remove periods from local part and also anything // after `+` sign . Then compare the address in your existing user table, // if you find it unique or unused then let the user to register.
You can read manuals of other known services also and implement according to them.
"Don't forget to open source your work :p"
Update
According to this SO question Adding + text before the @ in an email , you may block use of +
sign the whole problem of yours and mine will get solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With