1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
6 <title>The BNF from RFC 5322 defining parts of a valid internet message address</title>
10 <pre style="font-size:11px;">
11 addr-spec = local-part "@" domain
13 local-part = dot-atom / quoted-string / obs-local-part
15 dot-atom = [CFWS] dot-atom-text [CFWS]
17 CFWS = (1*([FWS] comment) [FWS]) / FWS
19 FWS = ([*WSP CRLF] 1*WSP) / obs-FWS
22 WSP = SP / HTAB ; white space
24 obs-FWS = 1*([CRLF] WSP) ; As amended in erratum #1908
26 ctext = %d33-39 / ; Printable US-ASCII
27 %d42-91 / ; characters not including
28 %d93-126 / ; "(", ")", or "\"
31 obs-ctext = obs-NO-WS-CTL
32 ccontent = ctext / quoted-pair / comment
34 comment = "(" *([FWS] ccontent) [FWS] ")"
36 dot-atom-text = 1*atext *("." 1*atext)
38 atext = ALPHA / DIGIT / ; Printable US-ASCII
39 "!" / "#" / ; characters not including
40 "$" / "%" / ; specials. Used for atoms.
50 specials = "(" / ")" / ; Special characters that do
51 "<" / ">" / ; not appear in atext
58 quoted-string = [CFWS]
59 DQUOTE *([FWS] qcontent) [FWS] DQUOTE
62 qcontent = qtext / quoted-pair
64 qtext = %d33 / ; Printable US-ASCII
65 %d35-91 / ; characters not including
66 %d93-126 / ; "\" or the quote character
69 obs-qtext = obs-NO-WS-CTL
71 obs-NO-WS-CTL = %d1-8 / ; US-ASCII control
72 %d11 / ; characters that do not
73 %d12 / ; include the carriage
74 %d14-31 / ; return, line feed, and
75 %d127 ; white space characters
77 quoted-pair = ("\" (VCHAR / WSP)) / obs-qp
79 VCHAR = %x21-7E ; visible (printing) characters
81 obs-qp = "\" (%d0 / obs-NO-WS-CTL / LF / CR)
83 obs-local-part = word *("." word)
85 word = atom / quoted-string
87 atom = [CFWS] 1*atext [CFWS]
89 domain = dot-atom / domain-literal / obs-domain
91 domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
93 dtext = %d33-90 / ; Printable US-ASCII
94 %d94-126 / ; characters not including
95 obs-dtext ; "[", "]", or "\"
97 obs-dtext = obs-NO-WS-CTL / quoted-pair
99 obs-domain = atom *("." atom)
101 NB For SMTP mail, the domain-literal is restricted by RFC5321 as follows:
103 Mailbox = Local-part "@" ( Domain / address-literal )
105 address-literal = "[" ( IPv4-address-literal /
106 IPv6-address-literal /
107 General-address-literal ) "]"
109 IPv4-address-literal = Snum 3("." Snum)
111 IPv6-address-literal = "IPv6:" IPv6-addr
114 ; representing a decimal integer
115 ; value in the range 0 through 255
117 IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
121 IPv6-full = IPv6-hex 7(":" IPv6-hex)
123 IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::"
124 [IPv6-hex *5(":" IPv6-hex)]
125 ; The "::" represents at least 2 16-bit groups of
126 ; zeros. No more than 6 groups in addition to the
127 ; "::" may be present.
129 IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
131 IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::"
132 [IPv6-hex *3(":" IPv6-hex) ":"]
134 ; The "::" represents at least 2 16-bit groups of
135 ; zeros. No more than 4 groups in addition to the
136 ; "::" and IPv4-address-literal may be present.