{"id":935,"date":"2014-11-04T21:26:38","date_gmt":"2014-11-04T21:26:38","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=935"},"modified":"2014-11-04T21:26:38","modified_gmt":"2014-11-04T21:26:38","slug":"clear-mail-queue-postfix-plesk","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/11\/04\/clear-mail-queue-postfix-plesk\/","title":{"rendered":"Clear Mail queue on Postfix or Plesk"},"content":{"rendered":"<p>How to clear the mailqueue.<\/p>\n<p>Check the mailq:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# \/usr\/local\/psa\/admin\/bin\/mailqueuemng -s\n<\/pre>\n<p>View 5 of the items for a certain domain:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# \/usr\/local\/psa\/admin\/bin\/mailqueuemng -s | grep -C 5 user@domain.com\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# \/usr\/local\/psa\/admin\/bin\/mailqueuemng -D&quot;\n<\/pre>\n<p>or<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# postsuper -d ALL\n<\/pre>\n<p>If you get a permission error on an older PLesk 9 instance<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# \/usr\/sbin\/postsuper -d ALL\n<\/pre>\n<p>To remove specific emails from a domain:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# postqueue -p | tail -n +2 | awk &#039;BEGIN { RS = &quot;&quot; } \/@domain\\.com\/ { print $1 }&#039; | tr -d &#039;*!&#039; | postsuper -d -\n<\/pre>\n<p>Or <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# mailq | tail -n +2 | grep -v &#039;^ *(&#039; | awk  &#039;BEGIN { RS = &quot;&quot; } { if ($8 == &quot;USER@EXAMPLE.COM&quot; &amp;&amp; $9 == &quot;&quot;) print $1 } &#039; | tr -d &#039;*!&#039; | postsuper -d -\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to clear the mailqueue. Check the mailq: # \/usr\/local\/psa\/admin\/bin\/mailqueuemng -s View 5 of the items for a certain domain: # \/usr\/local\/psa\/admin\/bin\/mailqueuemng -s | grep -C 5 user@domain.com # \/usr\/local\/psa\/admin\/bin\/mailqueuemng -D&quot; or # postsuper -d ALL If you get a permission error on an older PLesk 9 instance # \/usr\/sbin\/postsuper -d ALL To remove specific &#8230; <a title=\"Clear Mail queue on Postfix or Plesk\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/11\/04\/clear-mail-queue-postfix-plesk\/\" aria-label=\"Read more about Clear Mail queue on Postfix or Plesk\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,86,87],"tags":[],"class_list":["post-935","post","type-post","status-publish","format-standard","hentry","category-emal","category-plesk","category-postfix"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=935"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/935\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}