XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
postcommon_post_deny_by_rbl.php
Go to the documentation of this file.
1 <?php
2 
4 
5  function execute()
6  {
7  // RBL servers (don't enable too many servers)
8  $rbls = array(
9  'sbl-xbl.spamhaus.org' ,
10 # 'niku.2ch.net' ,
11 # 'list.dsbl.org' ,
12 # 'bl.spamcop.net' ,
13 # 'all.rbl.jp' ,
14 # 'opm.blitzed.org' ,
15 # 'bsb.empty.us' ,
16 # 'bsb.spamlookup.net' ,
17  ) ;
18 
19  global $xoopsUser ;
20 
21  $rev_ip = implode( '.' , array_reverse( explode( '.' , @$_SERVER['REMOTE_ADDR'] ) ) ) ;
22 
23  foreach( $rbls as $rbl ) {
24  $host = $rev_ip . '.' . $rbl ;
25  if( gethostbyname( $host ) != $host ) {
26  $this->protector->message .= "DENY by $rbl\n" ;
27  $uid = is_object( $xoopsUser ) ? $xoopsUser->getVar('uid') : 0 ;
28  $this->protector->output_log( 'RBL SPAM' , $uid , false , 128 ) ;
30  }
31  }
32 
33  return true ;
34  }
35 
36 }
37 
38 ?>