m d3velopment a technical, development and security blog

12Jul/09Off

Postfix Queue Maintenance

From time to time its necessary to carry out maintenance on Postfix's queues, especially after a massive influx of spam or mail queue issues.

This command will delete one specific email from the mail queue (taken from the postsuper man page):

#mailq | tail +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" } { if ($8 == "email@address.com" && $9 == "") print $1 } ' | tr -d '*!' | postsuper -d -

Note that "email@ddress.com" should be replaced with the messages noted email address.

To clear (delete) the entire Postfix queue, run the following command:

#postsuper -d ALL

Note: This command will delete all messages in the Postfix queue. If you need more selective deleting, this can be done as well, use 'man postsuper' to find out all of the available options.

Tagged as: Comments Off
Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.