8

The official RFC documents state that we can use both upper and lowercase letters in the "local" part of the domain (plus many other crazy things).

However, what is common in the real world - and what the spec say are two different things. None of those extra characters (! # $ % & ' * / = ? ^ { | } ~) are allowed in emails from large providers like yahoo, google, or hotmail. In addition, it is very, very rare to see an email that contains capital letters (JohnDoe@example.com).

I sent myself a couple emails today using different upper and lowercase combos and found that my email servers all treated them as the same account ignoring the fact that the letter casing was different. In other words, JohnDoe@example.com = johndoe@example.com to my email servers (including my free email accounts).

Should I act on the format the world has chosen - and standardize/lowercase all ANSII emails? Or should I allow users to register multiple accounts as JohnDoe@example.com, johndoe@example.com, and JOHNdoe@example.com?

Community
  • 1
  • 1
Xeoncross
  • 55,620
  • 80
  • 262
  • 364

4 Answers4

5

Probably, the correct compromise is to let them register with the capitalization of their choice, and show that where appropriate ("JOHNdoe@example.com Inbox"). But you should canonicalize the capitalization for uniqueness checks, since there are many badly behaved email senders that e.g. capitalize the entire email address before sending.

Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
  • So is capitalization the standard for delivery while lowercase is the standard for display? – Xeoncross Mar 14 '11 at 04:11
  • No, I'm not suggesting capitalization (upper-casing) for delivery is correct, a good idea, *or* used by most senders. But it's incorrectly used by a significant number. And as I said, you should display the original address to the user where appropriate. For canonicalization, lower-casing or upper-casing should both be okay, as long as you're consistent. – Matthew Flaschen Mar 14 '11 at 04:13
  • 2
    @Xeoncross no you should deliver to the same address the sender wrote, the receiving server might be case sensitive. – stefan Mar 14 '11 at 04:21
3

In Microsoft SQL server, by default, indexes are case insensitive.

If you put a unique index on the field, the user can have a reader-friendly CamelCase name like JohnDoe@acme.org and duplicates like johndoe@ACME.org will be rejected automatically.

Steve Wellens
  • 20,506
  • 2
  • 28
  • 69
  • 1
    I mostly use PostgreSQL, however, MySQL shares the same case-insensitive nature you describe. However, this is about more than just storage - I also need to email these accounts. – Xeoncross Mar 14 '11 at 04:14
2

The reason for the standard was so that non-Unix systems could participate in the ARPAnet and later Internet with minimal hassles. (VMS and Tenex were common in the former, and BITNET was also represented. In the latter at least, lowercase characters required 3278 or upgraded 3270 terminals.) These days, it's best to ignore case in the localpart, as everyone has figured out how to use lowercase out of necessity.

geekosaur
  • 59,309
  • 11
  • 123
  • 114
1

I personally would choose to standardize/lowercase all emails. This simplifies things for you because, if a user is sending email or logging in on your system, it is very simple to mistype an email address - JohnDoe@example.com vs johnDoe@example.com. And, as yous said, the big providers have made this decision to follow this pattern. Even if you allowed uppercase letters, it would confuse your general user base as they have come to expect something different (AKA all lowercase).

JasCav
  • 34,458
  • 20
  • 113
  • 170