Thread Tools
Old 03-12-2013, 02:38 PM
Guest
Join Date: Dec 2003
Location: Athens, Greece
Posts: 3,354
Is this email adress format valid? ([email protected])

I was looking at some ECDL multiple choice questions and came across this:
Code:
Which of the following email addresses are not valid?

a. [email protected]
b. [email protected]
c. [email protected]
d. [email protected]
e. http://otenet.gr
The correct answers are c,d and e. But I was wondering, is c really invalid? Can you have an email address at a top level domain?
Old 03-12-2013, 02:42 PM
Guest
Join Date: Jan 2007
Location: St. Louis, MO
Posts: 5,611
Wiki claims it's valid: http://en.wikipedia.org/wiki/Email_a...mail_addresses

I'm checking the RFC to verify.
Old 03-12-2013, 02:42 PM
Charter Member
Join Date: May 2001
Location: England
Posts: 56,781
Edited to revert having shot my mouth off. I'll wait and see what the experts say.

Last edited by Mangetout; 03-12-2013 at 02:44 PM.
Old 03-12-2013, 02:49 PM
Guest
Join Date: Jan 2007
Location: St. Louis, MO
Posts: 5,611
From RFC 5321: http://tools.ietf.org/html/rfc5321#section-2.3.5

A domain name (or often just a "domain") consists of one or more
components, separated by dots if more than one appears. In the case
of a top-level domain used by itself in an email address, a single
string is used without any dots.
Old 03-12-2013, 03:14 PM
Charter Member
Join Date: Apr 2002
Location: California
Posts: 8,080
If the TLD resolves to a hostname, then yes -- it's valid. However, it's not certain whether ICS-FORTH maintains a mail server at gr.
Old 03-12-2013, 03:23 PM
Guest
Join Date: Jul 2012
Location: Durham, NC
Posts: 4,086
never mind, misread ...

Last edited by Learjeff; 03-12-2013 at 03:23 PM.
Old 03-12-2013, 03:30 PM
Charter Member
Join Date: Sep 2001
Location: Chicago Il
Posts: 9,466
Quote:
Originally Posted by Nametag View Post
If the TLD resolves to a hostname, then yes -- it's valid. However, it's not certain whether ICS-FORTH maintains a mail server at gr.
Much better stated than I would have put it, but this is essentially my thought; It's valid from a syntax perspective but it's a toss up to see if mail will actually go there depending upon the circumstances.
Old 03-12-2013, 03:43 PM
Guest
Join Date: Dec 2003
Location: Athens, Greece
Posts: 3,354
Thanks!

Looks like if you know too much about computers you'll have a problem at answering some of the ECDL questions.
Old 03-12-2013, 06:12 PM
Charter Member
Moderator
Join Date: Jan 2000
Location: The Land of Cleves
Posts: 73,245
Quote:
Quoth zoid:

Much better stated than I would have put it, but this is essentially my thought; It's valid from a syntax perspective but it's a toss up to see if mail will actually go there depending upon the circumstances.
But the question really can't be asking about anything other than syntax. I mean, there's no guarantee that "[email protected]" is a valid e-mail address, either: Maybe nobody ever signed up for Hotmail under that name.
Old 03-12-2013, 06:42 PM
Guest
Join Date: Feb 2010
Posts: 1,252
Virtually everybody gets email address validation wrong. The spec is actually extremely flexible...

Typically people use a RegEx to validate an email address; the RegEx solution is almost guaranteed to be wrong (unless they use this one.)

Anyway, this is a huge pet peeve of mind, the "defacto" email format is much, much, much more restrictive than the actual one. God help you if you have a (perfectly valid) email address with a + in it, or with the .museum top level domain.
Old 03-12-2013, 06:50 PM
Guest
Join Date: Jan 2004
Location: Regina, SK, Canada
Posts: 1,684
Quote:
Originally Posted by Blakeyrat View Post
Anyway, this is a huge pet peeve of mind, the "defacto" email format is much, much, much more restrictive than the actual one. God help you if you have a (perfectly valid) email address with a + in it, or with the .museum top level domain.
Or if it starts with a digit.
Old 03-12-2013, 06:53 PM
Member
Join Date: Jul 2006
Location: Scotland
Posts: 10,655
Quote:
Originally Posted by Dog80 View Post
Thanks!

Looks like if you know too much about computers you'll have a problem at answering some of the ECDL questions.
Indeed. You have to answer them from the viewpoint of someone who is brand new to computing (which I suppose is the point of the thing). It's a while ago, but the last time I looked at the superset of the questions that make up the test, there were quite a few "Hmmm, maybe" ones.
Old 03-12-2013, 06:55 PM
Member
Join Date: Jul 2006
Location: Scotland
Posts: 10,655
Quote:
Originally Posted by Blakeyrat View Post
Typically people use a RegEx to validate an email address; the RegEx solution is almost guaranteed to be wrong (unless they use this one.)
that's quite the expression.
Old 03-12-2013, 09:39 PM
Charter Member
Join Date: Mar 2002
Location: Near Philadelphia PA, USA
Posts: 11,300
Quote:
Originally Posted by Blakeyrat View Post
Typically people use a RegEx to validate an email address; the RegEx solution is almost guaranteed to be wrong (unless they use this one.)
And that huge regex is guaranteed to be right?
Old 03-13-2013, 11:29 AM
Guest
Join Date: Jan 2007
Location: St. Louis, MO
Posts: 5,611
Probably not. From what I can tell really the only useful thing to do for e-mail validation (on a web page, for example) is check for an @, some text to the left, and some text to the right (perhaps with length-limit checking). Anything else is probably too restrictive and/or wrong.

Then make the user enter it twice to check for typos.

Then verify the e-mail my sending a confirmation that requires a response.
Old 03-13-2013, 01:21 PM
Guest
Join Date: Feb 2010
Posts: 1,252
Quote:
Originally Posted by davidm View Post
And that huge regex is guaranteed to be right?
No; AFAIK it only implements RFC822 and not any of the newer errata. (For example, you can now use an IPv6 address as your hostname, but IPv6 didn't exist when RFC822 was written.)

The point of the huge regex is to communicate the following:
1) Validating email addresses is really, really, really complex
2) If you think validating email addresses with RegEx is a pretty good idea, you're simply wrong (as the page mentions, the only way THAT RegEx "works" is because he pre-processes the email address to remove comments-- comments that can be infinitely nested and therefore make validating an email address using traditional RegEx literally impossible.)

Personally, I check for a @ sign. That's it. Then send a confirmation email. The destination's email server is the only true authority as to whether that address exists or not, so ask it.

Last edited by Blakeyrat; 03-13-2013 at 01:25 PM.
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:35 PM.

Copyright © 2017
Best Topics: pronounce folk back teeth floating doctor girlfriend staffs or staves suppository for dogs stick on foam excel sin dragging a lake japan abortion premixed hair color demised space donkey show mexico two drivers licenses cody screaming dog mark gero amazon promotion applied three eighty wavy dash driving enthusiasts chantix forum steam broom 1112 meaning gunshot onomatopoeia shoe instep faux italic illustrator wasp protection suit tarnation meaning task killer pc eating packing peanuts suppositories for dogs paypal electronics 5cc in grams wayward pines message board amazon pop up ads ck2 how to get claims why does it take me so long to come female how much does it cost to put cat to sleep kroger express turkey dinner why can't my laptop find my printer how to respond to birthday wishes on fb what is in rid x printer not printing colors correctly keeping moisture out of car roy rogers tv show server ram vs desktop ram when did imperialism end how to stop newspaper delivery super glue on circuit board running a microwave with nothing in it salt in the gas tank why does string cheese taste better when peeled how many ibuprofen to get high san jose sharks message boards reasons to go to princeton ussr at its peak remove medical tape from skin stroke my lick my jingle bells how to reheat boneless wings broadly sub-saharan african moose lodge membership requirements tips for working at mcdonalds how to sneeze quietly geode hunting in wisconsin tout de suite translation konrad von hochstaden statue how are jeopardy questions phrased david blaine weight loss