We are using the following validation code to check for a valid email address formatting on a web form driving by Lotus Notes:
@If((@ValidateInternetAddress([Address821]; @ThisValue)!=""
| @Contains(@ThisValue; "\"") | @Contains(@ThisValue; "'")
| @Contains(@ThisValue; " ")); "Please include a valid email address."; "");
Currently, if a user enters any of the following inputs, the verification throws the error message:
- empty field
- ” “, ‘, or / character
- the domain portion of the email: “test.com”
- only @
However, if a user enters test@test the form validates this as a valid email address format.
Is this format considered to be a valid “Address821” format? Or is the form validating an incorrect format as a valid email address?
Yes, it technically is valid address syntax, both by past and current standards.
The language in the RFC’s has evolved over time:
This isn’t very precise. It doesn’t explicitly say that there must be more than one element in the domain name, but it doesn’t explicitly prohibit it either. But this was obsoleted by:
This seems to be saying that it’s illegal, but actually it isn’t saying that. I’ll explain below, but first let’s have a look at the draft standard that is intended to obsolete 2821, and which clarifies things a great deal:
What this makes clear is that no dot is required in a domain name, as long as it is a top level domain.
@ValidateInternetAddress cannot reasonably know whether “test” is a valid top level domain. Even if IBM programmed in the list of approved public TLD’s (which IMHO would be a bad idea since it can and does change), you can in fact set up a private TLD called “test” in your own DNS. That’s not the same thing as a “local alias” which the standard does prohibit. There’s no rule against actual TLDs.
And for that matter, it could even be a public TLD. Theoretically, the owner of a TLD could set up a mail server for the TLD. I.e., President@US, or Queen@UK. Not likely, but possible in those cases, but with all the new TLD’s coming on line, I wouldn’t be surprised if some of the registrars are using info@domain.
I guess theoretically @ValidateInternetAddress could make the DNS call to check whether it can resolve “test” as a TLD, but the doc for that function only says that it checks the syntax of the address, and the existence of the TLD is a semantic issue, not a syntax issue.