I recently needed to clear down a qmail queue. There were no valid emails on the server but the queue was full of failed spam (blocked)
This script clears the queue.
rm -rf info intd local mess remote todo
for i in `seq 0 22`; do
cp -r mess info
cp -r mess intd
cp -r mess local
cp -r mess remote
cp -r mess todo
chmod -R 750 mess todo
chown -R qmailq:qmail mess todo
chmod -R 700 info intd local remote
chown -R qmailq:qmail intd
chown -R qmails:qmail info local remote[/sourcecode]
If your qmail queue is in a different location modify the cd command to the relevant directory.