diff options
author | cvs2git | 2007-11-13 07:38:13 (GMT) |
---|---|---|
committer | cvs2git | 2012-06-24 12:13:13 (GMT) |
commit | 49974322b52d63ff7d69f2ea315a8b10ed2b5aea (patch) | |
tree | c4c179547eefc78409364ba352347e74c41a7baf | |
parent | f15324162460e2c166b404523cfccbb90bd8be02 (diff) | |
download | postgrey-49974322b52d63ff7d69f2ea315a8b10ed2b5aea.zip postgrey-49974322b52d63ff7d69f2ea315a8b10ed2b5aea.tar.gz |
This commit was manufactured by cvs2git to create branch 'AC-branch'.AC-branch
Sprout from master 2007-11-13 07:38:13 UTC hawk <hawk@pld-linux.org> '- updated group patch, release 2'
Delete:
postgrey_clients_dump
-rw-r--r-- | postgrey_clients_dump | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/postgrey_clients_dump b/postgrey_clients_dump deleted file mode 100644 index 5a52250..0000000 --- a/postgrey_clients_dump +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -w - -# written by David Schweikert and adapted to Debian by Adrian von Bidder -# adapted to PLD Linux Distribution Micha³ Lipka -# this script is in the public domain -# -# This script will output all clients that were automatically whitelisted -# by postgrey's --auto-whitelist-clients option. -# Set the default number of mails your to fit your needs (generally it -# should be the same as N i --auto-whitelist-clients=N) - -use BerkeleyDB; -use Socket; - -my $dbdir = '/var/spool/postfix/postgrey/'; -my $mails = 5; - -sub resolv($) { - my $host = shift; - my $iaddr = inet_aton($host); - return gethostbyaddr($iaddr, AF_INET) || $host; -} - -sub dbopen($) -{ - my ($dbdir) = @_; - my %db; - - my $dbenv = BerkeleyDB::Env->new( - -Home => $dbdir, - -Flags => DB_INIT_TXN|DB_INIT_MPOOL|DB_INIT_LOG, - ) or die "ERROR: can't open DB environment: $!\n"; - - tie(%db, 'BerkeleyDB::Btree', - -Filename => "postgrey_clients.db", - -Flags => DB_RDONLY, - -Env => $dbenv, - ) or die "ERROR: can't open database $dbdir/postgrey_clients.db: $!\n"; - - return \%db; -} - -sub main() -{ - # go through the database - my $db = dbopen($dbdir); - while (my ($key, $value) = each %$db) { - my ($c,$l) = split(/,/,$value); - $c >= $mails or next; - my $host = resolv($key); - print "$host [$key] ($c)\n"; - } -} - -main; - -# vim: sw=4 |