#!/usr/bin/perl

use strict;
use Fcntl;

# must match line at top of lib/Mail/SpamAssassin/DBBasedAddrList.pm.
# now off until 3.0
# BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File SDBM_File); }

use AnyDBM_File ;
use vars qw( %h $k $v ) ;

my $db = $ENV{HOME}."/.spamassassin/auto-whitelist";	# is this right?

tie %h, "AnyDBM_File",$db, O_RDONLY,0600
      or die "Cannot open file $db: $!\n";
my @k = grep(!/totscore$/,keys(%h));
for my $key (@k)
{
	my $t = $h{"$key|totscore"};
	my $v = $h{$key};
	if(defined($t)) { printf "% 8.1f %15s  --  %s\n",$t/$v,"($t/$v)",$key; };
}
untie %h;
