Mailing List Archive

Remove message from queue?
Hi

I know this must be a FAQ, but there is nothing in the FAQ regarding
this!

What is the preferred/safe way to remove a message from the queue? I
have tried to remove files from the info and mess directories, but I
would prefer to do this "the right way".

Best regards,
Karsten.

--
M.Sc.E.E, Sys/Net-administrator, BOFH, Aalborg University, Denmark
http://www.kom.auc.dk/~karthy/ for more information.
SunSITE Denmark Manager (http://sunsite.auc.dk/)
Re: Remove message from queue? [ In reply to ]
[ Karsten Thygesen <karthy@kom.auc.dk> 1997-3 -25 10:58 +0100 ]
|---
| What is the preferred/safe way to remove a message from the queue? I
| have tried to remove files from the info and mess directories, but I
| would prefer to do this "the right way".

Stop qmail (send qmail-send a SIGTERM and wait for it to finish).
Then remove the files.
Restart qmail.

- Harald
Re: Remove message from queue? [ In reply to ]
>>>>> "Harald" == Harald Hanche-Olsen <hanche@imf.unit.no> writes:

Harald> [ Karsten Thygesen <karthy@kom.auc.dk> 1997-3 -25 10:58 +0100
Harald> ] |--- | What is the preferred/safe way to remove a message
Harald> from the queue? I | have tried to remove files from the info
Harald> and mess directories, but I | would prefer to do this "the
Harald> right way".

Harald> Stop qmail (send qmail-send a SIGTERM and wait for it to
Harald> finish). Then remove the files. Restart qmail.

Yes, but which files? Do I have to find all files in all directories,
or can I just remove them from one of the directories, whereafter
qmail-clean will clean up the mess?

Best,
Karsten
Re: Remove message from queue? [ In reply to ]
Karsten Thygesen wrote:
> Yes, but which files? Do I have to find all files in all directories,
> or can I just remove them from one of the directories, whereafter
> qmail-clean will clean up the mess?

Nope. Remove all files. They are unique anyway. Otherwise you have to
have daft things like MMDF's cleanque (which has been bugging me all
week).

Something like "find . -name 5675 -print", and then put a "|xargs rm -f"
on the end afterwards when you are sure it's only picking up the files
you want. And then restart qmail.

-Dom
Re: Remove message from queue? [ In reply to ]
[ Dom Mitchell <hdm@demon.net> 1997-3 -25 12:16 +0000 ]
|---
| Something like "find . -name 5675 -print", and then put a "|xargs rm -f"
| on the end afterwards when you are sure it's only picking up the files
| you want. And then restart qmail.

How about qmailrm 5675 where qmailrm is the following script?

#!/bin/sh

cd /var/qmail/queue || exit 1

for i in "$@"; do
for x in bounce todo; do rm -f $x/$i; done
m=`expr $i % 23`
for x in info local mess remote; do rm -f $x/$m/$i; done
done

- Harald