26

Re: Banning TLD's, like .ru?

mindlessoath wrote:

i too get alot of .ru signups. its annoying!
i also get alot of email from russian spammers, wtf?

anyways, it would be great if someone could make a plugin or modification for more effective (hrmm, mabe i mean more options for...) ban control and also a check on declining .ru addresses from signing up! i would like it to ban the address that signed up with .ru too!

someone make that please! its really need for this spam problem! the other modifications work, but only so much.

I simple just started banning domain name.... mail.ru au.fm ... if a spammer sign up.. oh well...that domain is banned. I hope someone can create a mod for this. but if not... banning i go.....


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

27 (edited by LVZ 2007-06-22 19:23)

Re: Banning TLD's, like .ru?

Okay, I did a bit more anti-spam testing to not only just allow certain email address TLDs but to also just allow the same (or different) reverse-IP posting TLDs.  The example below is for USA email addresses and IPs.  It does not, of course, eliminate spam postings, but it can significantly reduce the problem.

For limited testing, you can try my unannounced http://vegasmusictalk.com/lvss/forum/

For those who just want to deny instead of allow a set of TLDs:

instead  of  allow: $TLD_em != 'com' && $TLD_em != 'net' && $TLD_em != 'org' && etc.
use method deny: $TLD_em == '.ru' || $TLD_em == '.ro' || $TLD_em == 'biz' || etc.

Changes made in include/email.php :

//
// TLD check - reduce allowable top level domains for email addresses and reverse-ip registrations
//
function TLD_check($TLD_em,$ip)  // restricted to .com .org .net .edu .gov .ca and unresolvable IP
{
   if( $TLD_em != 'com' && $TLD_em != 'net' && $TLD_em != 'org' &&
       $TLD_em != 'edu' && $TLD_em != 'gov' && $TLD_em != '.ca' )        return true; 
// not allowed

   $TLD_ip=end(explode(' ',`host $ip`));
   $TLD_ip=substr(substr($TLD_ip,0,strlen($TLD_ip)-2),-3);
   $chk=split("\(",$TLD_ip);

   if(!$chk[1] && $TLD_ip != 'com' && $TLD_ip != 'net' && $TLD_ip != 'org' &&
                  $TLD_ip != 'edu' && $TLD_ip != 'gov' && $TLD_ip != '.ca' )   return true; 
// not allowed
   return false;
}

//
// Validate an e-mail address
//
function is_valid_email($email)
{
    if (strlen($email) > 50)           return false;

        if( TLD_check( substr($email,-3), $_SERVER["REMOTE_ADDR"] )) return false;

    return preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email);
}

Re: Banning TLD's, like .ru?

You might want to look at this
http://us2.php.net/manual/en/function.gethostbyaddr.php

29

Re: Banning TLD's, like .ru?

Smartys wrote:

You might want to look at this
http://us2.php.net/manual/en/function.gethostbyaddr.php

I did that before I wrote the code.  However, I did notice these comments on php.net

gethostbyaddr() tends to lag on various systems for whatever reason. Here are two functions that should prove their worth speedwise.

// For Linux...

function gethost ($ip) {
$host = `host $ip`;
return (($host ? end ( explode (' ', $host)) : $ip));
}

Re: Banning TLD's, like .ru?

is there some kind of admin panel mod that can be made for this? i would like to add these types in the admin section and let others remove and delete at there will, you know, in a text box using some sort of dillimeter to tell each from one annother, ie....
.ru | .ro | .biz
etc
then apply the changes in an admin plugin/mod?

Re: Banning TLD's, like .ru?

i just wanna say i did something so simple to deny 90%+ of all spam signups on my site.

2 things:

1. i added a anti-spam math quiz when ppl sign up

and

2. it checks if the "spambot" selects a certain (non-default) timezone.. which pretty much NO ONE LIVES IN, and does not allow the person/bot to go beyond that point. smile

check it out at: http://www.thinkgleek.com/register.php

~thegleek