Link to home
Start Free TrialLog in
Avatar of gwilym
gwilym

asked on

Definition of valid e-mail address?

What characters are allowed in an e-mail address to the left of the @ sign?  Are there characters which are not strictly correct, but do work and are used anyway?
Avatar of ozo
ozo
Flag of United States of America image

Any character is allowed, when properly quoted.
http://ds.internic.net/rfc/rfc822.txt
(And you can even have deliverable addresses which aren't RFC 822 compliant)
Avatar of gwilym
gwilym

ASKER

What do you mean when you say that any character can be used if 'properly quoted'?  I know for instance that @ and space cannot be used.  Could you give me list of characters?  I'm writing a routine to just verify that the left bit doesn't contain any disallowed characters.
Sorry, but
"@ and space"@domain.com
is a perfectly valid e-mail address, and verifying adresses is more complicated than just checking for disallowed characters.
On the other hand, although valid, it is an unusual address.
And perhaps your routine may want to flag it anyway, to ask someone to confirm it.
I wouldn't know what characters you might want to use for that, since that may depend on what kinds of addresses your routine would typically see (maybe the ones you're interested in happen not to use @ or space, maybe they eschew the use of digits or capitals), on how willing you are to needlessly flag a valid address in order to avoid the risk of allowing a bad address, and on what kinds of invalid adresses your routine would be likely to encounter.
ASKER CERTIFIED SOLUTION
Avatar of braveheart
braveheart

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As I said, you can decide what threshold of unusualness works best for you.
if you think your routine is more likely to see addresses like
-_-@experts-exchange.com
than
12345.6789@compuserve.com
then alphanumerics, underscore, and minus might work well for you.
(I'd hate to call anyone else a lunatic though. If spam address collectors are using that rule,
then I might see how having a luny address could be quite sensible:-)