Reply
Thread Tools Display Modes
#1
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?
#2
Old 03-12-2013, 02:42 PM
Guest
Join Date: Jan 2007
Location: St. Louis, MO
Posts: 5,607
Wiki claims it's valid: http://en.wikipedia.org/wiki/Email_a...mail_addresses

I'm checking the RFC to verify.
#3
Old 03-12-2013, 02:42 PM
Charter Member
Join Date: May 2001
Location: England
Posts: 56,665
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.
#4
Old 03-12-2013, 02:49 PM
Guest
Join Date: Jan 2007
Location: St. Louis, MO
Posts: 5,607
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.
#5
Old 03-12-2013, 03:14 PM
Charter Member
Join Date: Apr 2002
Location: California
Posts: 8,073
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.
#6
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.
#7
Old 03-12-2013, 03:30 PM
Charter Member
Join Date: Sep 2001
Location: Chicago Il
Posts: 9,420
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.
#8
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.
#9
Old 03-12-2013, 06:12 PM
Charter Member
Moderator
Join Date: Jan 2000
Location: The Land of Cleves
Posts: 72,738
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.
#10
Old 03-12-2013, 06:42 PM
Guest
Join Date: Feb 2010
Posts: 1,243
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.
#11
Old 03-12-2013, 06:50 PM
Guest
Join Date: Jan 2004
Location: Regina, SK, Canada
Posts: 1,670
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.
#12
Old 03-12-2013, 06:53 PM
Member
Join Date: Jul 2006
Location: Scotland
Posts: 10,619
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.
#13
Old 03-12-2013, 06:55 PM
Member
Join Date: Jul 2006
Location: Scotland
Posts: 10,619
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.
#14
Old 03-12-2013, 09:39 PM
Charter Member
Join Date: Mar 2002
Location: Near Philadelphia PA, USA
Posts: 11,194
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?
#15
Old 03-13-2013, 11:29 AM
Guest
Join Date: Jan 2007
Location: St. Louis, MO
Posts: 5,607
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.
#16
Old 03-13-2013, 01:21 PM
Guest
Join Date: Feb 2010
Posts: 1,243
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.
Reply

Thread Tools
Display Modes

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 05:37 PM.

Copyright © 2017
Best Topics: roshambo definition police jurisdiction keel breast compound w pain game map sizes blood work appointment cats drinking coffee asian pink nipples encyclopedia dramatica malware rimshot slang tenerife pronunciation 70s rocker chick snap on deals foil swan freemason password beastie boys brooklyn ds9 s6e13 redemptionperiod godaddy dan bock funny emotion avia dental six dot puzzle utilities in monopoly sex shops dc anthony mcauliffe 714 pill cc deville guitar 138/80 dones pills pacman porn miss susie lyrics burn oozing ball peenhammer what does the song come on eileen mean how long does soda last once opened what is painted on the patriots football field how to test outlet ground with multimeter mercury filled hollow points political signs at polling places penalty for putting something in mailbox quot libros quam breve tempus t shirt temperature gauge in car low native palm trees of florida donald duck no pants make your own box spring turn rotors or replace how to move from one apartment to another vinegar and water melt ice if i encircle my wrist with my other hand's middle finger and thumb where to buy poster tube chicken in a biskit review substitution for cane syrup can i take shaving cream on a plane good luck surgery quotes cocktail that tastes like dr pepper can you appeal a restraining order how long was a tour of duty in vietnam what accent does stewie have variable speed cd player can we guess your education level based on the books you've read 2004 pontiac grand am radio removal us virgin islands vs puerto rico what is a zipperhead can i remove my stitches myself skype random contact request