exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"domain","hit"=>$domain,"message"=>"Emails from \"".htmlspecialchars($domain)."\" are not allowed because of spam/abuse.".($domain=="googlemail.com"?" (Hint: use gmail.com instead)":"")]);
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"word","hit"=>$word,"message"=>"\"".htmlspecialchars($word)."\" is not allowed because of spam/abuse."]);
}
}
//
// Lookup reported client IP address against stopforumspam.com CIDR range list
//
/**
*https://stackoverflow.com/a/594134
*/
functioncidr_match($ip,$range){
list($subnet,$bits)=explode('/',$range);
if($bits===null){
$bits=32;
}
$ip=ip2long($ip);
$subnet=ip2long($subnet);
$mask=-1<<(32-$bits);
$subnet&=$mask;# nb: in case the supplied subnet wasn't correctly aligned
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"toxic_ip_cidr","hit"=>$clientip,"message"=>"Your computer's IP address is on a spam blacklist."]);
}
}
}
//
// Lookup reported client IP address against stopforumspam.com full IP list
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"banned_ip","hit"=>$clientip,"message"=>"Your computer's IP address is blacklisted for sending spam."]);
}
}
}
//
// Lookup reported client IP address to see if it's in a botnet or something and sending spam
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"spamhaus_xbl","hit"=>$clientip,"message"=>"Your computer or a device on your network is infected with a virus and is sending spam messages, so our system is blocking your message."]);
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"$blacklist","hit"=>$d,"message"=>"Your message contains a domain ($d) that has been linked to recent spam or criminal activity. Message not sent."]);
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"netsyms_ip_blacklist","hit"=>$clientip,"message"=>"A computer at your IP address has sent spam in the past. Your message has been blocked."]);
exitWithJson(["status"=>"OK","clean"=>false,"filter"=>"netsyms_email_blacklist","hit"=>$email_lower,"message"=>"Someone put your email as the from address on a spam message. Your message has been blocked."]);