Re: [AMaViS-user] RBL Monitoring.

2007-06-27 Thread mouss
Azfar Hashmi wrote:

 thanks guys now where do I get long list of rbl servers to add those in
 script.


Prefer quality over quantity.

but if you insist on quantity, take a look at the lists on dnsstuff site 
or google for check rbl and on the sites that you find, do a lookup of 
an IP and you'll see many lists. spamlink.net has many lists as well.

Note that while it is safe to use any list to lookup your own IP, you 
should only use safe lists to block mail.

you can add 127.0.0.1 and 127.0.0.2 to the list of your IPs.
- 127.0.0.1 should never be listed. This may help detect lists gone 
crazy...
- on many lists, 127.0.0.2 should be listed.





-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/


[AMaViS-user] RBL Monitoring.

2007-06-26 Thread Azfar Hashmi
Is there any way to monitor my ips in RBLs.
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/


Re: [AMaViS-user] RBL Monitoring.

2007-06-26 Thread Xueron Nee
Hi Azfar Hashmi,

Here is a simple perl script to do this :)

#!/usr/bin/perl -w
use strict;
use Net::RBLClient;
die Usage: $0 file or ip.add.re.ss ...\n unless scalar(@ARGV);

my @target = ();
foreach my $ip_list (@ARGV) {
if ($ip_list =~ /$Net::RBLClient::ip_pat/o and not -f $ip_list) {
push @target, $ip_list;
} else {
die '$ip_list' is not an ip address or filename\n unless -f $ip_list;
open FD,  $ip_list or die cannot open file '$ip_list': $!\n;
while (FD) {
chomp;
next if /^#/;
if (/$Net::RBLClient::ip_pat/o) {
push @target, $;
}
}
close FD;
}
}

my @rblserver = qw(
bl.spamcop.net
zen.spamhaus.org
cbl.abuseat.org
dnsbl.njabl.org
dnsbl.sorbs.net
spam.dnsbl.sorbs.net
dynablock.njabl.org
list.dsbl.org
multihop.dsbl.org
relays.ordb.org
unconfirmed.dsbl.org
blackholes.mail-abuse.org
rbl.softworking.com
);

my $rblclient = Net::RBLClient-new(
lists   = [EMAIL PROTECTED],
query_txt   = 0,
server  = '127.0.0.1' # DNS server
);

# check
my $result = {};
foreach my $ip (@target) {
print checking $ip ...\n;
$rblclient-lookup($ip);
my %listed_hash = $rblclient-listed_hash();
if (scalar keys %listed_hash) {
foreach my $rbl (keys %listed_hash) {
print \t$rbl;
$result-{$rbl}-{$ip} = $listed_hash{$rbl};
$result-{$rbl}-{$ip} =~ s/^\s*|\s*$//g;
}
}
}

# build report
my $text = '';
foreach my $rbl (keys %$result) {
$text .= $rbl\n;
foreach my $ip (keys %{$result-{$rbl}}) {
#$text .= sprintf(%-28s %-20s %16s\n, $name, $ip, 
$result-{$rbl}-{$ip});
$text .= \t$ip\n;
}
$text .= \n;
}

... send the result to your email or save as html to view with browser ...


Azfar Hashmi wrote:
 Is there any way to monitor my ips in RBLs.
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 AMaViS-user mailing list
 AMaViS-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amavis-user
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
 AMaViS-HowTos:http://www.amavis.org/howto/


-- 
Xueron Nee [EMAIL PROTECTED]


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/


Re: [AMaViS-user] RBL Monitoring.

2007-06-26 Thread mouss
Xueron Nee wrote:
 Hi Azfar Hashmi,

 Here is a simple perl script to do this :)

 #!/usr/bin/perl -w
 [snip]
   

a less sofisticated shell version:

#!/bin/sh

ip_list=`grep -v ^# /path/to/ips`
rbl_zones=`grep -v ^# /path/to/rbls`

check_ip()
{
ip=$1
zone=$2

rev_ip=`echo $ip |  awk -F. '{print $4 . $3 . $2 . $1}'`
host $rev_ip.$zone | grep -m 1 has address
}


for ip in $ip_list; do
  for zone in $rbl_zones; do
check_ip $ip $zone
  done
done






-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/