Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> > ...@(valid)example.org(honest)

> Are those parens really permitted in the host name? I'm looking at RFC 3696.

RFC5322 states that an addr-spec consists of a local-part, followed by @, followed by a domain. It states that a domain may be a domain-literal; a domain-literal may begin and end with commented folding whitespace (CFWS). It's all in https://tools.ietf.org/html/rfc5322#section-3.4.1

It's only the dtext portion of the domain-literal which must consist of printable ASCII characters, not including [, ] or \.

Yes, foo@bar!baz!quux is a valid RFC5322 email address (decimal 33, i.e. !) is allowed, per the dtext production of the spec) — and so is foo@(comment (nested comment (escaped \(comment)))bar!baz!quux(another (comment (to prove) the point))

Whether one should ever actually use such an address is, of course, another matter entirely.



Thank you for that; this has been eyeopening.

The possibility of having a valid email address where the second-level domain component can't actually be registered as a domain, to the best of my understanding, eg "bar!.com", is interesting.


> The possibility of having a valid email address where the second-level domain component can't actually be registered as a domain, to the best of my understanding, eg "bar!.com", is interesting.

It is! Conceivably, it could be used to implement a new kind of domain-less mail system, e.g. foo@$megamail or something.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: