pub enum AddressLiteral {
Reject,
Routable,
Rfc5321,
}Expand description
Which address-literal spellings the domain may take (RFC 5321 §4.1.3).
The grammar names three alternatives:
address-literal = "[" ( IPv4-address-literal /
IPv6-address-literal /
General-address-literal ) "]"A domain literal is refused unless asked for, so the default is
Reject. Of the two readings a caller can opt into, the
destination-oriented one, Routable, covers the first two
alternatives, which are the only ones mail can be delivered to. A reader of
an identity rather than a destination needs the third:
an X.509 rfc822Name is a Mailbox as RFC 5321 defines it (RFC 5280
§4.2.1.6), and refusing a spelling the grammar names makes the certificate
carrying it unreadable rather than merely unroutable.
Variants§
Reject
Reject every [...] domain literal.
Routable
Accept only a literal naming a routable destination: an IPv4 dotted-quad
or an IPv6:-tagged IPv6 address.
Stricter than the grammar in one place, deliberately: RFC 5321 Snum is
1*3DIGIT in the range 0..=255 with no rule against padding, so
[012.0.2.1] is inside the grammar. It is rejected here because a
zero-padded octet is read as octal by some resolvers, and a destination
that resolves two ways is not one. Use Rfc5321 to read
the grammar as written.
Rfc5321
Accept every alternative the grammar names, General-address-literal
included, so postmaster@[AS400:QSYS] parses.
General-address-literal = Standardized-tag ":" 1*dcontent
Standardized-tag = Ldh-str
dcontent = %d33-90 / %d94-126The IPv6 tag keeps its own alternative’s meaning: RFC 5321 §4.1.3
requires a standardized tag to be defined by a Standards-Track RFC, and
IPv6 is, so [IPv6:...] must still hold an IPv6 address and is not
reinterpreted as free dcontent.
Trait Implementations§
Source§impl Clone for AddressLiteral
impl Clone for AddressLiteral
Source§fn clone(&self) -> AddressLiteral
fn clone(&self) -> AddressLiteral
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more