Are email addresses case sensitive?

General Linux topics
Post Reply
admin
Site Admin
Posts: 50
Joined: Sun Aug 08, 2021 7:49 am

Are email addresses case sensitive?

Post by admin »

I've read that by the standard first part of the e-mail is case sensitive, however, I've tried to send e-mail to name@example.com, Name@example.com, and NAME@example.com - it has arrived in each case.

How do mail servers handle usernames? Is it possible to miss with case and that message wouldn't be delivered? Is it really very important to use exactly the same letter case, as was written while registering when giving your e-mail address?

email
smtp
rfc

The standard mailbox naming convention is defined to be "local-part@domain"; contemporary usage permits a much broader set of applications than simple "user names". Consequently, and due to a long history of problems when intermediate hosts have attempted to optimize transport by modifying them, the local-part MUST be interpreted and assigned semantics only by the host specified in the domain part of the address.

So yes, the part before the "@" could be case-sensitive, since it is entirely under the control of the host system. In practice though, no widely used mail systems distinguish different addresses based on case.

The part after the @ sign however is the domain and according to RFC 1035, section 3.1,

"Name servers and resolvers must compare [domains] in a case-insensitive manner"

In short, you are safe to treat email addresses as case-insensitive.

'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. –
Geert-Jan
Nov 16, 2013 at 23:00
75
I'd disagree with the conclusion. If you're looking for duplicates in a database - yes, a case insensitive match is probably the best way to go, but I've seen code where the email address is converted to lower case prior to sending. That's not a good idea, since there is a small chance it will not get delivered. So how you treat it depends on what the consequences of error are and what you're doing with the email addresses at that time (collating a list of unique addresses, sending an email, etc). –
Peter Bagnall
Sep 12, 2014 at 9:32
15
Does anyone know of a list of mail products that will (a) reject a John.Doe@company.com when the user john.doe@company.com is valid, or (b) will allow two distinct mailboxes to be created: John.Doe@company.com and john.doe@company.com? –
MSC
Mar 4, 2015 at 3:48
76
I work at a large company and there is another person with the same first and last name. I discovered today that his local-part differs from mine only in capitalization. This has been working properly, so I was surprised to see "no widely used mail systems distinguish different addresses based on case". We use MS Exchange which I would call "widely used". –
Matthew James Briggs
Nov 24, 2015 at 20:14
17
RFC 5321 2.4. General Syntax Principles and Transaction Model - SMTP implementations MUST take care to preserve the case of mailbox local-parts. In particular, for some hosts, the user "smith" is different from the user "Smith". Mailbox domains follow normal DNS rules and are hence not case sensitive. –
Post Reply