[milters] Archive

Lists Index Date Thread Search

Article: 281
From: Rose, Bobby
Date: 2004-12-13 14:36:35 -0500
Subject: Re: Milter-Sender cache db

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support
--------------------------------------------------------

But what is it's usage?  I went looking for milter-cachedump for
reference but couldn't find it.

-----Original Message-----
From: milters-bounce@milter.info [mailto:milters-bounce@milter.info] On
Behalf Of Willi Burmeister
Sent: Sunday, December 12, 2004 9:52 AM
To: milters@milter.info
Subject: [milters] Re: Milter-Sender cache db

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support
--------------------------------------------------------

Hi,

> Rather than delete the cacehe, you could stop the milter, use a ruby 
> or perl script to modify it, then restart. But I've not written such a
script.

try this:

----------------------------------------------------------------------
#!/usr/local/bin/perl
#
# milter-rmentry.pl by Willi Burmeister <wib@cs.uni-kiel.de> # based on
milter-cachedump.pl by Chris M. Miller.
# 

use Fcntl;
use DB_File;

my $HANDLE = tie %db, 'DB_File', $ARGV[0], O_RDWR, 0666, $DB_HASH
        or die "Cannot open file $ARGV[0]: $! \n" ;

my $key = sprintf "%s\0", $ARGV[1];

if ($db{$key})
{
  my $status = $HANDLE->del($key);
  printf "entry %s (%d/%d)\n", $status == 0 ? "deleted" : "not
found",
$status, $!; } else {
  printf "%s not found\n", $ARGV[1];
}

untie %db;

exit 0;
----------------------------------------------------------------------


Willi




Lists Index Date Thread Search