Create account email address check should be case-insensitive

to reproduce:

  1. sign up as joe@example.com
  2. sign up on same forum as JOE@EXAMPLE.COM
    expected: “sorry, that email has already been taken”
    actual: new account is created

Not actually a bug – mail addresses (but not domains) are case sensitive, per Wikipedia:

Odd. As mentioned on that article, I have always seen First.Last@example.com go to the same inbox as first.last@example.com.

So I guess while its not technically a bug, it can be problematic.

I brought this up because a new user on our forum was having trouble signing in after they were approved - and now I see they just tried to sign up again with the other case as a different user name.

It is due to the Robustness principle Otherwise know as Postel’s law that it works when you do that. It spread from TCP to SMTP.
From the writeup:

“TCP implementations should follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others.”

4 Likes

Personally, I think people should have to tick a very special site setting if they don’t want bob@somewhere.com to be treated exactly the same as BOB@somewhere.com

4 Likes

I am definitely coming around to this way of thinking.

4 Likes

According to your link

The domain part is not case-sensitive, but local-parts may be.

So bob@example.com is strictly equivalent to bob@EXAMPLE.COM but may be different from BOB@example.com. If you really wanted case-sensitive emails you’d have to parse out the case-insensitive domain portion and compare it separately from the local parts.

According to a comment in this StackOverflow answer (emphasis mine):

‘In short, you are safe to treat email addresses as case-insensitive.’ I’d phrase it stronger: “you’re unsafe to treat email-addresses as case-sensitive manner” Especially when checking for duplicates in user-databases, etc.

Several email systems that are case-insensitive and that would cause problems if they were treated case-sensitively:

3 Likes

@neil is working on this next week.

1 Like

This problem is fixed. Email is not case sensitive anymore!

5 Likes