Re: [exim] Exim can't delete queue

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Phil Pennock
Date:  
À: shwick
CC: exim-users
Sujet: Re: [exim] Exim can't delete queue
On 2008-10-04 at 18:43 -0700, shwick wrote:
> I have 10 frozen messages in the queue and I can't delete them. Both of
> these commands:
>
> sudo exim -bpr | grep frozen | awk '{print $3}' | xargs exim -Mrm
>
> sudo exim4 -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | sh
>
> return Permission Denied. Also I know that only the sender of the mail can
> delete it so I tried it without sudo, still denied.


Unix shell lesson: the sudo does not apply to the entire pipeline; it is
the command run in the first unit, before the |.

It's:
{ sudo exim -bpr ;} | { grep frozen ;} | { awk '{print $3}' ;} | \
{ xargs exim -Mrm ;}

So you're invoking the Exim queue-listing as root, but not the exim for
removing the items.

Bill advices setting the admin user. It's good advice. I just figured
it was worth explaining why what you tried didn't work.

It's probably also worth using:
fgrep '*** frozen ***'
so that you don't catch mails with frozen somewhere in the address.
While theoretically someone could send mail from
<"*** frozen ***"@???> I suspect you don't have to worry so much
about that one. (fgrep is a fixed string grep, so that * is not a
meta-character).

-Phil