[whatwg] Comments on the definition of a valid e-mail address

On Aug 24, 2009, at 3:24 PM, Aryeh Gregor wrote:

>> Yup.  If it is deliverable then surely it's an alias to the same  
>> address
>> without the trailing dot, in which case a browser could choose to  
>> remove
>> it.
>
> Yes, it's not possible for "example.com." to mean anything different
> from "example.com".  (In fact they do mean something different in DNS,
> but "example.com." means the same thing as what "example.com" is
> normally used to mean.  Moreover, the meaning of "example.com" in DNS
> is basically nonsense for web apps processing user-submitted e-mail
> addresses.  At least, as far as I understand it; I don't know too much
> about DNS.)

Actually, the trailing dot is meaningful. A domain without a trailing  
dot is a relative domain; for example, if you are within the  
"example.com" domain, then "foo" could resolve to  
"foo.example.com" (or if that doesn't exist, then it would try  
resolving that at the root level, and fail since "foo" is not a TLD).  
A domain with a trailing dot is an absolute domain; it will only ever  
be resolved at the root level.

This difference may be significant. If someone manages to register the  
top level domain "mail" (which may be possible if the proposed new  
gTLD rules are passed), and has an email address of "foo at mail", then  
you might want to distinguish between that resolving to "foo at mail.wikimedia.org 
" vs. "foo at mail."

Of course, this is complicated because the trailing dot is technically  
not allowed in an email address, but it seems to work in some contexts  
that I've tried (though most just strip off the trailing dot).

About the more general subject of this thread, I have tested sending  
myself email at all of the following addresses, all of which seem to  
work just fine, though some generate warnings in my mail client (Apple  
mail):

Brian P. Campbell at dartmouth.edu
...brian...p...campbell... at dartmouth.edu
brian.p.campbell at dartmouth.edu.
Brian (this is a test) P (of comments) Campbell (and whitespace)@(here  
comes the domain) dartmouth.edu
brian p campbell

Note that Dartmouth has a very permissive email system that allows  
name components to be delimited by whitespace and/or periods, and  
prefixes of name components as long as you wind up with a unique  
match. And of course the address without the domain only works when  
I'm sending within the same domain. In some cases, the addresses were  
altered slightly in the process of being sent, for example 'Brian P. Campbell at dartmouth.edu 
' came through as '"Brian P. Campbell"@dartmouth.edu'.

Given that there are so many technically invalid addresses that  
actually do work to deliver mail, and that I'm sure some people have  
odd addresses due to poor form validation (perhaps someone has signed  
up for an email account on a web form and it allowed spaces in the  
address), it's probably best to be relatively lenient about the  
addresses allowed. I think the best you can do is look for at least  
one character, followed by an @ sign, followed by a legal domain name  
(which seems to be more strictly checked, though given the presence of  
IDNs, may not be easy to restrict in the future as well).

-- Brian

Received on Monday, 24 August 2009 13:33:41 UTC