<?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 DKIM on Postfix with OpenDKIM</title>
      <link>http://www.topdog.za.net/2012/04/29/setup-dkim-on-postfix-with-opendkim</link>
      <pubDate>Sun, 29 Apr 2012 06:50:00 SAST</pubDate>
      <category><![CDATA[Postfix]]></category>
      <category><![CDATA[Howto]]></category>
      <category><![CDATA[DKIM]]></category>
      <category><![CDATA[Centos]]></category>
      <category><![CDATA[Email]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/04/29/setup-dkim-on-postfix-with-opendkim</guid>
      <description>Setup DKIM on Postfix with OpenDKIM</description>
      <content:encoded><![CDATA[<h2>Introduction</h2>
<p>DKIM is an authentication framework which stores public-keys in DNS and
digitally signs emails on a domain basis. It was created as a result of
merging Yahoo's domainkeys and Cisco's Identified Internet mail
specification. It is defined in RFC 4871.</p>
<p>I previously <a href="http://www.topdog.za.net/2009/03/10/setup-dkim-on-postfix-with-dkim-milter/">wrote</a>
about setting up DKIM using dkim-milter, dkim-milter has since been depreciated.</p>
<p>We will be using the <a href="http://www.opendkim.org/">OpenDKIM</a> implementation
Centos, OpenDKIM is a fork of dkim-milter.</p>
<h2>Installation</h2>
<pre><code>yum install opendkim
</code></pre>
<h2>Generate the Keys</h2>
<pre><code>opendkim-genkey -d &lt;domain_name&gt; -s &lt;selector&gt;
</code></pre>
<p>Replace <domain_name> with the domain name you will be signing the mail for,
and <selector> with a selector name it can be anything (but just one word).
The command will create two files.</p>
<ul>
<li>
<p><selector>.txt - contains the public key you publish via DNS</p>
</li>
<li>
<p><selector>.private - the private key you use for signing your email</p>
</li>
</ul>
<p>Create a sub directory in /etc/opendkim/keys to store your key, i prefer to
use the domain name <domain_name> as the sub directory name.</p>
<pre><code># mv &lt;selector&gt;.private /etc/opendkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
# chmod 600 /etc/opendkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
# chown opendkim.opendkim /etc/opendkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
</code></pre>
<h2>DNS Setup</h2>
<p>You need to publish your public key via DNS, client servers use this key to
verify your signed email. The contents of <selector>.txt is the record you
need to add to your zone file a sample, is below (it uses default as the
selector and example.com as the domain_name)</p>
<pre><code>default._domainkey IN TXT "v=DKIM1; r=postmaster; g=*; k=rsa;
p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNA
DCBiQKBgQDG81CNNVOlWwfhENOZEnJKNlikTB3Dnb5kUC8/zvht/S8SQnx+YgZ/KG7KOus0By8cIDDv
wn3ElVRVQ6Jhz/HcvPU5DXCAC5owLBf/gX5tvAnjF1vSL8ZBetxquVHyJQpMFH3VW37m/mxPTGmDL+z
JVW+CKpUcI8BJD03iW2l1CwIDAQAB" ; ----- DKIM default for example.com
</code></pre>
<h2>Configuration</h2>
<p>Edit /etc/opendkim.conf comment out "KeyFile /etc/opendkim/keys/default.private"
and uncomment "#KeyTable       /etc/opendkim/KeyTable"</p>
<p>Edit the file /etc/opendkim/KeyTable and add your domain using the following format</p>
<pre><code>&lt;selector&gt;._domainkey.&lt;domain_name&gt; &lt;domain_name&gt;:&lt;selector&gt;:/etc/opendkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
</code></pre>
<p>Add your servers IP addresses to /etc/opendkim/TrustedHosts</p>
<p>More advanced configuration options can be set in the file /etc/opendkim.conf</p>
<h2>Configure Postfix</h2>
<p>You need to add the following options to the postfix main.cf file to enable it
to use the milter.</p>
<pre><code>smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
</code></pre>
<p>Append the OpenDKIM options to the existing milters if you have other milters
already configured.</p>
<p>Start OpenDKIM and restart postfix</p>
<pre><code># service opendkim start
# service postfix restart
</code></pre>
<h2>Testing</h2>
<p>Send an email to sa-test@sendmail.net or autorespond+dkim@dk.elandsys.com, you
will receive a response stating if your setup is working correctly. If you
have a Gmail account you can send an email to that account and look at the
message details similar to the picture below, you should see signed-by “your
domain” if your setup was done correctly.</p>
<p><a href="/media/google.jpg"><img alt="DKIM signed mail in google" src="/media/google.jpg" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Setup DKIM on Postfix with dkim-milter</title>
      <link>http://www.topdog.za.net/2009/03/10/setup-dkim-on-postfix-with-dkim-milter</link>
      <pubDate>Tue, 10 Mar 2009 23:54:00 SAST</pubDate>
      <category><![CDATA[Postfix]]></category>
      <category><![CDATA[Howto]]></category>
      <category><![CDATA[DKIM]]></category>
      <category><![CDATA[Centos]]></category>
      <category><![CDATA[Email]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2009/03/10/setup-dkim-on-postfix-with-dkim-milter</guid>
      <description>Setup DKIM on Postfix with dkim-milter</description>
      <content:encoded><![CDATA[<h2>Introduction</h2>
<p>DKIM is an authentication framework which stores public-keys in DNS and digitally signs emails on a domain basis. It was created as a result of merging Yahoo's domainkeys and Cisco's Identified Internet mail specification. It is defined in RFC 4871.</p>
<p>We will be using the milter implementation of dkim <a href="http://dkim-milter.sf.net">http://dkim-milter.sf.net</a> on centos 5.3.</p>
<p>This howto has been updated to allow for the following.</p>
<ul>
<li>Multiple domains using different keys</li>
<li>Same domain using different selectors</li>
<li>Selective signing of email</li>
</ul>
<p>Older versions are provided below for reference.</p>
<h2>Installation</h2>
<p>I provide Centos rpms for Dkim-milter at <a href="http://www.topdog-software.com/oss/">http://www.topdog-
software.com/oss/</a> so we will install the
latest version.</p>
<p>Install the rpm, ( 32bit and 64bit intel supported )</p>
<pre><code># wget http://www.topdog-software.com/oss/roundcube/andrew_topdog-software.com_key.txt
# rpm --import andrew_topdog-software.com_key.txt
# http://www.topdog-software.com/oss/dkim-milter/dkim-milter-2.8.2-2.$(uname -i).rpm
</code></pre>
<h2>Generate the Keys</h2>
<pre><code># dkim-genkey -d &lt;domain_name&gt; -s &lt;selector&gt; -t
</code></pre>
<p>Replace <domain_name> with the domain name you will be signing the mail for,
and <selector> with a selector name it can be anything (but just one word).
The command will create two files.</p>
<ul>
<li>
<p><selector>.txt - contains the public key you publish via DNS</p>
</li>
<li>
<p><selector>.private - the private key you use for signing your email</p>
</li>
</ul>
<p>Create a sub directory in /etc/mail/dkim/keys to store your key, i prefer to
use the domain name <domain_name> as the sub directory name.</p>
<pre><code># mv &lt;selector&gt;.private /etc/mail/dkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
# chmod 600 /etc/mail/dkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
# chown dkim-milt.dkim-milt /etc/mail/dkim/keys/&lt;domain_name&gt;/&lt;selector&gt;.pem
</code></pre>
<h2>DNS Setup</h2>
<p>You need to publish your public key via DNS, client servers use this key to
verify your signed email. The contents of <selector>.txt is the record you
need to add to your zone file a sample, is below (it uses default as the
selector and topdog-software.com as the domain_name)</p>
<pre><code>default._domainkey IN TXT "v=DKIM1; g=*; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNA
DCBiQKBgQDG81CNNVOlWwfhENOZEnJKNlikTB3Dnb5kUC8/zvht/S8SQnx+YgZ/KG7KOus0By8cIDDv
wn3ElVRVQ6Jhz/HcvPU5DXCAC5owLBf/gX5tvAnjF1vSL8ZBetxquVHyJQpMFH3VW37m/mxPTGmDL+z
JVW+CKpUcI8BJD03iW2l1CwIDAQAB" ; ----- DKIM default for topdog-software.com
</code></pre>
<p>Also add this to your zone file. (This sets your policy see <a href="http://www.sendmail.org/dkim/wizard">http://www.sendmail.org/dkim/wizard</a> for an explanation or refer to the RFC)</p>
<pre><code>_adsp._domainkey    IN  TXT "dkim=unknown"
</code></pre>
<h2>Configuration</h2>
<p>Edit the file /etc/mail/dkim/keylist and add your domain using the following format</p>
<pre><code>*@&lt;domain_name&gt;:&lt;domain_name&gt;:/etc/mail/dkim/keys/&lt;domain_name&gt;/&lt;selector&gt;
#sign only for andrew
andrew@&lt;domain_name&gt;:&lt;domain_name&gt;:/etc/mail/dkim/keys/&lt;domain_name&gt;/&lt;selector&gt;
</code></pre>
<p>Add your servers IP addresses to /etc/mail/dkim/trusted-hosts</p>
<p>More advanced configuration options can be set in the file /etc/dkim-filter.conf (Refer to the file and the man pages for details)</p>
<h2>Configure Postfix</h2>
<p>You need to add the following options to the postfix main.cf file to enable it
to use the milter.</p>
<pre><code>smtpd_milters = inet:localhost:20209
non_smtpd_milters = inet:localhost:20209
</code></pre>
<p>Append the dkim-milter options to the existing milters if you have other
milters already configured.</p>
<p>Start dkim-milter and restart postfix</p>
<pre><code># service dkim-milter start
# service postfix restart
</code></pre>
<h2>Testing</h2>
<p>Send an email to sa-test@sendmail.net or autorespond+dkim@dk.elandsys.com, you
will receive a response stating if your setup is working correctly. If you
have a Gmail account you can send an email to that account and look at the
message details similar to the picture below, you should see signed-by “your
domain” if your setup was done correctly.</p>
<p><a href="/media/google.jpg"><img alt="DKIM signed mail in google" src="/media/google.jpg" /></a></p>
<h2>Updates</h2>
<p>Updated rpms are always provided at <a href="http://www.topdog-software.com/oss/dkim-milter/">http://www.topdog-software.com/oss/dkim-milter/</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>
