Thursday, December 19, 2002, 11:14:32 AM, [EMAIL PROTECTED] wrote:

> I had a specific problem to deal with yesterday with an internal spammer
> sending out over 100,000 messages and I was trying to move his spooled
> messages from my sendmail(not my idea) box queue to a different dir after
> shutting down the processes. Unfortunately I couldn't find a way to do this.
> Windows is so much easier for stuff like search for contents of files and
> then cut and paste.

With newer Postfix snapshots, you can use postsuper to delete queue entries.
Here's a script from Craig Sanders on the postfix users list to feed an
email address and it will delete all queue entries that match--use at your
own risk:

#!/usr/bin/perl
$REGEXP = shift || die "no email-adress given (regexp-style, e.g.  bl.*@yahoo.com)!";

@data = qx</usr/sbin/postqueue -p>;
for (@data) {
  if (/^(\w+)\*?\s/) {
    $queue_id = $1;
  }
  if($queue_id) {
    if (/$REGEXP/i) {
      $Q{$queue_id} = 1;
      $queue_id = "";
    }
  }
}

#open(POSTSUPER,"|cat") || die "couldn't open postsuper" ;
open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ;

foreach (keys %Q) {
      print POSTSUPER "$_\n";
};
close(POSTSUPER);




-- 
Chris Scott
Host Orlando, Inc.
http://www.hostorlando.com/


Reply via email to