Re[2]: [exim] Remove "not reached" emails

Etusivu
Poista viesti
Vastaa
Lähettäjä: Bertrand CHERRIER
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re[2]: [exim] Remove "not reached" emails
Hello jori.hamalainen@???,

a quick perl script that I've found ... somewhere, it was so long ago
I can't remember !
------------------------------------------------
#! /usr/bin/perl -w

`/usr/sbin/exim -bp | grep "*** frozen ***" > unfreeze.txt`;

my $badmessages;

open BADMAIL, "<unfreeze.txt" or die "Could not open unfreeze.txt";

while ( $line = <BADMAIL> ) {

my ( $time, $size, $messagenumber, $sender, $status ) = split( ' ', $line );

print "Time on queue => $time\tSize=>$size\tMessage #=>$messagenumber\n";

$badmessages .= ' ' . $messagenumber;

}

close BADMAIL;

`/usr/sbin/exim -Mrm $badmessages`;

1;
-----------------------------------------------

hope this helps ...

mercredi 20 octobre 2004, 00:43:28, vous avez écrit:

>> exim -bp | grep 'frozen' | xargs -L 1 exim -Mrm
>>
>> And if you want to remove not only 'frozen' messages, but
>> also undelivered bounces, you may want to play with regexp to
>> catch '<>'.


jhtc> But this will also remove messages from me@??? and
jhtc> all derivates with (sub)string frozen. Like "deepfrozen@???".


jhtc> " \*\*frozen\*\*$" helps a bit because **frozen** is last
jhtc> string in mailqueue line separated with whitespace..




jhtc> --
jhtc> ## List details at
jhtc> http://www.exim.org/mailman/listinfo/exim-users Exim details at
jhtc> http://www.exim.org/ ##



--
Best regards,
Bertrand
chr@???
http://www.linux-nc.org
Bow before me, for I am root