nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.


.
. . .
 Simple RNYA tweak enables registration blocking of subdomains 
.
.
RavenNuke(tm)

A recent increase of spammer registrations using subdomains (e.g. baduser@badsubdomain.spam.com) led to the development of a simple modification to the bad domains check to block all subdomains for specified domains.  This subdomain email address activity was identified by reviewing nukeSPAM™ log.  Instead of individually blocking all (virtually unlimited) variations of subdomains after constantly reviewing the log, it would be much easier to enable blocking of all subdomains.  

Here's how it works:

Instead of specifying a block domain (e.g. blockeddomain.com), specify *. in front of the blocked domain in the RNYA configuration Blocked Mail Domains.

Some examples (including domains found to be using subdomains):

*.mail.ru blocks any mail.ru address, whether or not it includes a subdomain.
*.emailforyounow.com
*.glasstopdiningtable.org
*.kinefi.pl
*.lucow.pl
*.mailcampaigns.org

But be careful, though:

*.ru blocks any .ru address, i.e. it is also now possible to block registration by TLD, which may be desired for some sites.

Read more to get the code, and put your comments over at RavenPHPScripts here

In modules/Your_Account/includes/functions.php, replace functions ya_mailCheck and ya_mailCheckB with:

function ya_mailCheck($user_email) {
	global $stop, $user_prefix, $db, $ya_config;
	$user_email = strtolower($user_email);
	if (empty($user_email) || (!preg_match('/^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,6}$/', $user_email))) {
		$stop = _ERRORINVEMAIL . '<br />';
		return $stop;
	}
	if ((!$user_email) || ($user_email == '') || (!validateEmailFormat($user_email))) $stop = _ERRORINVEMAIL . '<br />';
	if ($ya_config['bad_mail'] > '') {
		$BadMailList = explode("
", $ya_config['bad_mail']);
		$email_parts = explode('@', $user_email);
		$j = count($BadMailList);
		for ($i = 0;$i < $j;++$i) {
			if ($BadMailList[$i] == $email_parts[1]) $stop = _MAILBLOCKED . ' <span class="thick">' . $BadMailList[$i] . '</span><br />';
			elseif ($BadMailList[$i][0] === '*' and  substr($BadMailList[$i], 1)) {
				$bMLd = substr($BadMailList[$i], 1);
				$bMLl = strlen($bMLd);
				if (strlen($email_parts[1])+1 === $bMLl and $email_parts[1] === substr($bMLd,1))
					$stop = _MAILBLOCKED . ' <span class="thick">' . substr($BadMailList[$i],2) . '</span><br />';
				elseif (strlen($email_parts[1])> $bMLl and substr($email_parts[1],-1*$bMLl,$bMLl) === $bMLd)
					$stop = _MAILBLOCKED . ' <span class="thick">' . substr($BadMailList[$i],2) . '</span><br />';
			}
		}
	}
	if (strrpos($user_email, ' ') > 0) $stop = _ERROREMAILSPACES . '<br />';
	if ($db->sql_numrows($db->sql_query('SELECT user_email FROM ' . $user_prefix . '_users WHERE user_email=\'' . addslashes($user_email) . '\'')) > 0) $stop = _EMAILREGISTERED . '<br />';
	if ($db->sql_numrows($db->sql_query('SELECT user_email FROM ' . $user_prefix . '_users WHERE user_email=\'' . md5($user_email) . '\'')) > 0) $stop = _EMAILNOTUSABLE . '<br />';
	if ($db->sql_numrows($db->sql_query('SELECT user_email FROM ' . $user_prefix . '_users_temp WHERE user_email=\'' . addslashes($user_email) . '\'')) > 0) $stop = _EMAILREGISTERED . '<br />';
	return ($stop);
}
function ya_mailCheckB($user_email) {
	global $user_prefix, $db, $ya_config;
	$user_email = strtolower($user_email);
	$return = 'true';
	if ($ya_config['bad_mail'] > '') {
		$BadMailList = explode("
", $ya_config['bad_mail']);
		$email_parts = explode('@', $user_email);
		$j = count($BadMailList);
		for ($i = 0;$i < $j;++$i) {
			if ($BadMailList[$i] == $email_parts[1]) $return = 'false';
			elseif ($BadMailList[$i][0] === '*' and  substr($BadMailList[$i], 1)) {
				$bMLd = substr($BadMailList[$i], 1);
				$bMLl = strlen($bMLd);
				if (strlen($email_parts[1])+1 === $bMLl and $email_parts[1] === substr($bMLd,1))
					$return = 'false';
				elseif (strlen($email_parts[1])> $bMLl and substr($email_parts[1],-1*$bMLl,$bMLl) === $bMLd)
					$return = 'false';
			}
		}
	}
	if ($db->sql_numrows($db->sql_query('SELECT user_email FROM ' . $user_prefix . '_users WHERE user_email=\'' . addslashes($user_email) . '\'')) > 0) $return = 'false';
	if ($db->sql_numrows($db->sql_query('SELECT user_email FROM ' . $user_prefix . '_users WHERE user_email=\'' . md5($user_email) . '\'')) > 0) $return = 'false';
	if ($db->sql_numrows($db->sql_query('SELECT user_email FROM ' . $user_prefix . '_users_temp WHERE user_email=\'' . addslashes($user_email) . '\'')) > 0) $return = 'false';
	return $return;
}

 



 
.
. Posted on Saturday, January 24, 2015 @ 14:09:26 CST by kguske   .
.
 
click Related        click Rate This        click Share

Associated Topics

nukeSPAM (tm)

Sorry, Comments are not available for this article.


Page Generation: 0.03 Seconds