Is username@gtld a valid email? i.e. there is no “domain” portion, it is just a TLD for the hostname

社会主义新天地 提交于 2019-12-24 04:41:10

问题


So would username@gtld be a valid email? As a practical example google is purchasing the gTLD "gmail". Obviously they can associate A records with that permitting you to just type http://gmail/ to access the site. But, are there any specs that prohibit them from associating MX records with that as well, allowing folks to give out an alternative address username@gmail?

I ask because I want to make sure our email validator is future proof and technically correct.


回答1:


I think I answered my own question. Section 3.4.1 of rfc5322 which defines a valid email address states:

addr-spec = local-part "@" domain [...] domain = dot-atom / domain-literal / obs-domain [...] The domain portion identifies the point to which the mail is delivered. In the dot-atom form, this is interpreted as an Internet domain name (either a host name or a mail exchanger name) as described in [RFC1034], [RFC1035], and [RFC1123]. In the domain-literal form, the domain is interpreted as the literal Internet address of the particular host.

"gmail" would be a valid domain and host name and thus someone@gtld is a valid email address.



来源:https://stackoverflow.com/questions/25982111/is-usernamegtld-a-valid-email-i-e-there-is-no-domain-portion-it-is-just-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!