Email address
An email address is a short piece of text that names a mailbox, the place where Email for a person, group, or system is delivered. It has two parts joined by the at sign (@). The local part names the mailbox, and the domain names where it is kept, as in jane.doe@example.com.[1]
Mail servers use the domain to find the computer that accepts mail for it, then hand the message over. Only the destination host reads the local part.[2] The rules for addresses are set by Internet standards called Requests for Comments (RFCs), mainly RFC 5321 and RFC 5322.
Parts of an address
Every address has the form local-part@domain.[2]
- Local part: the text before the @. The receiving host reads it as the name of one of its mailboxes.[1] It is often a user name, but today it is used for much more than user names.[2]
- At sign: the character @ (ASCII value 64) splits the local part from the domain.[1]
- Domain: the text after the @. It is usually an Internet domain name and names the point where the mail is delivered.[1] A domain is made of labels joined by dots, and for mail each label uses only letters, digits, and hyphens.[2]
The standards tell apart the address (a name) and the mailbox (the place where mail is put). In practice the two words are often used to mean the same thing.[2] A mailbox is an idea and need not be a file. RFC 5322 notes that a site could even print mail and deliver the paper to the addressee's desk.[1]
How mail reaches an address
Delivery uses the domain part first and the local part last. The sending server finds the receiving server through the Domain Name System (DNS), the Internet's directory of names. It then sends the message with the Simple Mail Transfer Protocol (SMTP).[2]
- The sending server takes the domain from the address and must look it up in DNS.
- It first asks for the domain's MX records (mail exchanger records). Each record names a mail server and has a preference number.
- It tries the servers in order. Lower numbers go first, and servers with equal numbers are tried in random order to spread the load.
- If the domain has no MX records, the domain itself is treated as the mail server. This is called an implicit MX with preference 0.
- The sender connects to the chosen server and names the full address as the recipient.
- The server at the destination reads the local part and puts the message in that mailbox.
Steps 1 to 4 follow RFC 5321, section 5.1.[2] The chosen server may be a relay that passes the mail on rather than the final host.[2]
Only the host named in the domain may give the local part a meaning. RFC 5321 requires this because servers along the way that changed local parts caused a long history of problems.[2]
Allowed characters
The full syntax has two forms for the local part and two for the domain.[1] Most real addresses use the simplest form of each.
| Part | Form | Example | Notes |
|---|---|---|---|
| Local part | Dot-atom (plain) | jane.doe |
Letters, digits, and certain symbols, with single dots between them |
| Local part | Quoted string | "Jane Doe" |
Any printable ASCII character or space, inside double quotes (with " and \ escaped) |
| Domain | Domain name | example.com |
Labels of letters, digits, and hyphens |
| Domain | Address literal | [192.0.2.1] |
An IP address in square brackets |
The plain local part
Without quotes, a local part may use letters, digits, and these symbols:[3]
! # $ % & ' * + - / = ? ^ _ ` . { | } ~
A dot may not start or end the local part, and two dots may not appear in a row.[3] When a local part can be written in this plain form, standards say it should be.[1]
Quoted local parts
Other characters need quoting. These include the at sign, backslash, double quote, comma, square brackets, and space.[3] Inside quotes, a backslash makes the next character literal. For example, Joe\,Smith is a nine-character user name whose fourth character is a comma.[2]
Quoted forms are rare. Hosts should avoid creating mailboxes that need them, but programs that check addresses should still accept them and pass them on.[2][3]
Domain names and address literals
A domain used in mail must be a fully qualified domain name that DNS can look up. Local nicknames are not allowed.[2] Writing an IP address in square brackets instead of a name is strongly discouraged except for testing and fault finding.[3]
Length limits
RFC 5321 sets size limits for the parts of an address, measured in octets. An octet is one 8-bit byte. Every mail server must accept parts at least this long, and senders should avoid longer ones when possible.[2]
| Item | Limit | What it covers |
|---|---|---|
| Local part | 64 octets | Text before the @ |
| Domain | 255 octets | Text after the @ |
| Path | 256 octets | The address in an SMTP command, including punctuation |
Why the practical maximum is 254
Adding the first two limits gives 64 + 1 + 255 = 320 octets. The path limit is lower and decides the real maximum.[3][4]
- In an SMTP command, the address is written inside angle brackets, as in
<jane@example.com>. - The whole path, brackets included, may be at most 256 octets.
- The two brackets use 2 octets, so the address itself can be at most 256 − 2 = 254 octets.
A published correction (erratum) to RFC 3696 makes this point and says the upper limit should normally be taken as 254.[4]
Upper and lower case
The two halves of an address follow different case rules.[2]
- Domain: not case sensitive, because it follows normal DNS rules.
EXAMPLE.COMandexample.comare the same. - Local part: mail software must keep its case unchanged, because some hosts treat
smithandSmithas different users. Relying on this is discouraged, since it makes mail less reliable between systems.
Some standard mailbox names, such as postmaster, must be recognized in any case.[2][5]
Display names and where addresses appear
An address usually travels in two places in a message. One is the header that readers see. The other is the envelope that servers use to route the mail.
Display names in the header
Header fields such as From and To can pair an address with a display name, the name an email client shows. The address then goes in angle brackets:[1]
Jane Doe <jane.doe@example.com>
Some older programs put the name in parentheses after the address as a comment. RFC 5322 says to use the angle-bracket form instead.[1]
Groups
Several mailboxes can be named as one group. The group form is a display name, a colon, a comma-separated list of mailboxes, and a semicolon. The list may be empty, which tells readers the message went to a named set of people without listing their addresses.[1]
Envelope addresses
SMTP carries its own sender and recipient addresses, separate from the header. RFC 5321 recommends that the mail program give the server an envelope separate from the message. If a mail program supplies no separate envelope, recipients from the To, Cc, and Bcc fields should be copied into it, and the Bcc field should then be removed from the header.[2]
Envelope and header addresses can differ. For example, a mailing list changes the envelope return address to the list's administrator but leaves the header's From field as it was.[2]
SMTP itself does not check that a sender's address is real or belongs to the sender. Methods such as SPF and DKIM were developed for that purpose.[2] See email authentication and email spoofing.
Special kinds of addresses
Role addresses
Some local parts name a job rather than a person. Every server that relays or delivers mail must accept mail for postmaster, in any mix of upper and lower case.[2] RFC 2142 lists other role names, including abuse for complaints, hostmaster for DNS, and webmaster for websites.[5]
Subaddresses
Some mail systems let users add extra detail to the local part, a practice called subaddressing. A common style uses a separator such as + between the user and the detail.[6] For example, a message to ken+sieve@example.org may be delivered to a folder called "sieve" that belongs to the user ken.[6]
The format is set by each site. Another system may treat + as an ordinary character, so senders must pass such addresses on unchanged.[6][3]
Aliases and lists
One address can stand for many. When mail reaches such an address, the server swaps it for a list of real addresses and sends a copy to each.[2] An alias leaves the rest of the envelope alone. A list also changes the return address, so error reports go to the list administrator instead of the original sender.[2]
Addresses in other languages
The base standards limit the local part to a subset of 7-bit ASCII, the basic English character set.[7] Domain names could already use other scripts through internationalized domain names.[7] A set of standards published in 2012 extends this to the whole address, so people can use their own names in their own scripts.[7]
| Piece | What it does |
|---|---|
| SMTPUTF8 | An SMTP extension. A server that offers it must accept a UTF-8 string anywhere a mailbox can appear.[8] |
| UTF-8 headers | Header fields may carry Unicode characters encoded in UTF-8 directly.[7] |
| Same structure | Non-ASCII characters are allowed in the local part, but the way the address is split up and the separators, including @, are unchanged.[8] |
There is no guarantee that the next server supports the extension, so sending to such an address can fail.[8] If the first server does not support it, the sender should either use plain ASCII addresses or return the message to the user. That fallback needs an ASCII address for every sender and recipient.[7]
Checking addresses
Many programs test whether text looks like an email address, often with a regular expression. Strict tests often reject valid addresses. RFC 3696 says quoted forms and the symbols listed above are valid and should be passed to the mail system, not filtered out.[3]
The HTML standard for web forms knowingly departs from RFC 5322. It calls the RFC syntax too strict before the @, too vague after it, and too loose in allowing comments, white space, and quoted strings.[9] Web browsers therefore check type=email fields against a simpler grammar of their own.[9]
A syntax check cannot show that a mailbox exists. Only the destination host decides what a local part means.[2]
History
The first network addresses
Ray Tomlinson of BBN wrote the first program for sending mail between computers on the ARPANET in 1971, by combining the SNDMSG and CPYNET programs.[10] SNDMSG let users leave messages for one another on the same machine, and CPYNET let users send and receive files between computers.[11] Tomlinson chose the @ sign to join the user name to the destination.[12]
Tomlinson was also a co-author of RFC 561 (1973), the first standard for Internet email message formats.[12]
Standard formats
The ARPANET's informal mail practices were written down in RFC 733 in 1977. RFC 822, dated August 13, 1982, replaced it and used a different addressing scheme to handle mail between networks.[13] RFC 822 was later replaced, and its successor today is RFC 5322, published in 2008 alongside RFC 5321 for SMTP.[1][2]
From routes to MX records
Early addresses sometimes carried routing information. An SMTP source route lists relay hosts before the mailbox, as in <@hosta.int,@jkl.org:userc@d.bar.org>.[2] Some older systems put the route inside the local part, as in user%foo@example.com.[7] MX records in DNS, described in RFC 974 (1986), made explicit source routes unnecessary, and senders should not create them now.[2]
References
- RFC 5322: Internet Message Format, IETF, 2008.
- RFC 5321: Simple Mail Transfer Protocol, IETF, 2008.
- RFC 3696: Application Techniques for Checking and Transformation of Names, IETF, 2004.
- Erratum 1690 to RFC 3696, RFC Editor.
- RFC 2142: Mailbox Names for Common Services, Roles and Functions, IETF, 1997.
- RFC 5233: Sieve Email Filtering: Subaddress Extension, IETF, 2008.
- RFC 6530: Overview and Framework for Internationalized Email, IETF, 2012.
- RFC 6531: SMTP Extension for Internationalized Email, IETF, 2012.
- HTML Standard, section 4.10.5.1.5: Email state, WHATWG.
- Ray Tomlinson, Lemelson-MIT Program.
- Ray Tomlinson sends the first email, Centre for Computing History.
- Raymond Tomlinson, Internet Hall of Fame.
- RFC 822: Standard for the Format of ARPA Internet Text Messages, RFC Editor, 1982.
