{"id":6071,"date":"2016-07-27T08:35:49","date_gmt":"2016-07-27T00:35:49","guid":{"rendered":"http:\/\/rmohan.com\/?p=6071"},"modified":"2016-07-27T08:43:39","modified_gmt":"2016-07-27T00:43:39","slug":"qmqtool","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6071","title":{"rendered":"qmqtool"},"content":{"rendered":"<p> cd \/downloads\/<br \/>\ntar zxvfp \/downloads\/qmqtool-1.14.tgz<\/p>\n<p>cd \/downloads\/qmqtool-1.14\/<br \/>\n.\/configure &#8211;perl=\/usr\/bin\/perl &#8211;qmaildir=\/var\/qmail<\/p>\n<p>You should have such result<br \/>\nfound perl: \/usr\/bin\/perl<br \/>\nfound qmail directory: \/var\/qmail<br \/>\nqmqtool will be installed in: \/usr\/local\/script<br \/>\ndocumentation will be installed in \/usr\/local\/man<\/p>\n<p>if any of these values need changing, try .\/configure &#8211;help<\/p>\n<p>Making sure this package is intact..<br \/>\nsrc\/qmqtool syntax OK<br \/>\n&#8230;done.<br \/>\nWriting Makefile&#8230;<\/p>\n<p>now type &#8216;make&#8217; and then &#8216;make install&#8217;<\/p>\n<p>Compile it<br \/>\nmake<br \/>\nmake install<\/p>\n<p>You should have such result<br \/>\nmkdir -p \/usr\/local\/script<br \/>\ncp qmqtool \/usr\/local\/script<br \/>\nchown 0 \/usr\/local\/script\/qmqtool<br \/>\nchmod 755 \/usr\/local\/script\/qmqtool<br \/>\nmkdir -p \/usr\/local\/man\/man8\/<br \/>\ncp qmqtool.8 \/usr\/local\/man\/man8\/<br \/>\nchown 0 \/usr\/local\/man\/man8\/qmqtool.8<br \/>\nchmod 744 \/usr\/local\/man\/man8\/qmqtool.8<\/p>\n<p>ln -s \/usr\/local\/script\/qmqtool \/usr\/local\/bin\/qmqtool<\/p>\n<p>Use it<\/p>\n<p>        qmqtool version 1.14<br \/>\n        syntax: qmqtool [-l] [-L] [-R] [-S [-nN]] [-T] [-s] [-Q] [-c] [-r] [-i [-nN]] [-V]<br \/>\n                        [-E(A|R|L)] [-U(A|R|L)] [-vN [-w]] [-e(N|[-f &#8216;STRING&#8217;][-oN])] [-u(N|[-f &#8216;STRING&#8217;][-oN])]<br \/>\n                        [-d(N|[-f &#8216;STRING&#8217;][-oN])] [-f &#8216;STRING&#8217;] [-oN] [-B(b|r)] [-x(N|[-f &#8216;STRING&#8217;][-oN])]<\/p>\n<p>        -l              list messages in all parts of the queue<br \/>\n        -L              list messages with local recipients<br \/>\n        -R              list messages with remote recipients<br \/>\n        -T              list messages not completely processed<br \/>\n        -s              show statistical information<br \/>\n        -Q              be as quiet as possible (useful for snmp, cron, and such)<br \/>\n        -V              be more verbose<br \/>\n        -B<br \/>\n          b             Backup queue into \/var\/qmail\/queue.backup\/<br \/>\n          r             Restore backup from \/var\/qmail\/queue.backup\/<br \/>\n        -c              check queue consitancy<br \/>\n        -r              repair queue (by deleting fragments) found by checking queue consistancy<br \/>\n        -i              show how many messages are queued per ip address<br \/>\n           -nN          pay attention to the Nth last smtp-hop<br \/>\n        -S              show how many bytes are queued per ip address<br \/>\n        -e              expire message<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<br \/>\n        -u              unexpire message<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<br \/>\n        -d              delete message<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<br \/>\n        -E              expire messages in [A]ll, [R]emote, or [L]ocal queues<br \/>\n        -U              unexpire messages in [A]ll, [R]emote, or [L]ocal queues<br \/>\n        -v<br \/>\n          N             view first 100 lines of message number N<br \/>\n          N -w          view whole message N<br \/>\n        -f &#8216;STRING&#8217;     display comma separated list of message number(s) containing STRING.<br \/>\n                        prints 0 if no matches are found.<br \/>\n        -o N            display comma separated list of message number(s) older than N hours.<br \/>\n                        prints 0 if no matches are found.<br \/>\n        -x N            prints extended information on message N.  format identical to -l.<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<\/p>\n<p>Usage samples :<\/p>\n<p>List all messages in the queue having the subject &#8220;XXX&#8221; (case insensitive)<br \/>\nqmqtool -f &#8216;\/^subject: xxx\/i&#8217;<\/p>\n<p>Delete all messages in the queue having the subject &#8220;XXX&#8221; (case insensitive)<br \/>\nqmqtool -d -f &#8216;\/^subject: XXX\/i&#8217;<br \/>\nqmailctl restart<\/p>\n<p>Delete all messages in the queue from user &#8220;XXX&#8221; (case insensitive)<br \/>\nqmqtool -d -f &#8216;\/^From: XXX\/i&#8217;<br \/>\nqmailctl restart<\/p>\n<p>Who are the top 20 senders for the remote queue<br \/>\nqmqtool -R | grep &#8220;From: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>Who are the top 20 recipients of the remote queue<br \/>\nqmqtool -R | grep &#8220;To: &#8221; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -R | grep &#8220;Envelope Recipient: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>What are the top 20 subjects of the remote queue<br \/>\nqmqtool -R | grep &#8220;Subject: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>What domains are being sent the most mail from the server<br \/>\nqmqtool -R | grep &#8220;To: &#8221; | cut -d @ -f2 | tr -d &#8216;>&#8217; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -R | grep &#8220;Envelope Recipient: &#8221; | cut -d @ -f2 | awk &#8216;{print $1}&#8217; | tr -d &#8216;>&#8217; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>Who are the top receivers for the local queue<br \/>\nqmqtool -L | grep &#8220;To: &#8221; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -L | grep &#8220;Envelope Recipient: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>What domains are have the most mail in the local queue<br \/>\nqmqtool -L | grep &#8220;To: &#8221; | cut -d @ -f2 | tr -d &#8216;>&#8217; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -L | grep &#8220;Envelope Recipient: &#8221; | cut -d @ -f2 | awk &#8216;{print $1}&#8217;<\/p>\n<p>Who most of my remotely queued messages are destined for ?<br \/>\nqmqtool -R | awk &#8216;\/Recipient:\/ { print $3 }&#8217; | sort | uniq -c | sort -n<\/p>\n<p>How can I expire messages with a subject of &#8220;Failure Notice&#8221; that are have been queued for 18+ hours ?<br \/>\nqmqtool -V -e -o 18 -f &#8216;^Subject: Failure Notice&#8217; <\/p>\n<p>tar zxvfp \/downloads\/qmqtool-1.14.tgz<\/p>\n<p>cd \/downloads\/qmqtool-1.14\/<br \/>\n.\/configure &#8211;perl=\/usr\/bin\/perl &#8211;qmaildir=\/var\/qmail<\/p>\n<p>You should have such result<br \/>\nfound perl: \/usr\/bin\/perl<br \/>\nfound qmail directory: \/var\/qmail<br \/>\nqmqtool will be installed in: \/usr\/local\/script<br \/>\ndocumentation will be installed in \/usr\/local\/man<\/p>\n<p>if any of these values need changing, try .\/configure &#8211;help<\/p>\n<p>Making sure this package is intact..<br \/>\nsrc\/qmqtool syntax OK<br \/>\n&#8230;done.<br \/>\nWriting Makefile&#8230;<\/p>\n<p>now type &#8216;make&#8217; and then &#8216;make install&#8217;<\/p>\n<p>Compile it<br \/>\nmake<br \/>\nmake install<\/p>\n<p>You should have such result<br \/>\nmkdir -p \/usr\/local\/script<br \/>\ncp qmqtool \/usr\/local\/script<br \/>\nchown 0 \/usr\/local\/script\/qmqtool<br \/>\nchmod 755 \/usr\/local\/script\/qmqtool<br \/>\nmkdir -p \/usr\/local\/man\/man8\/<br \/>\ncp qmqtool.8 \/usr\/local\/man\/man8\/<br \/>\nchown 0 \/usr\/local\/man\/man8\/qmqtool.8<br \/>\nchmod 744 \/usr\/local\/man\/man8\/qmqtool.8<\/p>\n<p>ln -s \/usr\/local\/script\/qmqtool \/usr\/local\/bin\/qmqtool<\/p>\n<p>Use it<\/p>\n<p>        qmqtool version 1.14<br \/>\n        syntax: qmqtool [-l] [-L] [-R] [-S [-nN]] [-T] [-s] [-Q] [-c] [-r] [-i [-nN]] [-V]<br \/>\n                        [-E(A|R|L)] [-U(A|R|L)] [-vN [-w]] [-e(N|[-f &#8216;STRING&#8217;][-oN])] [-u(N|[-f &#8216;STRING&#8217;][-oN])]<br \/>\n                        [-d(N|[-f &#8216;STRING&#8217;][-oN])] [-f &#8216;STRING&#8217;] [-oN] [-B(b|r)] [-x(N|[-f &#8216;STRING&#8217;][-oN])]<\/p>\n<p>        -l              list messages in all parts of the queue<br \/>\n        -L              list messages with local recipients<br \/>\n        -R              list messages with remote recipients<br \/>\n        -T              list messages not completely processed<br \/>\n        -s              show statistical information<br \/>\n        -Q              be as quiet as possible (useful for snmp, cron, and such)<br \/>\n        -V              be more verbose<br \/>\n        -B<br \/>\n          b             Backup queue into \/var\/qmail\/queue.backup\/<br \/>\n          r             Restore backup from \/var\/qmail\/queue.backup\/<br \/>\n        -c              check queue consitancy<br \/>\n        -r              repair queue (by deleting fragments) found by checking queue consistancy<br \/>\n        -i              show how many messages are queued per ip address<br \/>\n           -nN          pay attention to the Nth last smtp-hop<br \/>\n        -S              show how many bytes are queued per ip address<br \/>\n        -e              expire message<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<br \/>\n        -u              unexpire message<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<br \/>\n        -d              delete message<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<br \/>\n        -E              expire messages in [A]ll, [R]emote, or [L]ocal queues<br \/>\n        -U              unexpire messages in [A]ll, [R]emote, or [L]ocal queues<br \/>\n        -v<br \/>\n          N             view first 100 lines of message number N<br \/>\n          N -w          view whole message N<br \/>\n        -f &#8216;STRING&#8217;     display comma separated list of message number(s) containing STRING.<br \/>\n                        prints 0 if no matches are found.<br \/>\n        -o N            display comma separated list of message number(s) older than N hours.<br \/>\n                        prints 0 if no matches are found.<br \/>\n        -x N            prints extended information on message N.  format identical to -l.<br \/>\n                        may specify N (multiples may be comma separated), or -f &#8216;STRING&#8217; and\/or -o N<\/p>\n<p>Usage samples :<\/p>\n<p>List all messages in the queue having the subject &#8220;XXX&#8221; (case insensitive)<br \/>\nqmqtool -f &#8216;\/^subject: xxx\/i&#8217;<\/p>\n<p>Delete all messages in the queue having the subject &#8220;XXX&#8221; (case insensitive)<br \/>\nqmqtool -d -f &#8216;\/^subject: XXX\/i&#8217;<br \/>\nqmailctl restart<\/p>\n<p>Delete all messages in the queue from user &#8220;XXX&#8221; (case insensitive)<br \/>\nqmqtool -d -f &#8216;\/^From: XXX\/i&#8217;<br \/>\nqmailctl restart<\/p>\n<p>Who are the top 20 senders for the remote queue<br \/>\nqmqtool -R | grep &#8220;From: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>Who are the top 20 recipients of the remote queue<br \/>\nqmqtool -R | grep &#8220;To: &#8221; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -R | grep &#8220;Envelope Recipient: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>What are the top 20 subjects of the remote queue<br \/>\nqmqtool -R | grep &#8220;Subject: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>What domains are being sent the most mail from the server<br \/>\nqmqtool -R | grep &#8220;To: &#8221; | cut -d @ -f2 | tr -d &#8216;>&#8217; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -R | grep &#8220;Envelope Recipient: &#8221; | cut -d @ -f2 | awk &#8216;{print $1}&#8217; | tr -d &#8216;>&#8217; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>Who are the top receivers for the local queue<br \/>\nqmqtool -L | grep &#8220;To: &#8221; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -L | grep &#8220;Envelope Recipient: &#8221; | sort | uniq -c | sort -rn | head -20<\/p>\n<p>What domains are have the most mail in the local queue<br \/>\nqmqtool -L | grep &#8220;To: &#8221; | cut -d @ -f2 | tr -d &#8216;>&#8217; | sort | uniq -c | sort -rn | head -20<br \/>\nqmqtool -L | grep &#8220;Envelope Recipient: &#8221; | cut -d @ -f2 | awk &#8216;{print $1}&#8217;<\/p>\n<p>Who most of my remotely queued messages are destined for ?<br \/>\nqmqtool -R | awk &#8216;\/Recipient:\/ { print $3 }&#8217; | sort | uniq -c | sort -n<\/p>\n<p>How can I expire messages with a subject of &#8220;Failure Notice&#8221; that are have been queued for 18+ hours ?<br \/>\nqmqtool -V -e -o 18 -f &#8216;^Subject: Failure Notice&#8217; <\/p>\n","protected":false},"excerpt":{"rendered":"<p> cd \/downloads\/ tar zxvfp \/downloads\/qmqtool-1.14.tgz<\/p>\n<p>cd \/downloads\/qmqtool-1.14\/ .\/configure &#8211;perl=\/usr\/bin\/perl &#8211;qmaildir=\/var\/qmail<\/p>\n<p>You should have such result found perl: \/usr\/bin\/perl found qmail directory: \/var\/qmail qmqtool will be installed in: \/usr\/local\/script documentation will be installed in \/usr\/local\/man<\/p>\n<p>if any of these values need changing, try .\/configure &#8211;help<\/p>\n<p>Making sure this package is intact.. src\/qmqtool syntax OK &#8230;done. [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6071"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6071"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6071\/revisions"}],"predecessor-version":[{"id":6077,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6071\/revisions\/6077"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}