There are major differences between how modern e-mail addresses are handled vs the e-mail addresses in the original standards.
From what I've experienced setting up dns & bind addresses you can specify a domain name without a period, but when the resolver is queried it will add the .
to the end of the domain name. You can also specify a straight mapping in a hosts file. Most hosts files contain resolve localhost like this:
127.0.0.1 localhost loopback
Meaning if you're on the server with the mail server you can send a valid e-mail to user@localhost
.
According to RFC 822:
In the case of formal registration, an organization implements a
(distributed) data base which provides an address-to-route mapping
service for addresses of the form:
person@registry.organization
Note that "organization" is a logical entity, separate from any
particular communication network.
A mechanism for accessing "organization" is universally avail- able.
That mechanism, in turn, seeks an instantiation of the registry; its
location is not indicated in the address specif- ication. It is
assumed that the system which operates under the name "organization"
knows how to find a subordinate regis- try. The registry will then
use the "person" string to deter- mine where to send the mail
specification.
The latter, network-oriented case permits simple, direct,
attachment-related address specification, such as:
user@host.network
In the case of user@host.network
on local systems as long as the email system is configured properly you can send emails to user@host
. Even though this isn't the FQDN - Fully Qualified Domain Name that we're used to now, that standard didn't come around until much later. The mail system then uses the alias to send it to the correct local network translating the email to user@host.network
. The problems with e-mail spoofing didn't come around until later when the ARPAnet became public.
About the comments in the address, that was not in RFC 822. According to the later email specification which allows comments (RFC 2822 Section 3.4):
Also, because some legacy implementations interpret the comment,
comments generally SHOULD NOT be used in address fields to avoid
confusing such implementations.
Meaning older systems do not allow comments in addresses. RFC 822 does not mention comments in the e-mail address.
The technical fix would be to not allow comments in the e-mail address unless you're accommodating them with custom code. You could always update Javamail. Newer implementations accommodate updated RFCs.