<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Topdog.za.net</title>
    <link>http://www.topdog.za.net</link>
    <description>A bored sysadmin</description>
    <pubDate>Fri, 26 Feb 2016 10:06:56 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Setup Postfix to sign and verify Domainkeys email</title>
      <link>http://www.topdog.za.net/2008/03/10/setup-postfix-to-sign-and-verify-domainkeys-email</link>
      <pubDate>Mon, 10 Mar 2008 23:54:00 SAST</pubDate>
      <category><![CDATA[Postfix]]></category>
      <category><![CDATA[Domainkeys]]></category>
      <category><![CDATA[Howto]]></category>
      <category><![CDATA[Email]]></category>
      <category><![CDATA[Centos]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2008/03/10/setup-postfix-to-sign-and-verify-domainkeys-email</guid>
      <description>Setup Postfix to sign and verify Domainkeys email</description>
      <content:encoded><![CDATA[<h2>Introduction</h2>
<p>Domainkeys is DomainKeys is a method of e-mail authentication. Unlike some
other methods, it offers almost end-to-end integrity from a signing to a
verifying Mail Transfer Agent (MTA). In most cases the signing MTA acts on
behalf of the sender, and the verifying MTA on behalf of the receiver.
DomainKeys is specified in Historic RFC 4870, which is obsoleted by Standards
Track RFC 4871, DomainKeys Identified Mail (DKIM) Signatures. according to
the wikipedia. So why a how to on it when there is DKIM ? Well domainkeys is
still actively being used and is more widely deployed than DKIM, the developer
yahoo still uses it to sign and verify mail although they are contributers to
the DKIM standard.</p>
<p>We will be using the milter implementation of domainkeys
<a href="http://sourceforge.net/projects
/dk-milter">http://sourceforge.net/projects/dk-milter</a> on CENTOS 5.1.</p>
<h2>Installation</h2>
<p>Install the rpm</p>
<pre><code># rpm -Uvh http://www.topdog-software.com/oss/dk-milter/dk-milter-0.6.0-1.i386.rpm
</code></pre>
<h2>Generate the keys</h2>
<p>A script to do this is provided with the rpm.</p>
<pre><code># /usr/share/doc/dk-milter-0.6.0/gentxt.sh &lt;selector&gt; &lt;domainname&gt;
</code></pre>
<p>Where <selector> is anything you want to call it i use default and
<domainname> is your domain name for which you will be signing mail. This
script will produce 3 files</p>
<p><selector>.txt - this contains the text to add to your zone file</p>
<pre><code>default._domainkey IN TXT "g=; k=rsa; t=y; p=MFwwDQYJKoZIhvcNAQEBBQADS
wAwSAJBAJQfGTmsFzILU6ep6aSFg+WrTkaOLmoRillFNbOpNOr5Gst5H8wG9Oh2SpUytaru
P/7j/eWQ8Wyz6zX2gAtzwF0CAwEAAQ==" ; ----- DomainKey default for example.com
</code></pre>
<p><selector>.public - It is the public key</p>
<pre><code>-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJQfGTmsFzILU6ep6aSFg+WrTkaOLmoR
illFNbOpNOr5Gst5H8wG9Oh2SpUytaruP/7j/eWQ8Wyz6zX2gAtzwF0CAwEAAQ==
-----END PUBLIC KEY-----
</code></pre>
<p><selector>.private - This is the private key</p>
<pre><code>-----BEGIN RSA PRIVATE KEY-----
MIIBOwIBAAJBAJQfGTmsFzILU6ep6aSFg+WrTkaOLmoRillFNbOpNOr5Gst5H8wG
9Oh2SpUytaruP/7j/eWQ8Wyz6zX2gAtzwF0CAwEAAQJACHWqPCf+/yW0dmv24yWY
/eIFy3PNZNNxol2YjpVIZ28SgOSRrC0vzH+SpR1WZURAOcHi+WQa0AJPeqxM4Y1g
xQIhAMVjPNPW8u0sMpNIcev9JBUjUjbilOgY2FTfyNQV0SKjAiEAwBrO5T8XLZQ6
eRUUzz7yWYCHZln6CgD0lhBuZzu4wP8CIQCq8AT2Y7ie4l6uI9fcia2czKjfNRvF
X/bAkchGutoRRwIgF2KsEQgvICNNQvQoBlqZUf/te640XAdlvubdKcABa60CIQCU
DKlMOSxHp4Ms+KT41MFHkHDI/gkFfHvVRhL1PmuwtQ==
-----END RSA PRIVATE KEY----
</code></pre>
<p>Install the private key</p>
<h1>mv default.private /etc/mail/domainkeys/dk_<domainname>.pem</h1>
<pre><code> # chown dk-milt.dk-milt /etc/mail/domainkeys/dk_&lt;domainname&gt;.pem
 # chmod 600 /etc/mail/domainkey/dk_&lt;domainname&gt;.pem
</code></pre>
<h2>DNS</h2>
<p>Add the contents of <selector>.txt to your DNS zone file</p>
<p>Add the following to your DNS zone file</p>
<pre><code>_domainkey IN TXT "t=y; o=~"
</code></pre>
<p>Verify your DNS configuration <a href="http://domainkeys.sourceforge.net/policycheck.html">http://domainkeys.sourceforge.net/policycheck.html</a></p>
<h2>Configuration</h2>
<p>Edit the file /etc/sysconfig/dk-milter and set the following options</p>
<pre><code># Default values
#
USER="dk-milt"
PORT="local:/var/run/dk-milter/dk.sock"
SIGNING_DOMAIN="&lt;domainname&gt;"
SELECTOR_NAME="&lt;selector&gt;"
KEYFILE="/etc/mail/domainkeys/dk_${SIGNING_DOMAIN}.pem"
SIGNER=yes
VERIFIER=yes
CANON=simple
REJECTION="bad=r,dns=t,int=t,no=a,miss=r"
EXTRA_ARGS="-h -l -D"
MILTER_GROUP="mail"
</code></pre>
<h2>Configure Postfix</h2>
<p>Add this to the postfix configuration file /etc/postfix/main.cf</p>
<pre><code>smtpd_milters = unix:/var/run/dk-milter/dk.sock
non_smtpd_milters = unix:/var/run/dk-milter/dk.sock
</code></pre>
<p>Append to the existing milters if you have other milters already configured.</p>
<p>Start dk-milter and Restart Postfix</p>
<h1>chkconfig –level 345 dk-milter on</h1>
<pre><code># service dk-milter start
# service postfix restart
</code></pre>
<h2>Testing</h2>
<p>To test send a mail to autorespond+dk@dk.elandsys.com. you will recieve a
response email with the test results. If you have a yahoo account you can send
a mail to that as well a sample of signed message in yahoo is below</p>
<p><a href="/media/yahoo.jpg"><img alt="" src="/media/yahoo.jpg" /></a></p>
<h2>References</h2>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Domainkeys">http://en.wikipedia.org/wiki/Domainkeys</a></li>
<li><a href="http://domainkeys.sourceforge.net/">http://domainkeys.sourceforge.net/</a></li>
<li><a href="http://www.elandsys.com/resources/sendmail/domainkeys.html">http://www.elandsys.com/resources/sendmail/domainkeys.html</a></li>
<li><a href="http://www.postfix.org/MILTER_README.html">http://www.postfix.org/MILTER_README.html</a></li>
<li><a href="http://www.topdog-software.com/oss/dk-milter/">http://www.topdog-software.com/oss/dk-milter/</a></li>
</ul>]]></content:encoded>
    </item>
  </channel>
</rss>
