Re: [Exim] remove frozen messages from queue?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Michael J. Tubby
日付:  
To: exim-users
題目: Re: [Exim] remove frozen messages from queue?
At 10:14 11/09/2000 +0400, you wrote:
>i've got alot of frozen messages... how to remove frozen messages from
>queue?


I had exactly this problem and its still on my wish list (Phil) to have
Exim to have an "exim -Mrfz" (remove frozen) option.

In the mean time the following fragment of Perl will do what you need.

Regards

Mike Tubby


#!/usr/bin/perl
#
# rmfrozen.pl -- remove frozen messages from the Exim mail queue
# Copyright (C) 1999 Mike Tubby, Thorcom Systems Limited (mike@???)
#
# This needs to be run as root. It obtains a list of frozen messages
# on the Exim mail queue and then removes them one-by-one.
#

open(QUEUE, "/usr/exim/bin/exim -bpu | grep frozen |") or die "rmfrozen:
can't open Exim mail queue";

while (<QUEUE>) {
         my $in = $_;
         $in = ~s/^\s+//;                # hack off leading spaces
         my ($age, $size, $id, $brackets, $from, $stuff1, $stuff2, $stuff3) 
= split /\s+/;
         print "removing message: $id  age: $age\n";
         system("/usr/exim/bin/exim -Mrm $id");
}


close(QUEUE);