+1

How to delete all messages from Postfix mail server queue

Linux

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

matt said:
 
much thanks! i was really dreading having to delete all the spam from a customers queue manually. i'm happy to report:

[root@server home]# postsuper -d ALL
postsuper: Deleted: 1283 messages
 
posted 416 days ago
Add Comment Reply to: this comment OR this thread
 

Search