The following script seems to have worked for me. Note that you don't 
"touch" the "mess" file under ./queue/ but the corresponding "info" file, 
as per FAQ 7.3.

Checking the log, messages appear to be SLOWLY retrying, and then expiring 
with the message:

Jun 24 15:17:38 bsdpop qmail: 930251858.063072 delivery 523142: failure: 
Sorry,_
I_wasn't_able_to_establish_an_SMTP_connection._(#4.4.1)/I'm_not_going_to  
_try_aga
in;_this_message_has_been_in_the_queue_too_long./

and the qmail-qstat is going down, although gradually.

Let me know if this is helpful or can be improved.

Dave

p.s. I created this script today to purge out a bunch of spam from the same 
domain; so, it searches the "From:" line. This might have to change for 
other spammers.

#!/bin/sh
#
# purge_spam.sh
#
# Dave Kitabjian
#   [EMAIL PROTECTED]
#
# As a parameter, give string to look for on the From: line.
# Since deleting the file isn't safe, we simply "touch"
#   the "info" file corresponding to the "mess" message file
#   so that it artificially expires and is removed automatically.
#   You may have to run "qmail-tcpok" first.
#

if [ $# -ne 1 ]
then
        echo "$0: Usage: $0 From_string_to_search_for"
        exit 1
fi

QUEUE="/usr/qmail/queue"

cd $QUEUE
fixed_string="`echo $1 | sed 's/\./\\\./g'`"

cd mess
for message in `find . -type f`
do
        if [ `grep "^From:.*${fixed_string}.*" $message | wc -l` -gt 0 ]
        then
                # touch the "info" file:
                info_file="../info/${message}"
                echo "Touching: $info_file"
                # 6/7/66 is a special birthday that's definitely > 7 days 
ago :)

                touch -t 196606070000.00 $info_file
        fi
done
############################################

Reply via email to