Do all email providers ignore periods in front of @?

后端 未结 3 1399
别那么骄傲
别那么骄傲 2020-12-29 01:41

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: userNam

相关标签:
3条回答
  • 2020-12-29 02:30

    "I want to prevent users from creating multiple accounts"

    Maybe, like the others here say, that is not a good reason to ignore periods.

    However a good reason can be to prevent users from accidentally creating different accounts. Let's say, a web app has recently been installed, and not yet configured to work with Gmail OpenAuth. So people type their addresses manually, to sign up with local email + password accounts.

    Later, the web app configures OpenAuth and a Sign in with Gmail button. Now people with a gmail address, click that button to sign in. And ... in some cases, people accidentally manually typed their addresses with no dots, or with dots, or different dots, when they typed by hand (well, keyboard) previously.

    Now, the app thinks the addresses are different, and auto-creates a new account for the user. S/he then wonders: "Where is all my old stuff? That I created before with this account? I logged in with the same email address!"

    Real life example of this happening: https://meta.discourse.org/t/discourse-creates-new-users-if-dots-are-present-absent-in-google-email-address-when-logging-in-using-google/66151

    I would think that for non-technical people, ignoring dots in Gmail addresses is the user friendly approach.

    To let technical people create many accounts using the same Gmail addr (for testing purposes), you can choose to consider whatever+with-tags@gmail a different address. — Everyone happy :- ) (Astroturfing & spam filters can take into account that bob@gmail.com and bob+with-a-tag@gmail.com is the same person.)

    0 讨论(0)
  • 2020-12-29 02:35

    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.

    0 讨论(0)
  • 2020-12-29 02:39

    Over the last few days, I encountered the same problem. After researching on the web and checking a few things, I found that:

    • DOTS MATTER IN: Microsoft Outlook, Yahoo Mail, Apple iCloud ID
    • DOTS DON’T MATTER IN: Gmail, Facebook ID
    • DOTS STRICTLY PROHIBITED: Twitter

    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.

    0 讨论(0)
提交回复
热议问题