<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JERVIS DOT WS &#187; Exim</title>
	<atom:link href="http://jervis.ws/tag/exim/feed/" rel="self" type="application/rss+xml" />
	<link>http://jervis.ws</link>
	<description>A techie’s thoughts and opinions on anything &#38; everything that comes to mind</description>
	<lastBuildDate>Tue, 15 Feb 2011 20:49:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Delete mail from an exim mail queue</title>
		<link>http://jervis.ws/2008/06/06/delete-mail-from-an-exim-mail-queue/</link>
		<comments>http://jervis.ws/2008/06/06/delete-mail-from-an-exim-mail-queue/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 20:22:03 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Exim]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jervis.ws/?p=32</guid>
		<description><![CDATA[<p>Here is a quick HowTo / TechTip for deleting all the mail from an exim mail queue!</p>
<p>After the issue I blogged about the other day, where a webserver was being used to generate spam, we were left with a lot of spam email in the servers mail queue awaiting delivery.</p>
<p>Amongst other things, this was then [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick HowTo / TechTip for deleting all the mail from an exim mail queue!</p>
<p>After the issue I blogged about the other day, where a webserver was being used to generate spam, we were left with a lot of spam email in the servers mail queue awaiting delivery.</p>
<p>Amongst other things, this was then causing a performance hit on the server sending messages. I decided that the few real emails in the queue were on no importance and to just delete the whole lot.</p>
<p>Chances are as a sysadmin, its a job you may have to do at some point. This is how I cleaned out the exim queue on the webserver and then the one on the outbound mail server.</p>
<p>First off, take a look at your queue:</p>
<p>[user@www user]# exim -bp<br />
As the mail is spam we want to delete it, not empty the queue via SMTP as all the spam will sent to people and our server may be blacklisted.</p>
<p>Delete all the mail in the queue run:</p>
<p>[user@www user]# exim -bpru | awk {&#8216;print $3&#8242;}<br />
| xargs exim -Mrm &gt; deletedmail.txt<br />
We can now check how many mails were removed by running:</p>
<p>[user@www user]# wc -l deletedmail.txt<br />
13416 deletedmail.txt<br />
[user@www user]#<br />
We have now deleted all 13416 mails in the queue and the server is as good as new. (Remember to fix the loop hole first, if you don’t you will soon have alot of spam in the queue again!)</p>
<p>The deletedmail.txt file will look something like this:</p>
<p>Message 1K3FYb-0000wH-CF has been removed<br />
Message 1K3FYb-0000wH-6l has been removed<br />
Message 1K3FYb-0000wH-3r has been removed<br />
Message 1K3FYb-0000wH-1d has been removed<br />
On the mail server, we want to remove all mail from the webserver only. To do this we modify the command line to grep for the sending address.</p>
<p>[user@mail user]# exim -bpru | grep &#8220;&#8221; |<br />
awk {&#8216;print $3&#8242;} | xargs exim -Mrm &gt; deletedmail.txt<br />
[user@mail user]# wc -l deletedmail.txt<br />
73012 deletedmail.txt<br />
[user@mail user]#<br />
So we have now removed 73012 mails from the mail servers queue. This means in my example here, we have saved the internet from 86428 spam emails.</p>
<p>A few other useful exim queue commands include:</p>
<p># exim -q # Flush waiting mail<br />
# exim -qf # Flush all mail<br />
# exim -qff # Flush even frozen mail<br />
To remove frozen mail from the local spool, try this…</p>
<p># exim -bpru | grep &#8220;*** frozen ***&#8221; | awk {&#8216;print $3&#8242;} |<br />
xargs exim -Mrm &gt; deletedmail-frozen.txt</p>
]]></content:encoded>
			<wfw:commentRss>http://jervis.ws/2008/06/06/delete-mail-from-an-exim-mail-queue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim on CentOS</title>
		<link>http://jervis.ws/2008/03/17/exim-on-centos/</link>
		<comments>http://jervis.ws/2008/03/17/exim-on-centos/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 09:17:20 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Exim]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jervis.ws/?p=30</guid>
		<description><![CDATA[<p>This is my quick guide to do an install and basic setup of exim on CentOS. This is not meant as a fully inclusive guide but it will get you on the way. Following this you should get a working exim install.</p>
<p>I will assume you have built a CentOS 4 / 5 Server, have yum [...]]]></description>
			<content:encoded><![CDATA[<p>This is my quick guide to do an install and basic setup of exim on CentOS. This is not meant as a fully inclusive guide but it will get you on the way. Following this you should get a working exim install.</p>
<p>I will assume you have built a CentOS 4 / 5 Server, have yum working and have logged in as root.</p>
<p>You may want to make sure your up to date…<br />
<em>yum update</em></p>
<p>Install exim and mail switching tools<br />
<em>yum install exim<br />
yum install system-switch-mail</em></p>
<p>Switch your MTA &amp; set exim to start on boot<br />
<em>system-switch-mail<br />
service sendmail stop<br />
service exim start<br />
chkconfig exim on<br />
chkconfig sendmail off</em></p>
<p>Add a root alias, eg: “root: me@example.com”<br />
<em>vi /etc/aliases</em></p>
<p>You may also wish to add some config to your routers section like this, if you want to relay through a smart host.<br />
<em>vi /etc/exim/exim.conf</em></p>
<p>Then add this before the “dnslookup:” section.</p>
<p><em>to_smart_host:<br />
driver = manualroute<br />
domains = ! +local_domains<br />
transport = remote_smtp<br />
route_list = “* mail1.example.com:mail2.example.com;”</em></p>
<p>Restart exim<br />
<em>service exim restart</em></p>
<p>To test, send an email<br />
<em>echo “test” |mail -s “$HOSTNAME” me@example.com</em></p>
<p>Then you can flush the Exim Que and watch the log like this<br />
<em>exim -qff ; tail -f /var/log/exim/main.log</em></p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://jervis.ws/2008/03/17/exim-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

