On Wed, 2002-05-01 at 04:17, Craig R Hughes wrote:
> Bart Schaefer wrote:
>
> BS> I just tried this, and (a) it croaks if invoked with perl 5.005 on the
> BS> "use warnings;" line, and (b) with perl 5.6.1, it didn't print anything
> BS> even though a strings of the file shows that there definitely are some
> BS> entries.
>
> Bah! I don't think we need the use warnings in there anyway. Consider it gone.
>
> BS> Hmm, this is interesting. I don't have an auto-whitelist.db file; my
> BS> database appears to be directly in the file named auto-whitelist. If I
> BS> delete from check_whitelist the
> BS>
> BS> if (-f "$db.db")
>
> Double bah! I think Justin added that in before heading off on vacation. It
> doesn't play well with AnyDB which could be using any DB, and not necessarily
> one that calls its files *.db -- I'll remove that line too.
>
> BS> so as to let the block that it protects run, I get
> BS>
> BS> [EMAIL PROTECTED] -> -1.6 (-200.9/127)
> BS>
> BS> but nothing else. What is supposed to be happening here? Have I somehow
> BS> gotten a strange version of AnyDBM?
>
> Probably what's happening is you're not using the AWL file you think you're
> using. Is spamd running as root and not dropping privs? Try checking out the
> contents of /root/.spamassassin/auto-whitelist.db instead...
>
Here is some results I got:
Script started on Wed May 1 13:40:46 2002
$ cd SpamAssassin/*20
$ ls
Changes blib pm_to_blib spamd
License build procmailrc.example spamproxy
MANIFEST contrib qmail sql
MANIFEST.SKIP doc rules t
Makefile fixpath.pl sample-nonspam.txt tools
Makefile.PL lib sample-spam.txt windows_install.pl
README masses spamassassin
TODO ninjabutton.png spamassassin.raw
$ cd tools
$ ls
check_whitelist z
$ rm z
$ vi chj eck _whitelist
7[?47h[m[m[24;1H"check_whitelist" 21 lines, 496 characters
[H[2J#!/usr/bin/perl[H
use warnings ;
use strict ;
use Fcntl;
use AnyDBM_File ;
use vars qw( %h $k $v ) ;
my $db = $ENV{HOME}."/.spamassassin/auto-whitelist"; # is this right?
if (-f "$db.dir") {
tie %h, "AnyDBM_File",$db, O_RDWR|O_CREAT|O_EXCL,0600
[6Cor die "Cannot open file $db: $!\n";
my @k = grep(!/totscore$/,keys(%h));
for my $key (@k)
{
my $t = $h{"$key|totscore"};
[8Cmy $v = $h{$key};
[8Cif(defined($t)) { printf "%-40.40s -> % 2.1f %s\n",$key,$t/$v,"($t/$v)";
};
}
untie %h;
}
~[H[23B"check_whitelist" 21 lines, 496 characters[H
[A[A[A
[A[1M[13B~[K[10;3H
[A[17;8H
~[A
"check_whitelist" 19 lines, 474 characters
[J[2J[?47l8$ check _wwhitelist
Cannot open file /home/ler/.spamassassin/auto-whitelist: File exists
$ ls -la .. ~! /.sp/home/ler/.spamassassin/
total 1118
drwx------ 2 ler isis 1024 May 1 13:40 .
drwxr-xr-x 160 ler other 12288 May 1 13:40 ..
-rw-r--r-- 1 ler isis 0 May 1 11:43 auto-whitelist
-rw------- 1 ler sys 4096 May 1 08:11 auto-whitelist.dir
-rw------- 1 ler sys 1007616 May 1 13:40 auto-whitelist.pag
-rw-r--r-- 1 ler isis 1247 Apr 26 17:10 user_prefs
$ rm ~., /.sp/home/ler/.spamassassin/auuto-whitelist
$ ls -la /home/ler/.spamassassin/
$ check _whitelist
$
Cannot open file /home/ler/.spamassassin/auto-whitelist: File exists
$ rm /home/ler/.spamassassin/auto-whitelist
$ ls -la /home/ler/.spamassassin/
$
total 1118
drwx------ 2 ler isis 1024 May 1 13:41 .
drwxr-xr-x 160 ler other 12288 May 1 13:40 ..
-rw------- 1 ler sys 4096 May 1 08:11 auto-whitelist.dir
-rw------- 1 ler sys 1007616 May 1 13:41 auto-whitelist.pag
-rw-r--r-- 1 ler isis 1247 Apr 26 17:10 user_prefs
$
script done on Wed May 1 13:42:02 2002
and I'll attach the check_whitelist I used.
> C
>
>
> _______________________________________________________________
>
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
> _______________________________________________
> Spamassassin-talk mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/spamassassin-talk
>
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: [EMAIL PROTECTED]
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
#!/usr/bin/perl
use warnings ;
use strict ;
use Fcntl;
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_RDWR|O_CREAT|O_EXCL,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 "%-40.40s -> % 2.1f %s\n",$key,$t/$v,"($t/$v)"; };
}
untie %h;