# Is this email adress format valid? (user@TLD)

**URL:** <https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740>\
**Category:** Factual Questions\
**Created:** [March 12, 2013, 6:38pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740 "2013-03-12T18:38:43Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dog80](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@Dog80](https://boards.straightdope.com/u/Dog80)\
**Post date:** [March 12, 2013, 6:38pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/1 "2013-03-12T18:38:43Z")

</div>

I was looking at some ECDL multiple choice questions and came across this:

```auto

Which of the following email addresses are **not** valid?

a. salnk@otenet.gr
b. salnk@hotmail.com
c. salnk@gr
d. salnk@schgr
e. http://www.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?

---

<div class="post-metadata">

**Author:** ![Jas09](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jas09](https://boards.straightdope.com/u/Jas09)\
**Post date:** [March 12, 2013, 6:42pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/2 "2013-03-12T18:42:31Z")

</div>

Wiki claims it’s valid: [Email address - Wikipedia](http://en.wikipedia.org/wiki/Email_address#Valid_email_addresses)

I’m checking the RFC to verify.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [March 12, 2013, 6:42pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/3 "2013-03-12T18:42:41Z")

</div>

Edited to revert having shot my mouth off. I’ll wait and see what the experts say.

---

<div class="post-metadata">

**Author:** ![Jas09](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jas09](https://boards.straightdope.com/u/Jas09)\
**Post date:** [March 12, 2013, 6:49pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/4 "2013-03-12T18:49:56Z")

</div>

From RFC 5321: [RFC 5321 - Simple Mail Transfer Protocol](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.

---

<div class="post-metadata">

**Author:** ![Nametag](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/nametag/32/406_2.png) [@Nametag](https://boards.straightdope.com/u/Nametag)\
**Post date:** [March 12, 2013, 7:14pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/5 "2013-03-12T19:14:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Learjeff](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@Learjeff](https://boards.straightdope.com/u/Learjeff)\
**Post date:** [March 12, 2013, 7:23pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/6 "2013-03-12T19:23:12Z")

</div>

never mind, misread …

---

<div class="post-metadata">

**Author:** ![zoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zoid/32/336_2.png) [@zoid](https://boards.straightdope.com/u/zoid)\
**Post date:** [March 12, 2013, 7:30pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/7 "2013-03-12T19:30:57Z")

</div>

> [@Nametag](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Dog80](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@Dog80](https://boards.straightdope.com/u/Dog80)\
**Post date:** [March 12, 2013, 7:43pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/8 "2013-03-12T19:43:43Z")

</div>

Thanks!

Looks like if you know too much about computers you’ll have a problem at answering some of the ECDL questions.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [March 12, 2013, 10:12pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/9 "2013-03-12T22:12:47Z")

</div>

> [@](#):
>
> 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 “[salnk@hotmail.com](mailto:salnk@hotmail.com)” is a valid e-mail address, either: Maybe nobody ever signed up for Hotmail under that name.

---

<div class="post-metadata">

**Author:** ![Blakeyrat](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@Blakeyrat](https://boards.straightdope.com/u/Blakeyrat)\
**Post date:** [March 12, 2013, 10:42pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/10 "2013-03-12T22:42:28Z")

</div>

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](http://ex-parrot.com/~pdw/Mail-RFC822-Address.html).)

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.

---

<div class="post-metadata">

**Author:** ![74westy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/74westy/32/3950_2.png) [@74westy](https://boards.straightdope.com/u/74westy)\
**Post date:** [March 12, 2013, 10:50pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/11 "2013-03-12T22:50:52Z")

</div>

> [@Blakeyrat](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Baron\_Greenback](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/baron_greenback/32/48_2.png) [@Baron\_Greenback](https://boards.straightdope.com/u/Baron_Greenback)\
**Post date:** [March 12, 2013, 10:53pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/12 "2013-03-12T22:53:59Z")

</div>

> [@Dog80](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Baron\_Greenback](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/baron_greenback/32/48_2.png) [@Baron\_Greenback](https://boards.straightdope.com/u/Baron_Greenback)\
**Post date:** [March 12, 2013, 10:55pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/13 "2013-03-12T22:55:20Z")

</div>

> [@Blakeyrat](#):
>
> Typically people use a RegEx to validate an email address; the RegEx solution is almost guaranteed to be wrong (unless they use [this one](http://ex-parrot.com/~pdw/Mail-RFC822-Address.html).)

😃 that’s quite the expression.

---

<div class="post-metadata">

**Author:** ![davidm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/davidm/32/225_2.png) [@davidm](https://boards.straightdope.com/u/davidm)\
**Post date:** [March 13, 2013, 1:39am UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/14 "2013-03-13T01:39:42Z")

</div>

> [@Blakeyrat](#):
>
> Typically people use a RegEx to validate an email address; the RegEx solution is almost guaranteed to be wrong (unless they use [this one](http://ex-parrot.com/~pdw/Mail-RFC822-Address.html).)

And that huge regex is guaranteed to be right?

---

<div class="post-metadata">

**Author:** ![Jas09](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jas09](https://boards.straightdope.com/u/Jas09)\
**Post date:** [March 13, 2013, 3:29pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/15 "2013-03-13T15:29:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Blakeyrat](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@Blakeyrat](https://boards.straightdope.com/u/Blakeyrat)\
**Post date:** [March 13, 2013, 5:21pm UTC](https://boards.straightdope.com/t/is-this-email-adress-format-valid-user-tld/652740/16 "2013-03-13T17:21:37Z")

</div>

> [@davidm](#):
>
> 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.
