<?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>R.I.Pienaar &#187; exim</title>
	<atom:link href="http://www.devco.net/archives/tag/exim/feed" rel="self" type="application/rss+xml" />
	<link>http://www.devco.net</link>
	<description>www.devco.net</description>
	<lastBuildDate>Thu, 29 Jul 2010 09:08:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>DKIM with CentOS 5 and Exim</title>
		<link>http://www.devco.net/archives/2010/05/14/dkim_with_centos_5_and_exim.php</link>
		<comments>http://www.devco.net/archives/2010/05/14/dkim_with_centos_5_and_exim.php#comments</comments>
		<pubDate>Fri, 14 May 2010 18:56:27 +0000</pubDate>
		<dc:creator>R.I. Pienaar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.devco.net/?p=1443</guid>
		<description><![CDATA[DomainKeys Identified Mail &#8211; DKIM &#8211; is a recent attempt to add some sender verification to email. Read more here, here and in the RFC 4871 to get some background info. If you&#8217;re sending any newsletters you really want to be investigating this, if you&#8217;re doing anti spam it&#8217;s good to start looking at tracking [...]]]></description>
			<content:encoded><![CDATA[<p>DomainKeys Identified Mail &#8211; DKIM &#8211; is a recent attempt to add some sender verification to email.  Read more <a href="http://www.dkim.org/">here</a>, <a href="http://en.wikipedia.org/wiki/DomainKeys_Identified_Mail">here</a> and in the <a href="http://www.ietf.org/rfc/rfc4871.txt">RFC 4871</a> to get some background info.</p>
<p>If you&#8217;re sending any newsletters you really want to be investigating this, if you&#8217;re doing anti spam it&#8217;s good to start looking at tracking this and really everyone should have DKIM on their domains.  Exim recently &#8211; as of 4.70 &#8211; have decent support for it but CentOS is still on 4.63 thanks to RHEL.</p>
<p>To get a new Exim on your CentOS machine I suggest just using <a href="http://atrpms.net/dist/el5/">ATrpms</a> who as of writing has <em>4.71</em> packages available for Exim and the other bits you need.  I needed:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">exim-4.71-40.el5.i386.rpm
exim-mysql-4.71-40.el5.i386.rpm
libspf2_2-1.2.5-5.0.el5.i386.rpm
libsrs_alt1-1.0-3_rc1.0.el5.i386.rpm</pre></div></div>

<p></code></p>
<p>As well as the 64bit versions, you can just add ATrpms to your systems but really you should have your own repos and carefully control the packages that goes out to your estate.</p>
<p>Once you have upgraded your stock Exim to these versions &#8211; it&#8217;s a totally clean and compatible upgrade &#8211; configuring Exim to automagically sign outgoing mail with DKIM is pretty easy.  We&#8217;ll make it so it looks for keys in a specific location based on outgoing mail domain so if you&#8217;re a relay for many domains you just need to drop down the certs.</p>
<p>Put the following near the top of our <em>/etc/exim/exim.conf</em> file, this just sets some macros we&#8217;ll use later on:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DKIM_DOMAIN = ${lc:${domain:$h_from:}}
DKIM_FILE = /etc/exim/dkim/${lc:${domain:$h_from:}}.pem
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}</pre></div></div>

<p></code></p>
<p>This will use, based on sender domain, a private key in <em>/etc/exim/dkim/sender_domain.pem</em>.  By default exim just logs DKIM verification, doesn&#8217;t block any incoming mail I won&#8217;t cover doing blocks here just sending.</p>
<p>Next find your <em>remote_smtp</em> transport later in the file and change it to look like this:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">remote_smtp:
  driver = smtp
  dkim_domain = DKIM_DOMAIN
  dkim_selector = x
  dkim_private_key = DKIM_PRIVATE_KEY
  dkim_canon = relaxed
  dkim_strict = 0</pre></div></div>

<p></code></p>
<p>This will make Exim do the DKIM signing on outgoing mail but only if it can find a certificate.</p>
<p>To make the certificates is pretty easy, we&#8217;ll use a domain <em>example.com</em>:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ mkdir /etc/exim/dkim/ &amp;&amp; cd /etc/exim/dkim/
$ openssl genrsa -out example.com.pem 768 
$ openssl rsa -in example.com.pem -out example.com-public.pem -pubout -outform PEM</pre></div></div>

<p></code></p>
<p>All that&#8217;s left now is to update your dns, sticking to <em>example.com</em> you&#8217;d add something like this into your bind zone file the text to add after <em>p=</em> is the stuff you&#8217;ll find in the public key called <em>example.com-public.pem</em> in our example:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">x._domainkey     IN      TXT     &quot;v=DKIM1\; t=y\; k=rsa\; p=MIGfMA0&lt;snip&gt;AQAB&quot;
_domainkey       IN      TXT     &quot;t=y\; o=~\;&quot;</pre></div></div>

<p></code></p>
<p>The <em>x</em> matches up with your <em>dkim_selector</em> in the SMTP transport above.  The <em>t=y</em> tells the world you&#8217;re still testing your setup so remove that only when you&#8217;re all 100% certain it works.  The <em>o=~</em> tells everyone you will sign only some mail.  You can make that <em>o=-</em> if all mail from you would be signed.</p>
<p>You can verify your DNS is right like this:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ dig +short txt x._domainkey.example.com
&quot;v=DKIM1\; k=rsa\; p=MIGfMA0&lt;snip&gt;AQAB&quot;</pre></div></div>

<p></code></p>
<p>And finally if you&#8217;re sending mail you should now see a header in the mail like this:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=example.com; s=x;
	h=From:To:Message-Id:Date; bh=g3zLY&lt;snip&gt;5uGs=; b=fonAB&lt;snip&gt;bceHhQ==;</pre></div></div>

<p></code></p>
<p>Finally you can send an email to <em>check-auth@verifier.port25.com</em> and it will reply with all sorts of test output about your domain including DKIM validation details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devco.net/archives/2010/05/14/dkim_with_centos_5_and_exim.php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Exim, MCollective and speed</title>
		<link>http://www.devco.net/archives/2009/12/14/exim_mcollective_and_speed.php</link>
		<comments>http://www.devco.net/archives/2009/12/14/exim_mcollective_and_speed.php#comments</comments>
		<pubDate>Mon, 14 Dec 2009 22:22:08 +0000</pubDate>
		<dc:creator>R.I. Pienaar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[mcollective]]></category>

		<guid isPermaLink="false">http://www.devco.net/?p=1216</guid>
		<description><![CDATA[Usually when I describe mcollective to someone they generally think its nice and all but the infrastructure to install is quite a bit and so ssh parallel tools like cap seems a better choice. They like the discovery and stuff but it&#8217;s not all that clear. I have a different end-game in mind than just [...]]]></description>
			<content:encoded><![CDATA[<p>Usually when I describe <a href="http://code.google.com/p/mcollective/">mcollective</a> to someone they generally think its nice and all but the infrastructure to install is quite a bit and so ssh parallel tools like cap seems a better choice.  They like the discovery and stuff but it&#8217;s not all that clear. </p>
<p>I have a different end-game in mind than just restarting services, and I&#8217;ve made a video to show just how I manage a cluster of Exim servers using mcollective.  This video should give you some ideas about the possibilities that the architecture I chose brings to the table and just what it can enable.</p>
<p>While watching the video please note how quick and interactive everything is, then keep in mind the following while you are seeing the dialog driven app:</p>
<ul>
<li>I am logged in via SSH from UK to Germany into a little VM there</li>
<li>The mcollective client talks to a Germany based ActiveMQ</li>
<li>The 4 mail servers in the 2nd part of the demo are based 2 x US, 1 x UK and 1 x DE</li>
<li>I have ActiveMQ instances in each of the above countries clustered together using the technique previous <a href="http://www.devco.net/archives/2009/11/10/activemq_clustering.php">documented here</a>.</li>
</ul>
<p>Here&#8217;s the video then, as before I suggest you hit the full screen link and watch it that way to see what&#8217;s going on.</p>
<p><center><br />
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param name='movie' value='http://screenr.com/Content/assets/screenr_1116090935.swf' /><param name='flashvars' value='i=33849' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=33849' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object><br />
</center><br />

<p>
This is the end game, I want a framework to enable this kind of tool on Unix CLI &#8211; complete with pipes as you&#8217;d expect &#8211; things like the dialog interface you see here, on the web, in general shell scripts and in nagios checks like with cucumber-nagios, all sharing a API and all talking to a collective of servers as if they are one.  I want to make building these apps easy, quick and fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devco.net/archives/2009/12/14/exim_mcollective_and_speed.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
