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);
}