6

I noticed that the built-in browser validation for <input type="email" /> requires a format of xxx@xxx. Only the @ character is required. There is no need to a dot, like email@stackoverflow.com.

It is the same with the popular jQuery.inputmask, the rule of email alias does not require the dot, either.

I am just curious. Is it a standard way to ignore the dot in email validation now? I haven't seen any email address on the root level domain. What is the reason to ignore the dot?

Blaise
  • 19,524
  • 23
  • 98
  • 161
  • 3
    possible duplicate of [Why does HTML5 form-validation allow emails without a dot?](http://stackoverflow.com/questions/20573488/why-does-html5-form-validation-allow-emails-without-a-dot) – JJJ Jan 16 '15 at 21:19
  • emails are complicated, almost anything containing `@` could be an email, even `bill@com`, which is why validating too strict tend to lead to problems. – adeneo Jan 16 '15 at 21:25
  • Thanks, Juhana. It appears to be duplicate. – Blaise Jan 16 '15 at 21:29
  • [Play framework](https://playframework.com/documentation/1.4.1/api/play/data/validation/EmailCheck.html) requires a dot in the domain, unfortunately, since MS userPrincipalName (also based on RFC-822) validates without a dot. – Nati Jan 04 '17 at 20:14

1 Answers1

11

The RFC 822, chapter 6, gives the specification of an address in augmented Backus-Naur Form (BNF):

addr-spec   =  local-part "@" domain
local-part  =  word *("." word)
domain      =  sub-domain *("." sub-domain)

Using this specification a@b is a valid address.

Ortomala Lokni
  • 48,718
  • 17
  • 164
  • 211
  • 3
    The spec is stupid, because every email address in real life has a .com, .net, etc. It is a somewhat common user error to forget that ending, so in real life, following the spec means a lot of faulty email addresses get accepted. – Acyra Mar 10 '16 at 15:44
  • 2
    @Acyra, the spec is not stupid at all, since `user@localhost` is a perfectly valid email, and so is something like `user@com`. An example of the second type, where a TLD can point to something is the domain `uz` as of Oct. 2018. See results for `nslookup uz` if you're curious. – pulsejet Oct 07 '18 at 18:42