PDA

View Full Version : Validate email by MX lookup


fastforward
04-07-2002, 10:00 PM
This simple little hack will verify email addresses during registration and updates of profiles by doing an MX lookup against the domain to ensure somebody is accepting email for it.

It won't tell you if the actual user is valid on the domain, but it will prevent fake domains backing up in your mail spool and slowing everything down.

It requires one new error template and two simple code additions to register.php and member.php. Instructions attached.

snyx
04-07-2002, 11:44 PM
nice man, install this asap!

nafae
04-08-2002, 12:16 AM
Fantastic, I am soo going to install this :)

Admin
04-08-2002, 12:50 PM
Great. :) What happens if the mail server is down though?

fastforward
04-08-2002, 01:04 PM
Originally posted by FireFly
Great. :) What happens if the mail server is down though?
Most ISP's will have secondary MX and mail server. In fact, even I have a backup mail server.

If they don't have a backup, then you probably wouldn't want them registering with that unreliable address and risk clogging up your forums mail queue. :)

Admin
04-08-2002, 01:07 PM
Ok, I was just wondering. :)
I once saw a different script that tries to connect to the server, and make sure the mailbox is really there, but then if the server was done the script will just return false.

fastforward
04-08-2002, 01:16 PM
Actually, I just realized that what I wrote was all wrong. I wasn't thinking straight.

The MX record is a DNS issue. It doesn't matter if the mail server is down. The DNS will still show that somebody should be accepting mail for it.

The only time it will fail will be if the DNS server is down or the domain doesn't have anyone accepting mail for it.

Admin
04-08-2002, 01:21 PM
Even better. :D The other script I saw though definitely connects to the server, so this one is better.

wooolF[RM]
04-08-2002, 01:27 PM
]great hack! :) I'm tired of peeps who give they mail like i_love_vbb@coolhax0r.net or something... I'll install it! :D

Marshalus
04-08-2002, 03:41 PM
Very nice!

Erwin
04-11-2002, 07:08 AM
This is a wonderful hack and should be integrated into vB3 I reckon! Two thumbs up.

inetd
04-11-2002, 08:11 AM
Good! Hack must be integrated into vB3! Very cool!
Thanks for hack, fastforward!

hypedave
04-11-2002, 01:44 PM
for some reason it didnt work on these domains for me

@yahoo.com
@hotmail.com
@excite.com

fastforward
04-11-2002, 02:15 PM
Originally posted by hypedave
for some reason it didnt work on these domains for me

@yahoo.com
@hotmail.com
@excite.com
What do mean by 'it doesn't work'? It works for me on all those domains. Lets face it, it's unlikely any of those would have broken DNS and MX records set up. :)

hypedave
04-11-2002, 02:19 PM
well lets see for some reason, it came back with the error that those were invalid email account, and I tested using my email accout from those domains,

Erwin
04-11-2002, 02:23 PM
Well, hotmail.com, yahoo.com etc. all work for my forums with this hack. That is when I don't ban them.

hypedave
04-11-2002, 02:26 PM
I will try it one more time, when user registration isnt full, it jus bothers me that a simple hack thats supposed to check a domain to make sure its a domain tell me that the 3 domains I tryed for the most popular email accounts on my forum are invalid

Ian
04-11-2002, 06:46 PM
Originally posted by hypedave
I will try it one more time, when user registration isnt full, it jus bothers me that a simple hack thats supposed to check a domain to make sure its a domain tell me that the 3 domains I tryed for the most popular email accounts on my forum are invalid
You must have the hack installed wrong... It works fine for me.

Takara
06-10-2002, 12:16 PM
Originally posted by hypedave
for some reason it didnt work on these domains for me

@yahoo.com
@hotmail.com
@excite.com

Do do do do, I hate to bring back hacks from the hack graveyard, but since Im installing this one I thought I should mention that the mx lookup doesnt work on win32 binary releases.

So, ppl with WINNT and 2K servers are out of luck.

Jawelin
06-26-2002, 12:19 PM
This nice hack worked fine to me since I installed it months ago.
Now, suddendly, it stopped working on the same server and any UserCP update returns the error:
Warning: getmxrr() is not supported in this PHP build fullpath/member.php on line 457

On the server is installed PHP v4.2.1 and I have VB v2.2.6

Is there any php.ini config item missing or mistyped to enable the getmxrr() (http://it.php.net/manual/it/function.getmxrr.php) function ?

Thank you very much.

Dark_Wizard
06-26-2002, 01:26 PM
I just installed this on 2.2.6 and php 4.2.1 and it works fine....the getmxrr function is still supported in this php release but not on Windows servers....

ColinP
06-26-2002, 01:26 PM
Unfortunately, I have a perfectly valid email address (colin@thedvdforums.dynip.com) that DOESN'T have a MX record but still works. Nice hack though and have installed it - if I get to many complaints I'll have to remove it though.

lifesourcerec
06-26-2002, 02:00 PM
I have a small question. In my member.php file, it has " " instead of ' '. Does that matter? This:


$templatesused = 'redirect_updatethanks,error_fieldmissing,error_em ailmismatch,error_emailtaken,error_fieldmissing,er ror_requiredfieldmissing,error_birthdayfield';


is this:


$templatesused = "redirect_updatethanks,error_fieldmissing,error_ema ilmismatch,error_emailtaken,error_fieldmissing,err or_requiredfieldmissing,error_birthdayfield";


Should I change it to what's in the hack?

Jawelin
06-26-2002, 06:06 PM
Originally posted by Dark_Wizard
I just installed this on 2.2.6 and php 4.2.1 and it works fine....the getmxrr function is still supported in this php release but not on Windows servers....
I read that on php.net.
I'm on a Linux shared server and, since installed PHP 4.2.1, that function is not defined yet.
I receive the above mentioned message.

Thanks

sparky2
08-21-2002, 05:03 PM
Originally posted by hypedave
I will try it one more time, when user registration isnt full, it jus bothers me that a simple hack thats supposed to check a domain to make sure its a domain tell me that the 3 domains I tryed for the most popular email accounts on my forum are invalid

The hack called for insertion of the new code FOLLOWING the existing BAD_EMAIL function.

What you are describing sounds like you have listed
yahoo.com
among the "bulk email domains" to be banned,
under "Banning Options"
and have that setting (to check bad_email) enabled.

In other words, "bad email address" sounds like the earlier function matched/blocked the yahoo address(es) you tried.

Dolby
08-24-2002, 06:06 AM
Installed this and its working great so far on one of my really busy sites.

tested with @hotmail.com and a couple other email addys.

vb 2.2.6
vbp 3pr8.1

Nicholas Brown
08-31-2002, 10:31 AM
This is why I cant see this hack getting into vB3 :( getmxrr(); isnt supported by Windows PHP Builds, and as vBulletin is for Windows and *nix servers.....

Nice hack :)

josiespencer
06-27-2007, 03:54 PM
I have a problem and I really don't know if it related to this mod or not but I thought this the best place to start. I have been using this mod for approx. 4 months and this is an occasional issue.

If a user joins and then gets banned for some reason or another, and he/she tries to add a new account since we don't revive banned accounts, he/she gets a message that the IP address is now banned. Does this mod do any logic like that?

BadgerDog
10-22-2007, 10:29 AM
Anyone operating this successfully with v3.67 or above?

Thanks :)

Regards,
Badger