In Sendmail MTA traditionally you use the “sendmail -q” command to flush mail queue. In Postfix MTA, use the following command to flush the queued mail.
Flush Or Purge Mail Queue
To flush or purge the postfix mail queue, just type the below command:
# postfix -f OR # postfix flush
Check Mail Queue
To see the mail queue type the below command:
Remove All Mail From Queue
To remove all mail from queue type the below queue:
# postsuper -d ALL
Delete An Individual Email From The Queue
If you need to delete an individual email form the queue, first you need to see the queue mail.
# postqueue -p
5642B4F47* 1583500 Fri Sep 8 09:37:27 [email protected] [email protected] 93dFADFAR* 1535730 Fri Sep 8 08:36:53 [email protected] [email protected]
In above output first number is the message ID, If you want to delte one of them, type the below command:
# postsuper -d 5642B4F47
It will delete only one email from the queue, that specific email you want to delete from it.
Delete All Deferred mails
Type the below command to delete all deferred mails.
# postsuper -d ALL deferred