I think using example.com is a bit of a trick question. It is known as an example domain which is invalid for all purposes, except of course for serving as an example. :)
would be nice if what valid means was clearly defined before the test. what the rfc's regex allows is probably the least useful way to think about email validation.
As far as I know, that emoji question due to the same reason IDN is allowed in URLs, and they even went as far as their own RFC for it https://datatracker.ietf.org/doc/html/rfc6530 (very similar to the 6532 cited repeatedly, but more important(?) because every system in between the sender and recipient needs to know about hops, whereas the recipient is the terminal node's problem
The LHS is, as far as I know, because the LHS of _all_ email addresses is "if it's deliverable", modulo the rest of the call-outs from the rest of the quiz
* Single-label domains are problematic in several ways. Traditionally they are used as local abbreviations on the assumption that TLDs can’t be mail domains – tho that’s false, because several ccTLDs have had MX records at one time or another. Still, mail software can vary in whether it might treat single-label domains as abbreviations or TLDs or both. And there’s the historical anomaly that RFC 2821’s syntax disallows single-label domains; this was a drafting mistake not an intentional change.
* Spaces around local parts are valid or not depending on which spec you are following, so question 7 is badly framed. You need to be clear whether you are parsing a mail address as in the SMTP envelope, or an address and display name as in a message header.
* Similarly, comments are not valid in SMTP so the questions about comments are also poorly framed.
* And the syntax of domain literals / address literals is specified by SMTP, so question 16 and 18 are based on not reading enough of the RFCs.
I'm not sure if I'd count examples with spaces and comments towards valid emails, because one could argue these are not part of the address, they're email header syntax details. Like, sure, FWS from RFC can be used somewhere in the address, but it can also be in any other header. Also, CFWS and whatnot are going to get stripped anyway by the time you'd have to deal with SMTP (see Forward-path in RFC 5321, which doesn't allow `(nonsense in parentheses)`), so I don't think they should be considered part of the valid address anyway.
12 comments
[ 4.6 ms ] story [ 34.7 ms ] threadhttps://www.iana.org/help/example-domains
The LHS is, as far as I know, because the LHS of _all_ email addresses is "if it's deliverable", modulo the rest of the call-outs from the rest of the quiz
https://www.youtube.com/watch?v=xxX81WmXjPg
Maybe it's just a coincidence, but a shoutout would have been nice if not.
* Single-label domains are problematic in several ways. Traditionally they are used as local abbreviations on the assumption that TLDs can’t be mail domains – tho that’s false, because several ccTLDs have had MX records at one time or another. Still, mail software can vary in whether it might treat single-label domains as abbreviations or TLDs or both. And there’s the historical anomaly that RFC 2821’s syntax disallows single-label domains; this was a drafting mistake not an intentional change.
* Spaces around local parts are valid or not depending on which spec you are following, so question 7 is badly framed. You need to be clear whether you are parsing a mail address as in the SMTP envelope, or an address and display name as in a message header.
* Similarly, comments are not valid in SMTP so the questions about comments are also poorly framed.
* And the syntax of domain literals / address literals is specified by SMTP, so question 16 and 18 are based on not reading enough of the RFCs.
I was expecting a question about simple%example1.com@example2.com.
which I remember was a useful trick when I worked as a sendmail admin in the early 2000s.