{"id":420,"date":"2018-01-10T09:24:07","date_gmt":"2018-01-10T09:24:07","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=420"},"modified":"2018-01-10T09:24:07","modified_gmt":"2018-01-10T09:24:07","slug":"how-to-clear-postfix-and-exim-queue","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-clear-postfix-and-exim-queue.html","title":{"rendered":"How To: Clear Postfix and Exim Queue"},"content":{"rendered":"<h4>How to clear postfix queue<\/h4>\n<p>Postfix queue can be cleared using the postsuper command. The syntax is as following:<\/p>\n<p><code># postsuper -d ALL<\/code><\/p>\n<p>It will clear all the postfix queue. You can specifically clear the deferred emails for example from the postfix queue as following:<\/p>\n<p><code># postsuper -d ALL deferred<\/code><\/p>\n<p>If you have a large quantity in postfix queue, there is actually a quicker and easier way to do that. You can simply remove all the folders under \/var\/spool\/postfix and it will clear the queue.<\/p>\n<p><code># rm -Rf \/var\/spool\/postfix\/*<br \/>\n# mailq | tail -n 1<br \/>\nMail queue is empty<\/code><\/p>\n<p>Note: The folders inside postfix would get created automatically once the queue starts filling up, nothing to worry about.<\/p>\n<h4>How to clear Exim Queue<\/h4>\n<p>Exim queue can be checked using the following:<\/p>\n<p><code># exim -bp<\/code><\/p>\n<p>To check the number of mails in queue, you can use:<\/p>\n<p><code># exim -bpc<\/code><\/p>\n<p>To remove a message from exim queue, you need to use the following:<\/p>\n<p><code># exim -Mrm {message-id}<\/code><\/p>\n<p>There is no build in command to clear all the mails from exim queue. You can use a pipe command to clear the exim queue as following:<\/p>\n<p><code># exim -bp | exiqgrep -i | xargs exim -Mrm<\/code><\/p>\n<p>Although, there are even quicker and easier way to clear the exim queue, specially if you have a lot of emails in queue and the server is pretty loaded.<\/p>\n<p><code># rm -Rf \/var\/spool\/exim\/input<\/code><\/p>\n<p>Removing the input directory should clear the exim queue. Note: The directory would automatically create once the exim starts it&#8217;s queue again, no need to worry.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to clear postfix queue Postfix queue can be cleared using the postsuper command. The syntax is as following: # postsuper -d ALL It will clear all the postfix queue. You can specifically clear the deferred emails for example from the postfix queue as following: # postsuper -d ALL deferred If you have a large &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-clear-postfix-and-exim-queue.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To: Clear Postfix and Exim Queue&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[193,180,12,211,191,21,150,192],"tags":[252,253,251,254,247],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/420"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=420"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/420\/revisions"}],"predecessor-version":[{"id":421,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/420\/revisions\/421"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}