[Nottingham] emails containing spaces

Jason Irwin jasonirwin73 at gmail.com
Tue Oct 16 14:11:28 UTC 2012

On 16/10/12 14:50, T.J long thing wrote:
> it's come to my attention that it may be possible to have spaces in an
> email address providing it's not part of the domain section. Also a
> possibility they can be case sensitive has anyone else come across this?
> can any one confirm these or is it just rumor?
A good rule of thumb: if you think you know how to validate an email
address, then you probably don't know how to validate an email address!

As Mike says, there are all sorts of peculiar ins-and-outs to email
names that can lead to some deeply strange (but totally valid)
addresses.  They best thing you can do it deal with the 99% and let
everyone else suffer (unless you are a masochist, of course).

This is a good article on the topic:
Even if you don't plan to use RegEx, it walks through the pitfalls.

Strictly speaking addresses are case sensitive, but the de facto
standard today is to be insensitive (thank you, Exchange).

More the gory details are in RFC-2822 if you feel brave.

Personally I tend not to do heavy validation of email addresses and the
number of sites that try to be "clever" and trip themselves up by not
accepting basic things like "-" or "+" in the local part would be
hilarious, if it wasn't so depressing.

This mini-rant makes me want to start a "yer doin' it wrong" web site
where I publicly ridicule companies that can't get basic things like
this correct.

Jason Irwin

More information about the Nottingham mailing list