Technology Insights

Clear Out Postfix Queue, Analyze Postfix Email Queue

Earlier today we had a minor issue on a development server that generated around 175,000 emails dumped into a Postfix queue in a short amount of time. I needed to first analyze the emails and second clear the Postfix queue. Below is information on how to learn more about the emails in the Postfix queue, what domain they are being sent to, and last but not least delete those emails from the queue if they are not needed.

Technology Insights

Remove Amavis Content Filter From Postfix Configuration, Requeue All Postfix Email Messages

I installed ISPConfig awhile back on a web hosting server that at one point also hosted email accounts. I recently moved all of the email to a different server and wanted to cut down on CPU and memory usage so I needed to disable amavisd, clamd, courier-imap, and courier-authlib. These services provided a way to receive email via POP3 and IMAP as well as content filtering and virus scanning for all of that email. So after shutting all of the services down I needed to remove the reference to the local content filter from Postfix because if amavis is shut down and mail is sent from a web application to the localhost then the connection will be refused and Postfix will not send the email. Below I describe the Postfix configuration lines to comment out as well as a way to reload all of the queued email into the Postfix queue so it could be sent again.