RBL

Un article de Le wiki de 2 noisettes - noisette.ch.


Cet article est en cours de réalisation.


  1. Perform some check at the connexion of the client
  2. Reject client 11.22.33.44 if host 44.33.22.11.relays.ordb.org as the value 127.0.0.2
  3. should use, in order :
  4. relays.ordb.org
  5. sbl.spamhaus.org
  6. bl.spamcop.net
  7. dnsbl.sorbs.net
  8. list.dsbl.org

smtpd_client_restrictions =

       reject_rbl_client relays.ordb.org
       reject_rbl_client sbl.spamhaus.org



  1. !/bin/bash
  1. The prupose of this script is to check if some ip address are listed into some relay blocking database
  2. It returns 0 if no ip is listed, 1 otherwhise
  3. Usage : $0 [ip1 [ip2 [...]]]
  1. A file containing a rbl server per line

RBLSFILE="rbl-list.txt2"

if [ -f $RBLSFILE ] then

       RBLS=`egrep -v "^#" $RBLSFILE`

else

       RBLS="relays.ordb.org sbl.spamhaus.org bl.spamcop.net dnsbl.sorbs.net list.dsbl.org"

fi

QUERY=`which host`

reverse_ip() {

       echo $1 | sed "s/\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)/\4.\3.\2.\1/"

}

if "$@" == "" then

       IPS="64.233.183.27 64.233.183.114"

else

       IPS=$@

fi

return=0

for ip in $IPS do

       for rbl in $RBLS
       do
               host="`reverse_ip ${ip}`.${rbl}"
  1. echo "checking for ip ${host}"
               res=`$QUERY $host`
               if [ $? -eq 0 ]
               then
                       echo "$ip est listee chez $rbl"
                       return=1
               fi
       done

done

exit $return