View Full Version : Miscellaneous Hacks - Check E-mail Address Before Registration
echamberlain
04-10-2007, 10:00 PM
This mod checks that the user supplied e-mail address is a real address before allowing registration to continue.
Even though we use Verify Email address in Registration, I still get tired of cleaning up bad e-mail addresses.
This mod integrates with the user registration process and performs the following tasks:
Syntax checking (configurable) to make sure what was entered is an e-mail address.
Looks up the MX records for the e-mail address.
Cycles through the mail servers by connecting to each mail server and tries to verify that the e-mail address is a valid address. The cycling stops as soon as a mail server returns a valid or invalid user.Installation
Install the attached xml product file. The product is active at installation and most sites should run fine with the default settings.
If you run the default configuration, e-mail addresses will be rejected when:
Syntax doesn't look like an e-mail address
MX record or A record does not exist for the e-mail domain
A mail server reports that the e-mail address is invalidIf you run the default configuration, e-mail address will pass when:
Syntax looks like an e-mail address
MX record or A record exists for the e-mail domain
All mail servers timeout or a mail server reports that the e-mail address is valid.Configuration
This mod is managed from the vBulletin Options -> User Registration Options page. The following options are added to the page:
Validate Registration E-mail Addresses - Enter a regular expression to use when validating e-mail addresses. Leave the field blank to disable validation. The recommendation is to use the default value.
Treat E-mail Address As Valid If All Mail Hosts Timeout - If all the mail hosts timeout, should the e-mail address be treated as valid?
NOTE: Changing this to no will reject valid users when your hosting provider doesn't allow fsockopen calls or when the timeout value is too short. The SMTP RFC's allow for a connection request response wait time of up to minues, since this test is real-time with a waiting user, waiting minutes is impractical. Just because a host timesout doesn't mean the host is not there.
Mail Host Timeout Value (Seconds) - Length of time to wait when trying to open a session with a mail host.
NOTE: Don't set this value too large, if a domain has more than one MX record, the user will have to wait for each connection attempt.
Does This Host Support fsockopen? - A PHP fsockopen call is used to try and connect to the remote mail servers. Some systems may not support or block these calls. With the value set to Yes, the connection attempts will timeout. GoDaddy's Shared Hosting is an example of a hosting provider that blocks outbound connection attempts.
With this value set to no, the system will try to look up the MX records, but will not attempt to connect to each mail server.
Terminatoronly
04-11-2007, 06:21 PM
Cool First Install :D
This Is Awsem :D
mathias
04-11-2007, 06:46 PM
do spam bots use working emails?
Queball_Beast
04-11-2007, 06:48 PM
Awesome, i`ll be installing this and clicking installed :) it will be handy with preventing spammer registrations also
rjmjr69
04-11-2007, 07:34 PM
Nice I like installed
HMBeaty
04-11-2007, 07:43 PM
AWESOME!! Thank you!!
/me installs
puertoblack2003
04-11-2007, 08:43 PM
thanks another great hack.it should be a vb default :)
Mr Chad
04-11-2007, 11:11 PM
nice man
menababu
04-11-2007, 11:40 PM
thanks man install.hope to work great.
Hornstar
04-12-2007, 12:55 AM
This is exactly what I had suggested about 6 months ago, was not sure if this was possible, but thought it would be the perfect thing. Thanks heaps!
When your forums become large, you get so many people who think they can register with a fake email address eg. 123@fake.com and then some of them will contact you, saying they accidently typed in the wrong email address, others will probably sign up again, or just give up.
Just one question tho what happens if the mail server is temporary down?
echamberlain
04-12-2007, 01:43 AM
Just one question tho what happens if the mail server is temporary down?
If you are running the default configuration, and there are no other mail servers listed in the MX record, the e-mail address will be accepted. If there are other mail servers, they will be tried.
Note that sometimes backup mail servers will accept mail for any user *@domain.com, so this method is not perfect.
But it should catch the fake hotmail, yahoo, and gmail accounts.
I installed this mod in my production environment right before I posted it and my bounced activation mail is already down 80%.
popowich
04-12-2007, 03:30 AM
Nice hack. How about making the "contact us" a link in the error message?
-Raymond
MaestroX
04-12-2007, 06:30 AM
Very nice, thankyou
Barakat
04-12-2007, 10:14 AM
thanks a lot
msimonds
04-12-2007, 01:02 PM
I installed this and tried to register with a fake email address from my own domain and it still allowed me to register
I thought that it validated emails to see if they were good before allowing registration?
msimonds
04-12-2007, 01:12 PM
I also tried again to register with an invalid yahoo account and it is not working
bitdefuser
04-12-2007, 02:53 PM
Yea, if you enter a valid domain such as yahoo.com, it lets it go. However, if you enter something like 1210@adsasdasd.com , it's invalid.
It's still a nice product though. :) (I think it lets it go because of the '2' seconds setting in the options. It said that if it timed out, it lets the registration go.)
echamberlain
04-12-2007, 10:09 PM
Nice hack. How about making the "contact us" a link in the error message?
-Raymond
I was thinking about adding that. I haven't written any mods that pass variables to error phrases, so I would need to do some research.
echamberlain
04-12-2007, 10:15 PM
I installed this and tried to register with a fake email address from my own domain and it still allowed me to register
I thought that it validated emails to see if they were good before allowing registration?
Acording to the forum, you don't have it installed. :)
As I listed in the instructions, whether an e-mail address is rejected or not depends on a lot of factors that are outside of the controll of vBulletin.
Some things to check would be:
1. Does the host running vBulletin support fsockopen?
2. Check if your mail server has an answer delay that exceeds the mod timeout.
3. Check if your mail server is configured to reject mail as soon as an invalid user is specified in the MAIL TO field or if it will still accept the message.
Phooey
04-13-2007, 01:07 AM
Awesome. *clicks install*
pspcrazy
04-13-2007, 01:48 AM
SWEET! I been all over for this , it is soooo great. I thank you from the bottom of my heart.
FreshFroot
04-13-2007, 09:54 PM
mabye you have your pop email set, so it sends all emails to the root username. Therefore it might think there is a valid email?
Muellmann
04-14-2007, 11:14 AM
I waited such hack, I guessed that "live-checking" of mailaddresses is possible via sockets.
Works fine for me in my older 3.6, but some big providers like "yahoo.com" report for every fantasy mail the status valid mailaddress unfortunately.
But however this hack stops most bots and reduces fake mail registrations and so
I installed and also nominated it as motm.
It's a real alternative to the activation mails. 80% of my users remained inactive with mail confirmation switched on, because they weren't able to click the mail verfication link somehow. So this hack is a real alternative to this and how someone already mentioned it, it should be a default build in feature of vbulletin.
Thank you very much for this clever hack. :cool:
Neo_Angelo
04-14-2007, 04:16 PM
*neo clicks install* great pieces of kit i'll be using to prevent spam bots, thanks a bunch ^_^
Mrdby
04-14-2007, 06:14 PM
installed
stwilson
04-15-2007, 04:39 AM
Sounds like a nice hack but I could not get it to reject anything for me. I'm not sure if my host supports fsockopen but it did not reject for me with the fsock setting set to yes or no. Wish I could use this.
josiespencer
04-17-2007, 10:14 PM
I searched this thread and could not find the answer. What port does this mod require for fsockopen, 25 or 80?
echamberlain
04-18-2007, 06:00 PM
The mod connects via fsockopen to the mail servers on TCP port 25.
rolfw1
04-18-2007, 06:19 PM
Great mod. :)
Installed, hopefully save a lot of weeding out time. :)
Thanks very much.
Doug Nelson
04-22-2007, 10:52 AM
It seems to work well. So far only one problem: a perfectly valid email address got the "We were unable to contact your e-mail server and verify that your e-mail address exists" message? I have the default settings. Ideas on what happened? If (as the message claims) it could not contact the server, it should have approved the address. So the server must have said the address was invalid, except that I know it is valid.
Emre Goren
04-22-2007, 11:07 AM
great stuff..installed
dune3000
04-22-2007, 04:20 PM
Install the attached xml product file
What exactly I have to do ?
Sorry, I'm new to this :erm:
Doug Nelson
04-22-2007, 09:52 PM
I had to disable this. 20+ successful registrations since I installed it, but I'm also getting complaints from users of recognized ISPs that they're being denied registration.
popowich
04-22-2007, 10:33 PM
What ISP's do those members use?
-Raymond
Doug Nelson
04-22-2007, 10:53 PM
cox.net and comhem.se
Mrdby
04-23-2007, 12:19 AM
same here...UNINSTALL
josiespencer
04-23-2007, 07:34 PM
I asked my host provider to allow to enable fsockopen on port 25. They responded:
Dear Customer,
Sorry we do not allow this ability. You will have to use port 26 and authenticate against a valid email account hosted on your account with us.
If you have any further questions please let us know.
Regards, Scott Dennis
Level 2 Technical Support Team
Mrdby
05-09-2007, 11:48 PM
Uninstalled
irishblacknight
05-10-2007, 06:26 AM
How does it handle greylisting?
I can see that causing issues
Nokia Tech
05-20-2007, 06:10 PM
Clicks INSTALL here
Just had a VB update done today, By Jelsoft. This is one of selection of cool hacks i have installed
Many thanks to the author for this..
BadgerDog
07-02-2007, 10:06 AM
Has anyone installed this mod along side this:
ajaxReg - Ajax Registration, with instant field checking
https://vborg.vbsupport.ru/showthread.php?p=1280844
I was wondering if there are any conflicts and if this mod will still work with the one above?
Thanks :)
Regards,
Badger
kollam003
07-02-2007, 04:17 PM
thnaks installed
obmob
07-02-2007, 10:08 PM
This one looks interesting, thanks!
BadgerDog
07-04-2007, 09:55 AM
Ok, I think this is one of the first cases of this mod that I've seen reacting to a user registration, but I thought I'd check here to make sure.
User tried to register as johnsmith@patmedia.net (not his real name of course, but domain is real)
He's rejected with a message that says:
Please enter another e-mail address. We were unable to contact your e-mail server and verify that your e-mail address exists. If you continue to have registration problems, please contact us for assistance.
He's able to send me personal complaint email and I can respond to that same email address without a problem. I'm able to "ping" that domain as well. He's tried to register six times over the last week using our regular system. If it is this mod sending that message, it would be a nice add-on to have it also automatically send the same message (copy) to a designated webmaster address too.
So, any idea why it rejects him (if it is this mod?) and now do I simply add him manually to get him registered?
Any feedback would be appreciated.... :)
Regards,
Badger
sabrawy
07-09-2007, 08:49 PM
is that working with vr 3.6.7???
aakhan136
07-14-2007, 04:26 PM
thanks
rinkrat
07-21-2007, 04:06 PM
This is rejecting a lot of my aol registrants and other legitimate addresses.
UNINSTALLED.
Antyrael
08-01-2007, 12:20 PM
No matter what emailaddress I try, every registration failed with "Please enter another e-mail address. We were unable to contact your e-mail server and verify that your e-mail address exists. If you continue to have registration problems, please contact us for assistance.".
I changed
if (!$vbulletin->options['os_email_fsockopen_support']) {
(on line 17) to
if ($vbulletin->options['os_email_fsockopen_support'] != '1') {
and after that registrations work again.
BadgerDog
08-07-2007, 09:31 PM
This is rejecting a lot of my aol registrants and other legitimate addresses.
UNINSTALLED.
Anyone else getting a LOT of rejections on AOL? :confused:
It seems that every person who signs up withe their @aol.com gets rejected?
I spend more time handling email complaints than necessary. Thought I'd check to see if there's anything I can do before I un-install this.
Otherwise, it's an excellent idea and I appreciate the coder's efforts. :up:
Regards,
Badger
ickie
08-11-2007, 04:28 PM
I have been looking for this for years, and this should be a part of VBulletin
We are a big forums and 10% of all new sign ups give bogus email Addy's and my server tries very hard trying to deliver their activation email, this has stopped all the hassle.
My email log is a weekly log and hundreds of entries are "no such user", since I installed this my log has not grown.
Thank you for this very fine hack.
Mecho
08-11-2007, 04:47 PM
awesome ... i clicked install before but i forgot to import it . it works perfect in vb 3.6.8 :)
thanks
BadgerDog
08-14-2007, 09:43 AM
Uninstalled....
Again, as I said above, nice idea but far too many erroneous rejects, particularly from @aol members as well as private company email servers.
I think a good idea would be to update this mod adding an option for the user to put in email address extensions that get accepted regardless of the check, therby overriding the false result returns.
Thanks to the developer for the attempt though ... :)
Regards,
Badger
SliceofLife
08-15-2007, 11:56 AM
Thank you!
*clicks installed
nnjj.net
08-18-2007, 11:43 PM
does this mod have any relationship with the problem of that new users can't recive the activation email?!!!
nickypoooo
08-21-2007, 12:27 AM
Installed, thanks alot.
FoReX
09-05-2007, 01:59 AM
Thanks. I installed 3.6.8. that's working perfect..
frostyIntrepid
09-05-2007, 02:19 AM
works great, thanks!
howardf
09-09-2007, 09:09 PM
Your mod is exactly what I was looking for.
I don't want to mess up the installation. Can you tell me exactly where in the directory hierarchy I should place the XML file?
Many thanks.
Howard
howardf
09-10-2007, 08:58 PM
Eric,
A great mod and just what I was looking for.
So I don't mess up, please tell me where in the directory hierarchy the xml file should be placed.
Many thanks.
howardf
09-12-2007, 05:26 PM
Can you tell me where in the directory hierarchy the XML file should be installed?
Thank you.
ThorstenA
09-14-2007, 07:30 AM
Suggestion: Check all users. By failing put them back into "Have to validate their email adress" usergroup!
Mecho
09-25-2007, 08:19 PM
i dunno what s wrong with this mod in my forum . it was working well but now it rejected many emails aol , hotmail and even yahoo !!! true emails !!
disabled for now !
James Argo
10-10-2007, 02:54 AM
*James Argo clicked installed*
But then... I have similiar problem Mecho stated above. They can register, but no confirmation mail ever sent to Yahoo, Gmail or Hotmail. I had to disable it. Any hints? :erm:
Appreciate the effort. Thanks! :)
;)
Jaymz
noppid
10-19-2007, 10:07 PM
This code does not work and WILL RETURN FALSE POSITIVES AS CODED.
The comparator code for a valid response with substr() is coded wrong and also checks the wrong response it appears. The defaults for the below init seem to guarantee a false positive.
EDIT: I see the reason now for the false positive, but I don't like that idea. We need all or nothing. This is like a false sense of security as is. This can be great however and should be!
$b_user_valid = $vbulletin->options['os_email_host_timeout_valid'];
Sets this positive to start. I'm pretty sure that should be the opposite for sanity. In my testing and simple knowledge anyway.
It can work as far as I can tell with my own testing and modifications, so far. I tested it against my sever and yahoo with my fixes as working. But I don't want to get ahead of myself. There may be more pitfalls I missed in my simple debugging.
EXCELLENT IDEA YOU GOT HERE!
BadgerDog
10-22-2007, 10:22 AM
It can work as far as I can tell with my own testing and modifications, so far. I tested it against my sever and yahoo with my fixes as working. But I don't want to get ahead of myself. There may be more pitfalls I missed in my simple debugging.
If you get it working, could you advise and provide your version?
I'm trying to figure out improved ways to stop spammers who are registering with false email addresses and posting garbage.
Thanks ... :)
Regards,
Badger
popowich
10-22-2007, 12:43 PM
I'd be more than happy to test out a beta version if it's attached as troubleshooting/beta for everyone to see the code.
-Raymond
rwoscott
01-30-2008, 10:49 PM
* Installed *
I have been getting a lot of these lately, hopefully this will prevent the high amount of "Awaiting Confirmation" Users.
MikeHolohan
02-09-2008, 06:16 PM
excellent...
saviola8x
03-18-2008, 04:49 PM
OMG. nice mod. Thanks
deLi_kurT
03-19-2008, 06:41 PM
Thanks.
AngelBlue
03-31-2008, 01:05 AM
This is a good mod, however, it can lead to Yahoo rejecting mail from your forums if many of your users register with Yahoo email addresses.
To avoid this, disable the use of this mod on Yahoo-based email addresses, via replacing :
if (!validate_email($vbulletin->GPC['email'])) {
$userdata->error('os_email_notvalid');
}
with :
if (!preg_match("/yahoo/i", $vbulletin->GPC['email'])) {
if (!validate_email($vbulletin->GPC['email'])) {
$userdata->error('os_email_notvalid');
}
}
in the product file before install.
The search string is deliberately kept as "yahoo", and not "yahoo.com", to avoid cases of other possible domains (like "yahoo.fr" and "yahoomail.someotherdomain") getting past the check.
FireFish
11-06-2008, 04:34 AM
Just FYI; since I installed this, I'm averaging about 2-3 'Contact Us' messages a week from guests who are wanting to register with email accounts at like sbcglobal.net or other major domains. They complain that they can't due to an error regarding 'contacting their email server'.
Although I totally love the idea & am sure it works most of the time, I can't loose those members & therefore must disable this mod. v :(
Twin_Turbo
11-20-2008, 08:07 PM
I just got word from a member with a cox email address that he gets this message:
"Please enter another e-mail address. We were unable to contact your
e-mail server and verify that your e-mail address exists. If you
continue to have registration problems, please contact us for
assistance."
Could it be because he is using opera or mozilla?
laynespeers
08-05-2011, 03:03 PM
Wow, thank you so much for this. The thing that I dislike about vBulletin is that it often has a lot of bots that will come on your forums and spam the living hell out of them. Atleast with a tool like this, it will prevent many of them from doing so. Not only that, but, if they do actually verify their email, then come and spam your website, you will know that their email is real. If this happens, its not very hard to spam them back.
Bottom line is, I love you. Haha.
laynespeers
08-05-2011, 03:27 PM
Just FYI; since I installed this, I'm averaging about 2-3 'Contact Us' messages a week from guests who are wanting to register with email accounts at like sbcglobal.net or other major domains. They complain that they can't due to an error regarding 'contacting their email server'.
Although I totally love the idea & am sure it works most of the time, I can't loose those members & therefore must disable this mod. v :(
I just got word from a member with a cox email address that he gets this message:
"Please enter another e-mail address. We were unable to contact your
e-mail server and verify that your e-mail address exists. If you
continue to have registration problems, please contact us for
assistance."
Could it be because he is using opera or mozilla?
The post right above you was explaining how to get around get around the default restrictions with the email servers. Well, they showed you how to get around the yahoo email server. Here, I will explain how you can make acceptions for different email servers.
Whenever you are contacted by someone saying that they cannot access the website due to email restrictions, simple add that email server to the .xml script. Here, I will show you what I am trying to say.
Okay, so first things first. You are going to want to open your os_validate_email_1.0.xml file. Once the file is open to editable mode, search for the following:
if (!validate_email($vbulletin->GPC['email'])) {
$userdata->error('os_email_notvalid');
}
Now that you have found the main method that verifies the email servers that the script is aloud to interact with, you are going to need to modify it just a little bit. The next thing that you are going to need to do is replace that code with the following:
if (!preg_match("/yahoo/i", (" $vbulletin->GPC['email'])) {
if (!validate_email($vbulletin->GPC['email'])) {
$userdata->error('os_email_notvalid');
}
}
Okay, so before we replaced that code, this script could not work with yahoo email servers, if you would like more information on the reasoning for that, see post #.
Now, I am going to explain how you are to go about adding more email servers to the list. This is very simple, and you won't take long to figure it out. As and example, I am going to add sbcglobal to the list. Okay, inorder to add another email server to the list, you are going to want to paste the following code right after "/yahoo/i",:
"/sbcglobal/i",
Okay, once you have added that, your code should like something like:
if (!preg_match("/yahoo/i", "/sbcglobal/i", (" $vbulletin->GPC['email'])) {
if (!validate_email($vbulletin->GPC['email'])) {
$userdata->error('os_email_notvalid');
}
}
So basically, when someone contacts you saying that they are unable to connect to your website with their email server, you will simply go into your script and add the email server. Also, do not add the domain extension when adding an email server, only add the main name of the email domain.
I am sorry if this doesn't work properly, I'm really not that great of a web programmer as I personally prefer to work with Java, but I thought I would speak up and help those in need :).
Best Regards,
Layne
Naijasite
11-17-2012, 09:02 AM
its not working ...i enterd fake email as rolins575367899@yahoo.com and it allowed the registration on vb 4.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.