{"id":13,"date":"2006-06-28T11:37:44","date_gmt":"2006-06-28T11:37:44","guid":{"rendered":"http:\/\/ramblingsofasysadmin.com\/blog\/?p=13"},"modified":"2006-06-28T11:37:44","modified_gmt":"2006-06-28T11:37:44","slug":"viewing-and-editing-mail-queues","status":"publish","type":"post","link":"http:\/\/ramblingsofasysadmin.com\/?p=13","title":{"rendered":"viewing and editing mail queues."},"content":{"rendered":"<p>while i&#8217;m excited about getting mail to work on my linux box after such a long time, i think it&#8217;s appropriate to address some useful applications to view mail queues (and edit them whenever necessary).<br \/>\nfirst, let&#8217;s look at this in sendmail.<br \/>\nyou can use one of the two commands below which essentially do the same thing:<br \/>\n<font face=\"courier\"># \/usr\/sbin\/sendmail -bp<br \/>\n\/var\/spool\/mqueue is empty<br \/>\nTotal requests: 0<br \/>\n<\/font><br \/>\nor<br \/>\n<font face=\"courier\"># mailq<br \/>\n\/var\/spool\/mqueue is empty<br \/>\nTotal requests: 0<br \/>\n<\/font><br \/>\nif you have numerous messages in your queue and you want to empty them out, simply:<br \/>\n<font face=\"courier\"># cd \/var\/spool\/mqueue<br \/>\n# rm <insert your file name here><br \/>\n<\/font><br \/>\nnow, to do the same on qmail, you will need to get an application called <a href=\"http:\/\/sourceforge.net\/projects\/qmhandle\" target=\"_new\">qmHandle<\/a>.  once you install this, you can view the number of messages in the queue by typing:<br \/>\n<font face=\"courier\"># qmHandle -s<br \/>\nMessages in local queue: 0<br \/>\nMessages in remote queue: 47<br \/>\n<\/font><br \/>\nif you want more detailed information, including messageid, from, to, and subject lines:<br \/>\n<font face=\"courier\"># qmHandle -l<\/font><br \/>\nyou can delete items with problematic subject lines as such:<br \/>\n<font face=\"courier\"># qmHandle -S&#8217;failure notice&#8217;<\/font><br \/>\nor<br \/>\n<font face=\"courier\"># qmHandle -Sailure<\/font><br \/>\nwill work just as well (and will delete all emails that include the text string &#8220;ailure&#8221; in the subject).<br \/>\nyou can also view the subject\/from\/to of emails in the queue by typing:<br \/>\n<font face=\"courier\">fgrep Subject \/var\/qmail\/queue\/mess\/*\/*<\/font><br \/>\nor<br \/>\n<font face=\"courier\">fgrep From \/var\/qmail\/queue\/mess\/*\/*<\/font><br \/>\nthis command is far more useful &#8212; it will search each email for any text in the email, whether body, subject, recipient, or sender.<br \/>\nany offensive emails in the queue?  you now know where to go.<br \/>\n<font face=\"courier\"># fgrep Testing \/var\/qmail\/queue\/mess\/*\/*<br \/>\n\/var\/qmail\/queue\/mess\/12\/28952688:Testing,<br \/>\n# rm \/var\/qmail\/queue\/mess\/12\/28952688<br \/>\n<\/font><br \/>\nfinally, you can attempt to send all emails in the queue by using the command below:<br \/>\n<font face=\"courier\"># qmHandle -a<\/font><br \/>\nif the emails cannot be sent at any time for whatever reason, they will remain in the queue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>while i&#8217;m excited about getting mail to work on my linux box after such a long time, i think it&#8217;s appropriate to address some useful applications to view mail queues (and edit them whenever necessary). first, let&#8217;s look at this in sendmail. you can use one of the two commands below which essentially do the same thing: # \/usr\/sbin\/sendmail -bp \/var\/spool\/mqueue is empty Total requests: 0 or # mailq \/var\/spool\/mqueue is empty Total requests: 0 <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"http:\/\/ramblingsofasysadmin.com\/?p=13\" class=\"more-link\"><span>Read More &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-system-tools"],"_links":{"self":[{"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":0,"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"wp:attachment":[{"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}