Re[2]: [Exim] rbl server setup

Pàgina inicial
Delete this message
Reply to this message
Autor: Richard Welty
Data:  
A: exim-users
Assumpte: Re[2]: [Exim] rbl server setup
On Mon, 7 Jul 2003 16:06:42 -0400 (EDT) Richard Welty <rwelty@???> wrote:
>a sample of the script, with a couple of ip addresses in it for examples,
>is attached.


>richard
>--
>[ zone.pl of type application/octet-stream deleted ]


so much for attaching it. here's an inline insertion of the perl:

--------------<cut here>----------------
#!/usr/bin/perl

use Net::CIDR;

@iplist = ('64.5.230.128/26',    # new grouplotto block, 2/25/02
           '64.32.63.0/26',      # hispeedmailer.com 2/11/02
           '64.52.139.12/30',    # pchoutbound/bbwgroup 11/6/2002
           '64.52.139.16/30',    # pchoutbound/bbwgroup 11/6/2002
           '64.52.139.20/31',    # pchoutbound/bbwgroup 11/6/2002
           '64.62.151.48/28',    # netflush & company 11/15/2002
           '64.70.22.96/28',     # vendare.com/jackpot.com/jpmailer.com 10/12/02
           '64.70.22.128/26',    # vendare.com/jackpot.com/jpmailer.com 3/15/02
           '64.70.49.64/28',     # vendare.com/jackpot.com/jpmailer.com 4/4/03
                                 # expanded 5/29/03
           '64.89.16.0/20',      # datarapido, emaildelbuto, expanded 1/8/03
           );



foreach $entry (@iplist) {

  my ($ip,$mask) = split /\//, $entry;
  if (! defined $mask) { $mask = 32; $entry = "$ip/$mask"; }
  my @octet_sets = Net::CIDR::cidr2octets($entry);
  foreach my $octet_set (@octet_sets)
  {
     my @octets = split /\./, $octet_set;
     if ($#octets < 3)
     {
        push @octets, '*';
     }
     my $reversed = join '.', (reverse @octets);
     my $new_entry = $reversed;
     printf "%-34s IN A   127.0.0.2\n", $new_entry;
     printf "%-34s IN TXT \"Mail from $ip/$mask blocked - See http://www.krusty-motorsports.com/blocked-by-ip.html\"\n", '';
  }


}

--------------<cut here>----------------
--
Richard Welty                                         rwelty@???
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security