Re: [Exim] cancelling pending mails?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Sheldon Hearn
Fecha:  
A: kss
Cc: exim-users
Asunto: Re: [Exim] cancelling pending mails?

On Tue, 13 Nov 2001 16:38:05 +0900, =?EUC-KR?B?sce8+Lyx?= wrote:

> Could anyone please let me know how to delete all the pending mails
> currently on queue? When I type "mailq" as a superuser, there are so many
> pending mails. I even deleted every files on /var/spool/exim/input but
> it seems that those pending mails are still in. How can I get rid of
> these pending mails?


The mailq command (exim -bp) can struggle with large queues.

Try this with a POSIX-compliant shell (Linux's /bin/sh should work):

    d=/var/spool/exim/input
    exim_bin=/usr/local/sbin/exim


    for f in `find $d -name '*-D'`; do
        i=${f##*/}
        i=${i%-D}
        echo $i
    done | xargs ${exim_bin} -Mg


The for loop takes every data spool file, trims off the leading path and
the trailing '-D', and outputs the result, which happens to be a message
id. The xargs utility then passes a bunch of ids at a time to the exim
-Mg command, which gives up on the specified messages.

> And is there any parameter which regulates how long or how many times
> should exim try to deliver the email and if it couldn't deliver mail
> during that specified length of time or that numbers, it simply give up
> delivering and send error message back to the original sender?


Yes, see the "Retry configuration" chapter of the manual
(specification).

Ciao,
Sheldon.