06 Feb

Queue management with qmail/plesk

Here’s some handy tips for managing your qmail queue on a linux machine, which can be helpful for debugging:

Clear your Queue

Firstly, stop Qmail from your PLESK control panel in Server > Services, or run this command:
service qmail stop

Now log into a shell terminal (probably via SSH) and then run these commands:

find /var/qmail/queue/mess -type f -exec rm {} \;
find /var/qmail/queue/info -type f -exec rm {} \;
find /var/qmail/queue/local -type f -exec rm {} \;
find /var/qmail/queue/intd -type f -exec rm {} \;
find /var/qmail/queue/todo -type f -exec rm {} \;
find /var/qmail/queue/remote -type f -exec rm {} \;

Once those are finished, just restart your mail server again from PLESK and you’re done! Alternatively run this
service qmail start

View how many messages are in your queue:

Run this command:

/var/qmail/bin/qmail-qstat

And you’ll get something along the lines of:

messages in queue: xxxxxx
messages in queue but not yet preprocessed: x

If you liked this post, why not share it?

  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Reddit
  • RSS
  • StumbleUpon
  • Technorati
  • Twitter
  • Yes, this is not something you'd do on a live machine, only under certain circumstances (e.g. few mails, all spam etc.)
  • Bill
    Pardon my noob question, but will this delete the messages in the queue waiting to go out, or will this just tidy things up so that the message that are waiting to go out can have a better chance of being sent? From my vague understanding of this, it seems like it's just going to whack everything and start over fresh. (And that's a good way to make people grumpy)

    Thanks,
    Bill
blog comments powered by Disqus