Earlier quoted context omitted.
For flip's sake, yes please! Close the loop, fer crying out loud. I got a popular givenname.familyname@gmail.com address and I frequently get mail that's meant for other people who share my name. The vast majority of the time it's the individual themselves who sign up for a service or offering but there's rarely a validation upfront. The best emails are the ones who extend full trust to the email recipient over some…
> The best emails are the ones who extend full trust to the email recipient over some account during that first email. [Random company,] shame on you. Well what else would you have them do? Have people enter their address and send letters there to do a password reset? A confirmation email before full trust is going to do little: a malicious person would just click that link, right?
The Correct Way to Validate Email Addresses
281–290 of 405 posts
Re: The Correct Way to Validate Email Addresses
#2821. Email validation regexp should be: /.+@.+/ => Tell the user to enter a valid email if that doesn't match.
2. Send a validation email to actually exercise the system
Re: The Correct Way to Validate Email Addresses
#283This check is done server side, while on the client I just use an html5 input[type='email'] with a required attribute.
Re: The Correct Way to Validate Email Addresses
#284Earlier quoted context omitted.
I am not sure what you are trying to say. Yes, of course, it costs money. Just like serving websites costs money. And just as checking the syntax of an email address costs money (CPUs cost money and need power to run!). Now, how is that an argument for checking the syntax of an email address to avoid sending a single email and seeing whether it bounces?
Sending a lot of bounced emails is going to get your mailservers reputation tanked, which is not an acceptable tradeoff for removing email validation. Email validation is actually really important if you send even a medium amount of email. Testing by bouncing is not a very good idea, especially since there are a lot of ways to test the deliverability of the email before you try and send it. That's not to say use a re…
?!?
OK, let's break this down: What could be reasons for an email to be bounced due to an invalid address?
1. Because the address is syntactically invalid: Your own email server will notice and reject/bounce the email. Noone outside your own server will notice.
2. Because the domain doesn't exist or has no inbound mailserver: Your own email server will do the DNS lookup(s) and bounce the email. Noone outside your own server will make any note of that (and you can't find out without doing DNS lookups anyway).
3. Because the localpart doesn't exist: You can't find that out without trying to actually send an email (and consequently risking a bounce).
So, what exactly was the point of email validation "without bounces" again?
The only thing you can actually do to avoid unnecessary bounces is to make sure your emails have a valid return path and to make sure that you somehow process all the bounces that arrive there to make sure that you don't continue sending emails to addresses that start sending bounces (i.e., that don't exist (any more)). If you send lots of mails, it's probably best to employ VERP for that.
Re: The Correct Way to Validate Email Addresses
#285The number of websites that try reject my email address with a + in it, ugh! Surprisingly, the validation is often done 100% client-side anyway, and simply modifying the incorrect regex lets my email address through... If I wrecked havoc on your back-end, then it's your fault for sucking ;)
Even worse is rejecting my password because it has a + in it! Why do you as a business care what my random password generator spit out?? Scarier still is when it's a server-side response that rejects my password for its contents...
In disbelief I logged out, tried again but this time I intentionally didn't use any special characters. It worked....
Re: The Correct Way to Validate Email Addresses
#286Earlier quoted context omitted.
> At no time is the plain text password stored anywhere Hopefully. When I see rules limiting passwords to 16 characters and disallowing SQL special characters, I'm having doubts.
My bank limits passwords at 15 characters. The best thing? There is no verification, it just cuts off. Have fun figuring out why you can not login anymore.
Re: The Correct Way to Validate Email Addresses
#287Earlier quoted context omitted.
For flip's sake, yes please! Close the loop, fer crying out loud. I got a popular givenname.familyname@gmail.com address and I frequently get mail that's meant for other people who share my name. The vast majority of the time it's the individual themselves who sign up for a service or offering but there's rarely a validation upfront. The best emails are the ones who extend full trust to the email recipient over some…
> The best emails are the ones who extend full trust to the email recipient over some account during that first email. [Random company,] shame on you. Well what else would you have them do? Have people enter their address and send letters there to do a password reset? A confirmation email before full trust is going to do little: a malicious person would just click that link, right?
Re: The Correct Way to Validate Email Addresses
#288In all my projects I use the same methods for validating an email address: 1) Does it contain a `@` 2) Split the string on the `@` and make sure that at least one character exists on both sides of the `@` 3) Send verification email. This check is done server side, while on the client I just use an html5 input[type='email'] with a required attribute.
Re: The Correct Way to Validate Email Addresses
#289For example in PHP I use filter_var function with the FILTER_VALIDATE_EMAIL [1] - while it's great to know why and how to do a particular thing programming, it's better to use a time tested library that is maintained by multiple eyes versus just your own.