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

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to