{"id":3806,"date":"2015-07-07T21:03:47","date_gmt":"2015-07-07T21:03:47","guid":{"rendered":"http:\/\/www.deuzebranaweb.com.br\/?p=3806"},"modified":"2015-07-07T21:03:47","modified_gmt":"2015-07-07T21:03:47","slug":"3806","status":"publish","type":"post","link":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/2015\/07\/07\/3806\/","title":{"rendered":"Gerenciamento do exim via comando (terminal)"},"content":{"rendered":"<p><strong>Gerenciamento B\u00e1sico de fila do exim;<\/strong><br \/>\n# a count of all messages in queue<br \/>\nexim -bpc<\/p>\n<p># a list of message in the queue (time queued, message size, message id, sender, recipient)<br \/>\nexim -bp<\/p>\n<p># a summary of all messages in queue (count, volume, oldest, newest, destination domain)<br \/>\nexim -bp | exiqsumm<\/p>\n<p># determine how exim would route a message<br \/>\nexim -bt user@domain.com<\/p>\n<p># test how exim would deal with a connection from a specific IP address.<br \/>\n# this will display Exim&#8217;s filters and ACLs<br \/>\nexim -bh 192.168.1.1<\/p>\n<p style=\"text-align: left;\">Como pesquisar a fila exim com exiqgrep;<\/p>\n<p># lists messages from a specified sender<br \/>\nexiqgrep -f [user]@domain<\/p>\n<p># lists messages to a specified recipient<br \/>\nexiqgrep -r [user]@domain<\/p>\n<p># lists messages older than a number of seconds<br \/>\nexiqgrep -o [seconds]<\/p>\n<p># lists messages younger than a number of seconds<br \/>\nexiqgrep -y [seconds]<\/p>\n<p># lists messages that match the specified size (can be a regex)<br \/>\nexiqgrep -s &#8216;^2&#8230;$&#8217;<\/p>\n<p>http:\/\/www.sant-media.co.uk\/2011\/03\/exim-queue-management-tutorial\/<\/p>\n<p>&nbsp;<\/p>\n<p>You can combine the following switches to further restrict the output of the above<\/p>\n<p><strong>-i<\/strong> to just list the message IDs<\/p>\n<p><strong>-z<\/strong> to just show frozen messages<\/p>\n<p><strong>-x<\/strong> to just show unfrozen messages<\/p>\n<p><strong>Gerenciamento de fila Exim;<\/strong><\/p>\n<div id=\"wpshdo_3\" class=\"wp-synhighlighter-outer\">\n<div id=\"wpshdi_3\" class=\"wp-synhighlighter-inner\">\n<pre class=\"bash\"><span class=\"co0\"># Start a queue run (won't run if over load threshold)<\/span>\nexim <span class=\"re5\">-q<\/span> <span class=\"re5\">-v<\/span>\n\u00a0\n<span class=\"co0\"># Force a queue run (will run regardless of load)<\/span>\nexim <span class=\"re5\">-qf<\/span> <span class=\"re5\">-v<\/span>\n\u00a0\n<span class=\"co0\"># Start queue run for local deliveries only<\/span>\nexim <span class=\"re5\">-ql<\/span> <span class=\"re5\">-v<\/span>\n\u00a0\n<span class=\"co0\"># Remove a message from queue by ID<\/span>\nexim <span class=\"re5\">-Mrm<\/span> <span class=\"sy0\">&lt;<\/span>message-id<span class=\"sy0\">&gt;<\/span> ...\n\u00a0\n<span class=\"co0\"># Freeze a message<\/span>\nexim <span class=\"re5\">-Mf<\/span> <span class=\"sy0\">&lt;<\/span>message-id<span class=\"sy0\">&gt;<\/span> ...\n\u00a0\n<span class=\"co0\"># Thaw a message<\/span>\nexim <span class=\"re5\">-Mt<\/span> <span class=\"sy0\">&lt;<\/span>message-d<span class=\"sy0\">&gt;<\/span> ...\n\u00a0\n<span class=\"co0\"># Force delivery of a message regardless of Frozen status<\/span>\nexim <span class=\"re5\">-M<\/span> <span class=\"sy0\">&lt;<\/span>message-id<span class=\"sy0\">&gt;<\/span> ...\n\u00a0\n<span class=\"co0\"># View a message's logs<\/span>\nexim Mvl\n\u00a0\n<span class=\"co0\"># View a message's headers<\/span>\nexim Mvh\n\u00a0\n<span class=\"co0\"># View a message's body<\/span>\nexim Mvb<\/pre>\n<\/div>\n<\/div>\n<p><strong>Avan\u00e7ados de gerenciamento de fila exim;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"bash\"><span class=\"co0\"># List all queued messages, grouped by sender address<\/span>\nexim <span class=\"re5\">-bpr<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> <span class=\"re5\">-Eo<\/span> <span class=\"st0\">\"&lt;[^ ]*@[^ ]*&gt;\"<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sort<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">uniq<\/span> <span class=\"re5\">-c<\/span>\n\u00a0\n<span class=\"co0\"># List all queued messages, grouped by recipient address<\/span>\nexim <span class=\"re5\">-bpr<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> <span class=\"re5\">-Eo<\/span> <span class=\"st0\">\"^\\s*[^ ]*@[^ ]*$\"<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sort<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">uniq<\/span> <span class=\"re5\">-c<\/span>\n\u00a0\n<span class=\"co0\"># Remove all messages older than 12hrs (43000 seconds)<\/span>\nexiqgrep <span class=\"re5\">-o<\/span> 43000 <span class=\"re5\">-i<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">xargs<\/span> exim <span class=\"re5\">-Mrm<\/span>\n\u00a0\n<span class=\"co0\"># Remove all frozen messages from the queue<\/span>\nexiqgrep <span class=\"re5\">-z<\/span> <span class=\"re5\">-i<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">xargs<\/span> exim <span class=\"re5\">-Mrm<\/span>\n\u00a0\n<span class=\"co0\"># Remove all messages from a particular sender<\/span>\nexiqgrep <span class=\"re5\">-i<\/span> <span class=\"re5\">-f<\/span> <span class=\"br0\">[<\/span>user<span class=\"br0\">]<\/span><span class=\"sy0\">@<\/span>domain.com <span class=\"sy0\">|<\/span> <span class=\"kw2\">xargs<\/span> exim <span class=\"re5\">-Mrm<\/span>\n\u00a0\n<span class=\"co0\"># Remove all messages from a sender that are older than 12hrs<\/span>\nexiqgrep <span class=\"re5\">-o<\/span> 43000 <span class=\"re5\">-i<\/span> <span class=\"re5\">-f<\/span> <span class=\"br0\">[<\/span>user<span class=\"br0\">]<\/span><span class=\"sy0\">@<\/span>domain.com <span class=\"sy0\">|<\/span> <span class=\"kw2\">xargs<\/span> exim <span class=\"re5\">-Mrm\n\n\n<\/span><\/pre>\n<p>1. To delete mail with certain string in the message.<\/p>\n<p>grep -lr \u2018a certain string\u2019 \/var\/spool\/exim\/input\/ | \\sed -e \u2018s\/^.*\\\/\\([a-zA-Z0-9-]*\\)-[DH]$\/\\1\/g\u2019 | xargs exim -Mrm<\/p>\n<p>2. To delete all mails from a specific sender.<\/p>\n<p>exiqgrep -i -f <a href=\"mailto:user@domain.com\">user@domain.com<\/a> | xargs exim -Mrm<\/p>\n<p>or<\/p>\n<p># exim -bp|grep \u201cusername\u201d| awk {\u2018print $3\u2032}| xargs exim -Mrm<\/p>\n<pre class=\"bash\"><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Gerenciamento B\u00e1sico de fila do exim; # a count of all messages in queue exim -bpc # a list of message in the queue (time queued, message size, message id, sender, recipient) exim -bp # a summary of all messages in queue (count, volume, oldest,&#8230;<\/p>\n","protected":false},"author":2,"featured_media":3828,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_angie_page":false,"page_builder":"","footnotes":""},"categories":[18,19],"tags":[],"class_list":["post-3806","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-comandos-linux","category-whmcapenel"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=3806"}],"version-history":[{"count":0,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3806\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/media\/3828"}],"wp:attachment":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}