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 5321 defining parts of a valid SMTP address</title>
10 <pre style="font-size:11px;">
11 Mailbox = Local-part "@" ( Domain / address-literal )
13 Local-part = Dot-string / Quoted-string
14 ; MAY be case-sensitive
17 Dot-string = Atom *("." Atom)
21 Quoted-string = DQUOTE *QcontentSMTP DQUOTE
23 QcontentSMTP = qtextSMTP / quoted-pairSMTP
25 quoted-pairSMTP = %d92 %d32-126
26 ; i.e., backslash followed by any ASCII
27 ; graphic (including itself) or SPace
29 qtextSMTP = %d32-33 / %d35-91 / %d93-126
30 ; i.e., within a quoted string, any
31 ; ASCII graphic or space is permitted
32 ; without blackslash-quoting except
33 ; double-quote and the backslash itself.
35 Domain = sub-domain *("." sub-domain)
37 sub-domain = Let-dig [Ldh-str]
39 Let-dig = ALPHA / DIGIT
41 Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig
43 address-literal = "[" ( IPv4-address-literal /
44 IPv6-address-literal /
45 General-address-literal ) "]"
48 IPv4-address-literal = Snum 3("." Snum)
50 IPv6-address-literal = "IPv6:" IPv6-addr
52 General-address-literal = Standardized-tag ":" 1*dcontent
54 Standardized-tag = Ldh-str
55 ; Standardized-tag MUST be specified in a
56 ; Standards-Track RFC and registered with IANA
58 dcontent = %d33-90 / ; Printable US-ASCII
59 %d94-126 ; excl. "[", "\", "]"
62 ; representing a decimal integer
63 ; value in the range 0 through 255
65 IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
69 IPv6-full = IPv6-hex 7(":" IPv6-hex)
71 IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::"
72 [IPv6-hex *5(":" IPv6-hex)]
73 ; The "::" represents at least 2 16-bit groups of
74 ; zeros. No more than 6 groups in addition to the
75 ; "::" may be present.
77 IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
79 IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::"
80 [IPv6-hex *3(":" IPv6-hex) ":"]
82 ; The "::" represents at least 2 16-bit groups of
83 ; zeros. No more than 4 groups in addition to the
84 ; "::" and IPv4-address-literal may be present.