If your postfix server is running away and it’s chaos because there are 1000s or millions of messages in the queue, your only recourse might be to remove all the messages in the queue and face the backlash of clients who might have missed some email.
However, two situations prevail:
- You’re probably deleting millions of SPAM messages so it will be okay.
- If the email is really so important, maybe the sender must try again? (It’s called tenacity)
So here we are with the commands:
postsuper -d ALL deferred
postsuper -d ALL
postsuper -d mail_queue_id (run mailq command to get the ID)
Reference
https://sharadchhetri.com/2014/02/06/how-to-delete-mail-queue-in-postfix/