<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Exim Remove All messages From the Mail Queue</title> <atom:link href="http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Thiwanka</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-64819</link> <dc:creator>Thiwanka</dc:creator> <pubDate>Thu, 24 Nov 2011 13:34:30 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-64819</guid> <description>Thanks Tyler. It works.!</description> <content:encoded><![CDATA[<p>Thanks Tyler. It works.!</p> ]]></content:encoded> </item> <item><title>By: Eric Gillette</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-63783</link> <dc:creator>Eric Gillette</dc:creator> <pubDate>Sat, 22 Oct 2011 00:28:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-63783</guid> <description>Tyler,
Thanks for your post -- I saw what Akbar was trying to accomplish, but was wondering if there was a simpler way to do, and then I read down further to your post.
I had a client who had over 300,000 messages in the Exim Queue after his server was compromised by a PHP script and using exiqgrep didn&#039;t seem to work (since I imagine exiqgrep doesn&#039;t expect to encounter that many messages in Exim&#039;s queue in the first place).
I created a shell command out of your command there, and ran it, and voila -- everything is back to normal.
In addition, I think it may be of note to mention that configserver.com makes two applications that are free for WHM called CMM (Mail Manager) and CMQ (Mail Queue Manager) which help with these kinds of issues, but of course if you have a massive queue (300,000 messages for example) they won&#039;t really help much, since they also use Exim&#039;s built-in toolset to run the commands.
Thanks again Tyler! =0)</description> <content:encoded><![CDATA[<p>Tyler,</p><p>Thanks for your post &#8212; I saw what Akbar was trying to accomplish, but was wondering if there was a simpler way to do, and then I read down further to your post.</p><p>I had a client who had over 300,000 messages in the Exim Queue after his server was compromised by a PHP script and using exiqgrep didn&#8217;t seem to work (since I imagine exiqgrep doesn&#8217;t expect to encounter that many messages in Exim&#8217;s queue in the first place).</p><p>I created a shell command out of your command there, and ran it, and voila &#8212; everything is back to normal.</p><p>In addition, I think it may be of note to mention that configserver.com makes two applications that are free for WHM called CMM (Mail Manager) and CMQ (Mail Queue Manager) which help with these kinds of issues, but of course if you have a massive queue (300,000 messages for example) they won&#8217;t really help much, since they also use Exim&#8217;s built-in toolset to run the commands.</p><p>Thanks again Tyler! =0)</p> ]]></content:encoded> </item> <item><title>By: Luis Santana</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-61895</link> <dc:creator>Luis Santana</dc:creator> <pubDate>Thu, 25 Aug 2011 23:36:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-61895</guid> <description>Another command which can be used for this is the following
exim -bp &#124;awk {&#039;print $3&#039;} &#124;xargs exim -Mrm</description> <content:encoded><![CDATA[<p>Another command which can be used for this is the following</p><p>exim -bp |awk {&#8216;print $3&#8242;} |xargs exim -Mrm</p> ]]></content:encoded> </item> <item><title>By: Reikor</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-57483</link> <dc:creator>Reikor</dc:creator> <pubDate>Fri, 22 Apr 2011 07:03:49 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-57483</guid> <description>I client of my have been hacked and they sent about 40 millions of mails.
I have all of them in the input folder, i cant ls, du or nothing, this is a sh*t.
Anyone have some script that do this really fast ? i dont want to wait 1 month for clean up.</description> <content:encoded><![CDATA[<p>I client of my have been hacked and they sent about 40 millions of mails.<br
/> I have all of them in the input folder, i cant ls, du or nothing, this is a sh*t.<br
/> Anyone have some script that do this really fast ? i dont want to wait 1 month for clean up.</p> ]]></content:encoded> </item> <item><title>By: bony</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-49963</link> <dc:creator>bony</dc:creator> <pubDate>Thu, 07 Oct 2010 03:48:08 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-49963</guid> <description>i want to remove 4000 messages</description> <content:encoded><![CDATA[<p>i want to remove 4000 messages</p> ]]></content:encoded> </item> <item><title>By: J. Ruiz</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-46783</link> <dc:creator>J. Ruiz</dc:creator> <pubDate>Wed, 07 Apr 2010 13:57:21 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-46783</guid> <description>Hello,
About the Dallas Marlow comment:
It&#039;s possible to do it without the &quot;exim -bp&quot; command.
The command &quot;exiqgrep -i &#124; xargs exim -Mrm&quot; does exactly the same, because exiqgrep looks up the queue by itself.
Regards,
J. Ruiz</description> <content:encoded><![CDATA[<p>Hello,</p><p>About the Dallas Marlow comment:</p><p>It&#8217;s possible to do it without the &#8220;exim -bp&#8221; command.</p><p>The command &#8220;exiqgrep -i | xargs exim -Mrm&#8221; does exactly the same, because exiqgrep looks up the queue by itself.</p><p>Regards,</p><p>J. Ruiz</p> ]]></content:encoded> </item> <item><title>By: Prashant Naik</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-43475</link> <dc:creator>Prashant Naik</dc:creator> <pubDate>Sat, 29 Aug 2009 14:42:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-43475</guid> <description>To check the no. of mails in the queue use the command
exim -bpc
To check the list of pending mails use
exim -bp
To deliver the mails use
exim -qf -d
If working on a Server then check the load on it (using the command w ) and if the load is not high (less than 1.o) then you could also set 1 or 2 mail runners (do not set more than 2 as the load on the server may increase) using the command
exim -qf &amp;</description> <content:encoded><![CDATA[<p>To check the no. of mails in the queue use the command<br
/> exim -bpc</p><p>To check the list of pending mails use<br
/> exim -bp</p><p>To deliver the mails use<br
/> exim -qf -d</p><p>If working on a Server then check the load on it (using the command w ) and if the load is not high (less than 1.o) then you could also set 1 or 2 mail runners (do not set more than 2 as the load on the server may increase) using the command<br
/> exim -qf &amp;</p> ]]></content:encoded> </item> <item><title>By: Tyler</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-43131</link> <dc:creator>Tyler</dc:creator> <pubDate>Sat, 15 Aug 2009 07:52:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-43131</guid> <description>&lt;i&gt;akbar:&lt;/i&gt;
Your function can be simplified as:
&lt;code&gt;for dir in /var/spool/exim/input/*; do cd $dir; ls &#124; xargs rm -f; done&lt;/code&gt;
Of course, if your intention is to simply remove all files (not directories) underneath /var/spool/exim/input, that process can be simplified as follows:
&lt;code&gt;find /var/spool/exim/input -type f -exec rm -f {} +&lt;/code&gt;
Of course, this assumes that there are no files below &lt;i&gt;input&lt;/i&gt; that shouldn&#039;t be deleted.</description> <content:encoded><![CDATA[<p><i>akbar:</i></p><p>Your function can be simplified as:<br
/> <code>for dir in /var/spool/exim/input/*; do cd $dir; ls | xargs rm -f; done</code></p><p>Of course, if your intention is to simply remove all files (not directories) underneath /var/spool/exim/input, that process can be simplified as follows:</p><p><code>find /var/spool/exim/input -type f -exec rm -f {} +</code></p><p>Of course, this assumes that there are no files below <i>input</i> that shouldn&#8217;t be deleted.</p> ]]></content:encoded> </item> <item><title>By: Oldzhay</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-41968</link> <dc:creator>Oldzhay</dc:creator> <pubDate>Mon, 08 Jun 2009 08:42:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-41968</guid> <description>&quot;Well, I remove all the messages in the queue but still am not able to send any mail&quot;
...this is another problem.  Can you post some log here pls,  and we can look for a solution</description> <content:encoded><![CDATA[<p>&#8220;Well, I remove all the messages in the queue but still am not able to send any mail&#8221;<br
/> &#8230;this is another problem.  Can you post some log here pls,  and we can look for a solution</p> ]]></content:encoded> </item> <item><title>By: Houssam Ballout</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-41949</link> <dc:creator>Houssam Ballout</dc:creator> <pubDate>Sun, 07 Jun 2009 12:13:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-41949</guid> <description>Well, I remove all the messages in the queue but still am not able to send any mail :(</description> <content:encoded><![CDATA[<p>Well, I remove all the messages in the queue but still am not able to send any mail :(</p> ]]></content:encoded> </item> <item><title>By: Gabriel M</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-40116</link> <dc:creator>Gabriel M</dc:creator> <pubDate>Wed, 04 Feb 2009 02:09:43 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-40116</guid> <description>Thanks Oldzhay for you router to delete messages older than x seconds, I will definately test &amp; apply in my setup.</description> <content:encoded><![CDATA[<p>Thanks Oldzhay for you router to delete messages older than x seconds, I will definately test &amp; apply in my setup.</p> ]]></content:encoded> </item> <item><title>By: akbar</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-39780</link> <dc:creator>akbar</dc:creator> <pubDate>Sat, 10 Jan 2009 03:08:16 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-39780</guid> <description>Have you been remove about 1200821 queue ?
it wont work with &quot;exim -bp &#124; exiqgrep -i &#124; xargs exim -Mrm&quot; ( I tried to wait until 24hours, it get my swap until 0 free)
so it must use script to remove the queue, in my case:
-list all directory in &#039;input&#039; folder:
cd /var/spool/exim/input ; ls &gt;&gt; /tmp/folder
-create a script name &quot;removeall&quot;
echo &quot;for b in `ls` ; do rm -f $b ; done&quot; &gt;&gt; /tmp/removeall ; chmod 700 /tmp/removeall
- go to input folder and exec command
for a in `cat /tmp/folder` ; do cd $a ; /tmp/removeall ; cd .. ; done
and it work great :)</description> <content:encoded><![CDATA[<p>Have you been remove about 1200821 queue ?<br
/> it wont work with &#8220;exim -bp | exiqgrep -i | xargs exim -Mrm&#8221; ( I tried to wait until 24hours, it get my swap until 0 free)<br
/> so it must use script to remove the queue, in my case:<br
/> -list all directory in &#8216;input&#8217; folder:<br
/> cd /var/spool/exim/input ; ls &gt;&gt; /tmp/folder<br
/> -create a script name &#8220;removeall&#8221;<br
/> echo &#8220;for b in `ls` ; do rm -f $b ; done&#8221; &gt;&gt; /tmp/removeall ; chmod 700 /tmp/removeall<br
/> - go to input folder and exec command<br
/> for a in `cat /tmp/folder` ; do cd $a ; /tmp/removeall ; cd .. ; done</p><p>and it work great :)</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-39267</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 19 Nov 2008 13:08:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-39267</guid> <description>Dallas,
The faq has been updated with your command. Thanks for sharing with us!</description> <content:encoded><![CDATA[<p>Dallas,</p><p>The faq has been updated with your command. Thanks for sharing with us!</p> ]]></content:encoded> </item> <item><title>By: Dallas Marlow</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-39266</link> <dc:creator>Dallas Marlow</dc:creator> <pubDate>Wed, 19 Nov 2008 13:04:21 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-39266</guid> <description>this is a much cleaner/safer way to do the same thing (using the tools provided by all modern exim installations)
exim -bp &#124; exiqgrep -i &#124; xargs exim -Mrm
exim -bp # this prints the contents of the mail queue
exiqgrep # extracts the id from each mail
xargs exim -Mrm # removes the mail
exiqgrep is pretty flexible (for instance if you wanted to only extract the frozen email id&#039;s used exiqgrep -iz ), exipick is an extension of exiqgrep that can help a bit too.</description> <content:encoded><![CDATA[<p>this is a much cleaner/safer way to do the same thing (using the tools provided by all modern exim installations)</p><p>exim -bp | exiqgrep -i | xargs exim -Mrm</p><p>exim -bp # this prints the contents of the mail queue<br
/> exiqgrep # extracts the id from each mail<br
/> xargs exim -Mrm # removes the mail</p><p>exiqgrep is pretty flexible (for instance if you wanted to only extract the frozen email id&#8217;s used exiqgrep -iz ), exipick is an extension of exiqgrep that can help a bit too.</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-39265</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 19 Nov 2008 12:41:08 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-39265</guid> <description>Oldzhay,
Thanks for sharing your solution!</description> <content:encoded><![CDATA[<p>Oldzhay,</p><p>Thanks for sharing your solution!</p> ]]></content:encoded> </item> <item><title>By: Oldzhay</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-39264</link> <dc:creator>Oldzhay</dc:creator> <pubDate>Wed, 19 Nov 2008 12:32:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-39264</guid> <description>Another solution is put this router in the EXIM configure and run some queue runners - exim -qff&amp;
If you place the router in first place he will delete all messages older than X seconds. 1800 = 30 min.
router_mailxpire:
&lt;pre&gt; driver = redirect
condition = ${if &gt;= {$message_age}{1800}}
data = /dev/null
file_transport = address_file
no_more&lt;/pre&gt;
... you are welcome :)
Cheers</description> <content:encoded><![CDATA[<p>Another solution is put this router in the EXIM configure and run some queue runners &#8211; exim -qff&amp;</p><p>If you place the router in first place he will delete all messages older than X seconds. 1800 = 30 min.</p><p>router_mailxpire:</p><pre> driver = redirect
 condition = ${if &gt;= {$message_age}{1800}}
 data = /dev/null
 file_transport = address_file
 no_more</pre><p>&#8230; you are welcome :)</p><p>Cheers</p> ]]></content:encoded> </item> <item><title>By: Oldzhay</title><link>http://www.cyberciti.biz/faq/exim-remove-all-messages-from-the-mail-queue/#comment-39263</link> <dc:creator>Oldzhay</dc:creator> <pubDate>Wed, 19 Nov 2008 12:22:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=2491#comment-39263</guid> <description>Hello,
the most secure thing (and the most ugly one) you can do is delete all files from EXIM input folder (/var/spool/exim/input). The folder that uses exim to keep the mail queue .
EXIM creates 2 files for email - 1 for the headers part and another for the message body. Erasing everything from this folder must erase the queue.
EXIM names the files with the msg_id an put -H or -D part on the end of filename - H for headers an -D for body file
&lt;pre&gt;-rw-r-----  1 exim exim 17961 nov 19 12:12 1L2kyk-0007gm-0v-D
-rw-r-----  1 exim exim  1172 nov 19 12:12 1L2kyk-0007gm-0v-H&lt;/pre&gt;
The solution of Vivek is good, but for less traffic, otherwise if you manage lots of emails I recommend you to rm the files.
One of my cases:
&lt;code&gt;[root@mta1 ~]# exim -bpc&lt;/code&gt;
O/p:
&lt;pre&gt;213376&lt;/pre&gt;
... and i afraid i cannot use this solution.
Regards
Ol.
Bulgaria</description> <content:encoded><![CDATA[<p>Hello,<br
/> the most secure thing (and the most ugly one) you can do is delete all files from EXIM input folder (/var/spool/exim/input). The folder that uses exim to keep the mail queue .</p><p>EXIM creates 2 files for email &#8211; 1 for the headers part and another for the message body. Erasing everything from this folder must erase the queue.</p><p>EXIM names the files with the msg_id an put -H or -D part on the end of filename &#8211; H for headers an -D for body file</p><pre>-rw-r-----  1 exim exim 17961 nov 19 12:12 1L2kyk-0007gm-0v-D
-rw-r-----  1 exim exim  1172 nov 19 12:12 1L2kyk-0007gm-0v-H</pre><p>The solution of Vivek is good, but for less traffic, otherwise if you manage lots of emails I recommend you to rm the files.</p><p>One of my cases:<br
/> <code>[root@mta1 ~]# exim -bpc</code><br
/> O/p:</p><pre>213376</pre><p>&#8230; and i afraid i cannot use this solution.</p><p>Regards<br
/> Ol.<br
/> Bulgaria</p> ]]></content:encoded> </item> </channel> </rss>
