Checking if email is valid

Jon Ribbens jon+usenet at unequivocal.eu
Sun Nov 5 07:48:04 EST 2023


On 2023-11-05, D'Arcy Cain <darcy at VybeNetworks.com> wrote:
> On 2023-11-05 00:39, Grant Edwards via Python-list wrote:
>> Definitely. Syntactic e-mail address "validation" is one of the most
>> useless and widely broken things on the Interwebs.  People who do
>> anything other than require an '@' (and optionally make you enter the
>> same @-containing string twice) are deluding themselves.
>
> And don't get me started on phone number validation.  The most annoying 
> thing to me, though, is sites that reject names that have an apostrophe 
> in them.  I hate being told that my name, that I have been using for 
> over seventy years, is invalid.

Sometimes I think that these sorts of stupid, wrong, validation are the
fault of idiot managers. When it's apostrophes though I'm suspicious
that it may be idiot programmers who don't know how to prevent SQL
injection attacks without just saying "ban all apostrophes everywhere".
Or perhaps it's idiot "security consultancies" who make it a tick-box
requirement.

> OK, now that I am started, what else?  Oh yah.  Look at your credit 
> card.  The number has spaces in it.  Why do I have to remove them.  If 
> you don't like them then you are a computer, just remove them.

Yes, this is also very stupid and annoying. Does nobody who works for
the companies making these sorts of websites ever use their own, or
indeed anyone else's, website?

Another one that's become popular recently is the sort of annoying
website that insists on "email 2FA", i.e. you try to login and then
they send you an email with a 6-digit code in that you have to enter
to authenticate yourself. So you go to your mail client and double-click
on the number to select it, and stupid thing (A) happens: for no sane
reason, the computer selects the digits *and also an invisible space
after them*. Then you copy the digits into the web form, then invisible
space tags along for the ride, and stupid thing (B) happens: the web
server rejects the code because of the trailing space.

Honestly I don't understand why every web application platform doesn't
automatically strip all leading and trailing whitespace on user input
by default. It's surely incredibly rare that it's sensible to preserve
it. (I see Django eventually got around to this in version 1.9.)


More information about the Python-list mailing list