Flush Mail Queue - Postfix
Postfix Flush the Mail Queue
Just enter the following command to flush the mail queue:
# postfix flush
OR
# postfix -f
To see mail queue, enter:
# mailq
To remove all mail from the queue, enter:
# postsuper -d ALL
To remove all mails in the deferred queue, enter:
# postsuper -d ALL deferred
Postfix provides with postsuper, postqueue and mailq some shell utilitys to manage the mailqueue.
Here are some examples for common tasks:
List all messages that are in the mailqueue
# postqueue -p
replace MessageID with the ID of the message, eg 501CA23B43DB
root @ server: / # postsuper-d 501CA23B43DB
If your server has very high load and you want to temporarily move all message from the incoming queue to the hold queue, use the command:
# postsuper -h ALL
to move the messages back to the incoming queue, use the command:
# postsuper -r ALL
Instead of the word "ALL" you can also provide a specific message ID to move only one message to or from the hold queue. Message in the hold queue will not processed by postfix until they were requeued with postsuper-r.