mailfiter 过滤ip

 

#--------ip filter------------
if(/^Received: from (.*) by (.*)/)
{
   FROMIP=$MATCH1
   if($FROMIP ne "")
   {
       if (lookup($FROMIP, ".blockip"))
       {
          echo "[block ip]::$FROMIP::F:$SENDER,T:$EXT@$HOST,drop letter"
          to /dev/null
          exit
       }

   }
}