The syntax for an email address is familiar to most Internet users. There should be a local part followed by the @ symbol and then the domain part. In both the local and domain parts, there are specifications published online which determine what characters are acceptable for either one. There specifications are called Requests For Comments (RFC). They are published by the Internet Engineering Task Force (IETF) and the Internet Society (ISOC), the principal technical development and standards-setting bodies for the Internet.
Local part
The local part can be up to 64 characters in length and consist of any combination of alphabetic characters, digits, or any of the following special characters:
NOTE: The period character (“.”) is valid for the local part subject to the following restrictions:
- it is not the first or last character
- two or more consecutive periods
Domain part
The domain part cannot be more than 255 characters in length and must conform to the specification for hostnames which is a list of dot-separated DNS labels. Each DNS label must not exceed 63 characters and should consist of any combination of alphabetic characters, digits and hyphens.
NOTE: A couple of restrictions apply to the DNS label:
- top level domains cannot be all numerics
- hyphens cannot be the first or last character
Internationalization
With the introduction of the Internationalized Domain Names, non-ASCII characters can now be used in both the local as well as the domain parts of an email address. UTF-8 characters are used to represent the non-ASCII characters such as Chinese & Japanese characters.
RFC references
Read more about the RFC standards:
- RFC 3696: https://tools.ietf.org/html/rfc3696
- RFC 5321: https://tools.ietf.org/html/rfc5321
- RFC 5322: https://tools.ietf.org/html/rfc5322
- RFC 6530: https://tools.ietf.org/html/rfc6530