Take the address
foo:bar <[email protected]>
As I understand it the colon in the display name foo:bar, being a special character, should be part of a quoted string, e.g. "foo:bar" <[email protected]>
In this next example the display name foo:bar is in an (RFC2047?) encoded word, but the colon isn't quoted before encoding. Is this a legal address? I've run into a tool that won't accept it, but I'm unsure if it's a bug or strictly correct behaviour.
=?UTF-8?B?Zm9vOmJhcg==?= <[email protected]>
I guess the other way of putting question is, should the RFC5322 validation be done before or after the RFC2047 header decoding?
RFC 2047 6.2 says:
display-nameis a token, so my reading of the spec is that your last example is a valid address - the validation should be done on the encoded value, and then decoded for display later.Section 5 also says:
So in this example you'd be encouraged to use the quoted form
"foo:bar" <[email protected]>, and not use unnecessary encoded words.