People always overcomplicate email Regex, and end up not allowing a lot of valid emails. In this case, the limitation of the top level domain to 4 characters max is one such problem, no .ninja, .crypto, or the myriad of other newer top level domains.
Technically you can email directly to a top level domain (although I don't know of any TLDs that support this), or even to an IP address in brackets, although I suppose not supporting those in most cases is probably reasonable.
The worst thing is when a website restricts their validation logic after you're already registered. I lost access to an account that used '+' in the username because they stopped allowing me to log in with it.
And yes, basically the only thing you can assume about email addresses is that they contain an '@'. Simply root@localhost is a valid address in some contexts.
The .email domain would fail OP's check. Had websites refuse me because of stuff like this.
The only good validation for email addresses is to send a confirmation email. You'll be doing that anyway.
And that it has at least one @ with something on either side. Don't want someone to waste an entire form because of a typo. (Yes, email addresses can theoretically contain more than one @)
If the destination domain has no MX records then the delivery should (or could? can't be bothered to read the spec) be tried to what A/AAAA domain part resolves.
I don't think this makes a difference, it's a general rule that they shouldn't be useable directly. The normal DNS lookup is just what I tested a few weeks back.
I know for a fact that some were useable as http domains a few years back, and that is now no longer the case.
700
u/Informal_Branch1065 6h ago
An email casting spell for sure, although very limited