- To: edwin@xxxxxxxxxxxxxxxx
- Subject: Re: [SLUG] Flooded mail queue
- From: Glen Turner <glen.turner@xxxxxxxxxxxxx>
- Date: Tue, 29 Jun 2004 11:15:15 +0930
- Cc: Sydney Linux User Group <slug@xxxxxxxxxxx>
- Organization: Australian Academic and Research Network
On Tue, 2004-06-29 at 10:45, Edwin Humphries wrote:
> WE have a sendmail installation that is trying to process a queue of
> some 1.8 million emails - mostly, as far as I can tell, double
> bounce, virus laden stuff.
>
> Of course, sendmail is going into overload, and slowing the machine
> down enormously, and given that the emails are double-bounce, to no
> avail. But i tried to delete the queue with "rm *" in
> /var/spool/mqueue, but got "Argument list too long".
Deleting huge numbers of files:
find /var/spool/mqueue -type f -exec rm -f {} \;
or
find /var/spool/mqueue -type f -print | xargs /bin/rm -f
or for minimal downtime in your scenario
cd /var/spool
/sbin/service sendmail stop
mv mqueue mqueue-1
mkdir mqueue
chown --reference mqueue-1 mqueue
chmod --reference mqueue-1 mqueue
/sbin/service sendmail start
rm -rf /var/spool/mqueue-1
Cheers,
Glen