How to show and empty the Postfix queue

To show the Postfix queue:

postqueue -p

To empty the queue:

postsuper -d ALL

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

5 Responses to How to show and empty the Postfix queue

  1. Thanks dude! Just what I was looking for!

  2. J$B says:

    Hi Its helpfull but i need command to delete some particular mails from queue

    • Matthew says:

      type man postsuper for details…

      Delete one message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred).

      If a queue_id of – is specified, the program reads queue IDs from standard input. For example, to delete all mail with
      exactly one recipient user@example.com:

      mailq | tail +2 | grep -v ’^ *(’ | awk ´BEGIN { RS = “” }
      # $7=sender, $8=recipient1, $9=recipient2
      { if ($8 == “user@example.com” && $9 == “”)
      print $1 }
      ´ | tr -d ’*!’ | postsuper -d -

  3. LNeto says:

    Thanks dude. Works like a charm on MAMP (Mac OSX) as well.
    Saved me a lot of time.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>