[milters] Archive

Lists Index Date Thread Search

Article: 280
From: Willi Burmeister
Date: 2004-12-12 09:51:49 -0500
Subject: Re: Milter-Sender cache db

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


> 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:

# 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, $!;
  printf "%s not found\n", $ARGV[1];

untie %db;

exit 0;


Lists Index Date Thread Search