Another way to do that is to simply touch the file with a date that makes it
older than your queue lifetime (set in /var/qmail/control/queuelifetime).  I
prefer this method since I don't need to stop qmail-send (which is difficult
on a box that typically has 20-30k messages in queue).  When qmail goes to
deliver the message it will notice it's too old and dump it.

-Clayton

-----Original Message-----
From: Bill Gradwohl [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 10:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [vchkpw] Qmail queue


Andrew Averin wrote:

>Hi all,
>How could I clean qmail queue manually????
>  
>
Here's a script I use. I call it nukequeueitem. It shuts down send, 
waits for that to happen, and then nukes the specified items and 
restarts send.

Call it like this:
    ./nukequeueitem 123456 2342454 123123
where the numbers after it are the numbers of the queue items you want 
to nuke.

#!/bin/bash

[ $# -eq 0 ] && exit 1

svc -d /service/qmail-send
echo 'Working ...'
sleep 2s

while ! svstat /service/qmail-send | grep ': down'; do
   echo Still up.
   sleep 2s
done

for x in $@; do
   echo nuking $x
   find /var/qmail/queue -name ${x} -exec rm {} ';'
done

echo

svc -u /service/qmail-send
sleep 3s
svstat /service/*

-- 
Bill Gradwohl
[EMAIL PROTECTED]
http://www.ycc.com
spamSTOMPER Protected email


Reply via email to