Zythan wrote:Hello,
Would any of these be considered as valid email addresses ?
It may seem odd, but yes. They are valid email addresses - according to the RFC.
Here is why on each:
jean.dupont@free.236.com.1 - You could have a local intranet named "1". In such a scenario, you can define subdomains like com.1, 236.com, and yes, even free.236.com.1 jean.dupont is a completely valid first portion of the email.
jean.dupont@free.236.com1 - Again, you could have a local intranet named "com1".
fred.bloggs@orange_co.uk - Nothing wrong here. You can have a local intranet named .uk, and you can indeed make it have a subdomain orange_co.
fred_bloggs@orange_co.32 - Still not a problem. The intranet name is "32", and the subdomain is orange_co. Underscores in the opening portion of the name are legal as well.
You seem to be hoping that the RFC prevents
unroutable emails, which it is not designed to do. If you have that as a goal, then you will want to do a second step of validation - namely, doing a dns lookup on the portion of the email after the @ sign.
The RFC isn't intended to ensure valid dns addressing. Remember, the email address format came about *before* the internet existed, when local nets were the norm, not working dns. In the years since, the value in allowing LAN emailing addresses to work continued to be valuable.
But even with a validation of the RFC format, AND a check of the dns, you still have no guarantee of a routable email. You can then also go further by checking to see:
- If the dns has a MX record
- If the domain has a mailserver responding at all - and at the MX record (which may be a *different* domain)
- If the mailserver, responding at the IP given by the MX record is willing to accept an email at all (most lie to avoid spam harvesting)
- If it does all of the above, you can send, and it could STILL be refused.
The point is, email is tricky. There are steps along the way, and just because *one* step doesn't do all of them, that doesn't make it invalid. The function is accurate to the RFC. You are expecting too much from the RFC.