Queued messages ?
MailScanner
mailscanner at SMITS.CO.UK
Sun Feb 29 10:36:27 GMT 2004
This is the 'quick and dirty' first version of the script. Sendmail
only, I'm afraid. Use it as qkill /var/spool/mqueue
#!/usr/bin/perl
use strict;
# argument is the path to the queue files
my $dir = shift;
# remove any trailing slash
$dir =~ s/\/$//;
# max number of retries
my $max = 4;
# Look inside all qf files
while (glob($dir."/qf*")) {
chomp(my $num = `grep '^N\d*' $_`); # Find the Nxxx value
(retries)
$num =~ s/N//; # Remove the N
my $mid = $_; # The name of the
current qf
$mid =~ s/qf/\?\?/; # regexp for all
related files
chomp(my $bounce = `grep 'Return-Path' $_`); # Find the
'Return-Path'
$bounce =~ s/^.*?Return-Path.*?<//; # And remove up to the
<
system "rm -f $mid" if (($bounce !~ m/@/) && ($num > $max)); # kill
files for NDR > 4 retries
}
Bart...
________________________________
From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK] On
Behalf Of MailScanner
Posted At: 25 February 2004 17:47
Posted To: MailScanner
Conversation: Queued messages ?
Subject: Re: Queued messages ?
I'm considering a perl script on an hourly cron job to check all qf
files in the outbound queue and delete those files and their
corresponding df files, that have have an empty (< >) from: field and
have a retry count of at least four. (four strikes and you're out)
This would give legitimate NDR's a fair chance of being delivered and
remove all but the last few hours of bogus NDR's.
I will post updates here
Bart...
________________________________
From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK] On
Behalf Of Max Kipness
Posted At: 25 February 2004 16:17
Posted To: MailScanner
Conversation: Queued messages ?
Subject: Queued messages ?
Anybody have any suggestion for this problem??
----------------------------------------------------------------------
Hope this isn't too off topic. I does have to do with MailScanner.
I'm relaying several email domains to several servers and have extended
the 4 hour and 4 day warning and bounce back times in sendmail to 2
weeks. This is do to a client that is going through weekend power
outages at the moment.
I now have roughly 2000 emails in the queue, 95% of them have <> as the
sender. This also do to the fact that I am sending spam warning messages
to senders, and must do this for false-positives.
I was thinking of creating a script that parses the results of mailq and
deletes every email with <> as the sender on a daily basis.
Any thoughts on this? Pros and cons? Has anyone done this? Or is there
anything in MailScanner that helps with this?
Thanks,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20040229/a53ee027/attachment.html
More information about the MailScanner
mailing list