harvard-lil/perma

Case-insensitive email addresses

matteocargnelutti opened this issue · 2 comments

As reported by @clare-stanton: Some of our users are running into issues because email addresses are considered case sensitive during sign-up / sign-in.

  • Figure out if the entire email address, or just the part before @ should be case insensitive
  • See how many existing users would be impacted by proposed fix (and how)
  • Choose our preferred solution: see this list of decisions to be made
  • Apply the fix and remediate edge cases: project board

Resources:

I found this blog post referencing RFCs around case sensitivity in email: https://verifalia.com/help/email-validations/are-email-addresses-case-sensitive. It says that domains are not case-sensitive, which would be my instinct. Regarding the username, it says that though they can be case-sensitive, it's rare that they are. I have found other articles citing the same RFC5321 (https://datatracker.ietf.org/doc/html/rfc5321) confirming that they can be case sensitive. I wonder how commonly it's an issue though. The problem is that people are putting in MYUSER@dogs.cats and myuser@dogs.cats and they're being treated as two separate users, right? Or is it you're getting myuser@dog.CATS and myuser@Dog.Cats? Or is it both?

@kilbergr Main issue is the former, as Django follows said RFC, in EmailField and normalize_email().

Another argument in favor of considering usernames as case sensitive (or at least saving them that way), besides the fact that it is the most "RFC compliant" thing to do, is that it sometimes makes sense to save how users prefer to see their email displayed (ie: PersonName@domain.ext being arguably easier to read than personname@domain.ext).

That said: I'm working on a very first attempt at tackling this issue, and I'm leaning towards "let's have all emails lower case moving forward", which comes with its own set of challenges.
PR / discussion to come, I'll make sure to @ you there 😄 .

Cheers.