Method of Flushing Postfix Queue:
For flushing the Postfix queue in Ubuntu 20.04, you will need to perform the following steps:
- In this method, we are going to flush the Postfix queue via terminal commands in Ubuntu 20.04. Therefore, we will press Ctrl+ T or right-click anywhere on the desktop and then choose the Terminal option from the menu that appears to launch the terminal. Alternatively, we can even click on the Activities tab present on the desktop and then type terminal in the respective search bar. Then click on the terminal search result to launch the terminal window, as shown in the image below:
- Now before flushing the email queue, it is advisable to have a look at your Postfix queue to know what resides inside it so that you do not end up deleting any important emails. For doing that, type the following command in your terminal and then press the Enter key:
As soon as this command executes successfully, you will be able to see all the emails that currently reside in your Postfix queue. This command is also shown in the following image:
- Once you have the knowledge about the content of your postfix queue and you have ensured that there is no important stuff inside it, you can either flush it out entirely, or you can even delete the deferred emails only. For completely flushing out the Postfix queue, type the following command in your terminal and then press the Enter key:
Here, the “sudo” keyword is used because this command requires root privileges to run. If you omit this keyword, you will not be allowed to proceed with the execution of this command. It is shown in the image below:
- As soon as the execution of this command finishes, your Postfix queue will be entirely flushed out. To confirm if this has happened or not, type the following command in your terminal and then press the Enter key:
If the postsuper command has been executed successfully, then running the command mentioned above will tell you that your mail queue is empty since you have flushed it out completely as shown in the following image:
- However, if you only want to delete the deferred emails, i.e., the emails that have not been delivered to the recipient’s mailing server, then type the following command in your terminal followed by pressing the Enter key:
Again, this command also requires root privileges to run; therefore, you must not omit the “sudo” keyword with it. Running this command will only delete the deferred emails from your Postfix queue. This command is shown in the image below:
Conclusion:
By making use of the method described in this article, you can quickly get rid of all the emails from your Postfix queue and hence clear it out for making space for more emails in the future. This method is extremely simple and convenient to follow, and it only takes a few seconds to get your work done by following this super-efficient method.