{"id":4298,"date":"2013-02-05T23:17:48","date_gmt":"2013-02-05T15:17:48","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4298"},"modified":"2023-04-28T09:48:57","modified_gmt":"2023-04-28T09:48:57","slug":"how-to-remove-the-postfix-mail-queue","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-remove-the-postfix-mail-queue\/","title":{"rendered":"How to Remove the Postfix Mail Queue"},"content":{"rendered":"<p>Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers an email. Under Postfix MTA, there are basic command to empty or remove Postfix Mail Queue. In the case of the postfix MTA server suddenly offline or postfix service not respond, all the mail will be in queued. To avoid the messages sent out when it reconnected to the internet, you have an option to empty the mail queue. In this post, i will show how to remove the Postfix Mail Queue using postsuper command. <\/p>\n<p>1. Send an email using telnet command :<\/p>\n<pre>\n[root@centos63 ~]# telnet localhost 25\nTrying ::1...\nConnected to localhost.\nEscape character is '^]'.\n220 centos63.ehowstuff.local ESMTP Postfix\nhelo abc.com\n250 centos63.ehowstuff.local\nmail from:<admin @ehowstuff.com>\n250 2.1.0 Ok\nrcpt to:<\/admin><admin @ehowstuff.com>\n250 2.1.5 Ok\ndata\n354 End data with <cr><lf>.<cr><lf>\nsubject: Test\n.\n250 2.0.0 Ok: queued as DB92A1231\nquit\n221 2.0.0 Bye\nConnection closed by foreign host.\n<\/lf><\/cr><\/lf><\/cr><\/admin><\/pre>\n<p>2. To see mail queue, enter the following :<\/p>\n<pre>\n[root@centos63 ~]# mailq\n-Queue ID- --Size-- ----Arrival Time---- -Sender\/Recipient-------\nDB92A1231*      359 Tue Feb  5 22:14:01  admin@ehowstuff.com\n                                         admin@ehowstuff.com\n\n-- 0 Kbytes in 1 Request.\n<\/pre>\n<p>3. Check mail transaction log  :<\/p>\n<pre>\n[root@centos63 ~]# grep DB92A1231 \/var\/log\/maillog\n2013-02-05T22:14:14.899894+08:00 centos63 postfix\/smtpd[2406]: DB92A1231: client=localhost[::1]\n2013-02-05T22:14:23.843262+08:00 centos63 postfix\/cleanup[2422]: DB92A1231: message-id=&lt;20130205141414.DB92A1231@centos63.ehowstuff.local>\n2013-02-05T22:14:23.946379+08:00 centos63 postfix\/qmgr[2197]: DB92A1231: from=<admin @ehowstuff.com>, size=359, nrcpt=1 (queue active)\n2013-02-05T22:14:55.526423+08:00 centos63 postfix\/smtp[2423]: DB92A1231: to=<\/admin><admin @ehowstuff.com>, relay=none, delay=54, delays=22\/0.02\/32\/0, dsn=4.4.1, status=deferred (connect to ehowstuff.com[184.173.214.97]:25: Connection timed out)\n<\/admin><\/pre>\n<p>4. To remove all mails in the deferred queue, enter the following :<\/p>\n<pre>\n[root@centos63 ~]# postsuper -d ALL deferred\npostsuper: Deleted: 1 message\n<\/pre>\n<p>5. To remove all mail from the queue, enter the following :<\/p>\n<pre>\n[root@centos63 ~]# postsuper -d ALL\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers an email. Under Postfix MTA, there are basic command to empty or remove Postfix Mail Queue&#8230;.<\/p>\n","protected":false},"author":6,"featured_media":4299,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1028],"tags":[1536],"class_list":["post-4298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postfix","tag-linux"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4298"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4298\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/4299"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}