Skip to content
January 13, 2008 / dshuck

How to delete all messages from Postfix mail server queue

This is probably and edge case that doesn’t come up very often, but today I found myself with the need to remove all messages from my Postfix queue.  I had generated a LOT of emails that were set for outbound delivery to all the users on InstantSpot using Postfix as the mail server on my laptop.  After generating the messages, I realized that the ISP that I was sitting on doesn’t allow outbound messages from SMTP servers as a spam prevention method.   There was some urgency to the messages that needed to be sent, so I ran the process again on out production server which sits on a more open network.  The messages went out from there and all was well… except that I had a few hundred outbound messages sitting in my queue.  I knew that as soon as I connected to another network, all those messages in my Postfix queue would be delivered … again.

So, after a bit of searching for files locally, I did some Googling and found that you simply have to run the following command:

(as root)

#postsuper -d ALL

(on Debian/Ubuntu)

$sudo postsuper -d ALL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 591 other followers