Is validation necessary on last part of email address?

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Is validation necessary on last part of email address?

Post by raghavan20 »

example:

someone@somedomain.com

the last part can be com, co.uk, info, gov....

Q1. How many of you think that we should validate for the last part of the email address?

Q2. If you think we should validate, what are the conditions you would impose to be complied?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

This has been discussed a bunch of times. Search these forums.
As for validating the actual email address I use http://svn.gna.org/viewcvs/blacknova/tr ... iew=markup in combination with checkdnsrr()
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: Is validation necessary on last part of email address?

Post by Roja »

You left out the most important detail - Is validation neccessary for WHAT?

Are you trying to avoid sending emails to an invalid email account? Are you trying to avoid fake signups?

What goal are you trying to acheive?

If it is validation for the sake of validation, then my answer is that I accept nothing less than the best. :)
raghavan20 wrote:Q1. How many of you think that we should validate for the last part of the email address?
If you are trying to avoid invalid email accounts, or fake signups, then yes, you need to validate the entire email address. Not doing so means you aren't validating - you are testing portions of the email address.
raghavan20 wrote:Q2. If you think we should validate, what are the conditions you would impose to be complied?
I'll make it very easy for you.. here is my RFC-compliant function for validating email addresses:

http://svn.gna.org/viewcvs/blacknova/tr ... iew=markup

It takes an email address as its only input, and returns true or false, depending on its validity.

Please note, there is a difference between validating that an email is RFC-compliant (what my class does), and discovery of a valid email address from the server (which is unreliable at best).

For my game, the goal was to prevent invalid email addresses, so we wouldn't send emails to places that didn't exist. The fact that our signup sends a shared secret ensures that they will use an actual account, we just wanted to prevent typo's and the like.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

if you want absolutely valid email addresses, you could.. but as long as the address conforms to RFC standards, then it's technically legal.

If you want valid addresses, you will have to send an email to it as a challenge and response type system.. This email would need a link that provides a unique, one-time usable "activate" hook into your system. You may need to hook into your email server to check for any bounces so you can immediately terminate the activation window.
Post Reply