`user@domain.c` validates to true when checking wh...
# cfml-general
w
user@domain.c
validates to true when checking whether it's a valid email (using the most commonly used regex) since the underlying spec for email addresses apparently allows one letter TLDs even though they aren't used. my question for anyone willing to answer is whether OUR email validation function should allow single letter TLDs per the spec or whether OUR validation should return false on the premise that no person would have such an email (or hamfisted entering a 'valid' one)
basically, should we disallow one letter TLDs because they're not currently legitimately in use, even though it's 'alowed'
p
Agree
w
with which?
p
We should not allow as valid for 1 letter TLD
w
i'm inclined to agree, but still torn
p
or ability to define custom but then it becomes a custom validator
if it literally doesnt exist in current, then it is technically Invalid
w
the main issue is trying to protect against mistyped emails
even though supposedly for my example i should allow it since the spec does
or so i understa nd
p
Usually for domains with typos there is a need to have a suggested if the domain looks “close” to gmail when typing “gmial” for example; “Did you mean to have gmail.com?"
or just offer a lot of the common domains as fill-in options
w
sure, will consider that as well
p
similar how smart tv’s offer the remaining @domain.com when trying to Auth to an app like Netflix etc
w
not all emails i need to validate are user input per se, most are coming in through integrations, but still need to be validated.
i could just find a new job. that would also be a solution.
💯 1
p
haha, yea lots of algorithms in that fiasco
should be at the forefront of users’ intial input
b
My local newspaper flags my email address as invalid even though it's in the form abc@abcd.com.