<?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>MailScanner Ubuntu and Debian packages</title>
      <link>http://www.topdog.za.net/2012/09/10/mailscanner-ubuntu-and-debian-packages</link>
      <pubDate>Mon, 10 Sep 2012 07:39:00 SAST</pubDate>
      <category><![CDATA[Sysadmin]]></category>
      <category><![CDATA[Security]]></category>
      <category><![CDATA[Email]]></category>
      <category><![CDATA[Linux]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/09/10/mailscanner-ubuntu-and-debian-packages</guid>
      <description>MailScanner Ubuntu and Debian packages</description>
      <content:encoded><![CDATA[<p>The Debian and Ubuntu MailScanner packages have not been maintained for a long time.
Recently both distributions dropped support for MailScanner within their repo's.</p>
<p>The <a href="http://bit.ly/UE4N6D">Baruwa project</a> provides up to date deb packages for both
distributions.</p>
<p>Packages are available for:</p>
<ul>
<li>squeeze</li>
<li>wheezy</li>
<li>sid</li>
<li>lucid</li>
<li>maverick</li>
<li>natty</li>
<li>oneiric</li>
<li>precise</li>
<li>quantal</li>
</ul>
<h2>Usage</h2>
<p>To use the packages you need to enable the baruwa apt repo.</p>
<pre><code>cat &gt; /etc/apt/sources.list.d/baruwa.list &lt;&lt; 'EOF'
deb http://apt.baruwa.org/ubuntu precise main
EOF
</code></pre>
<p><strong>Change "precise" to your specific release name</strong></p>
<p>Add the repo's GPG key</p>
<pre><code>wget -O - http://apt.baruwa.org/baruwa-apt-keys.gpg | apt-key add -
</code></pre>
<p>Then run</p>
<pre><code>apt-get update
apt-get install mailscanner
</code></pre>
<h2>Support &amp; Assistance</h2>
<p>Use the friendly Baruwa project <a href="http://bit.ly/Rwj1I4">mailing list</a> </p>]]></content:encoded>
    </item>
    <item>
      <title>Disable a ClamAV signature</title>
      <link>http://www.topdog.za.net/2012/08/10/disable-a-clamav-signature</link>
      <pubDate>Fri, 10 Aug 2012 07:30:00 SAST</pubDate>
      <category><![CDATA[Tips]]></category>
      <category><![CDATA[Email]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/08/10/disable-a-clamav-signature</guid>
      <description>Disable a ClamAV signature</description>
      <content:encoded><![CDATA[<p>There are cases when you need to disable a ClamAV signature for various reasons.</p>
<p>To do this create a file with the extension ".ign2" in your ClamAV data directory
with the name of the signature.</p>
<pre><code>cat &gt; /var/lib/clamav/mb.ign2 &lt;&lt; 'EOF'
MBL_303159
EOF
</code></pre>
<p>Reload clamd and you should be good to go. </p>]]></content:encoded>
    </item>
    <item>
      <title>How to fix Exim SMTP AUTH rewritting the from address</title>
      <link>http://www.topdog.za.net/2012/06/08/how-to-fix-exim-smtp-auth-rewritting-the-from-address</link>
      <pubDate>Fri, 08 Jun 2012 07:55:00 SAST</pubDate>
      <category><![CDATA[Tips]]></category>
      <category><![CDATA[Exim]]></category>
      <category><![CDATA[Email]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/06/08/how-to-fix-exim-smtp-auth-rewritting-the-from-address</guid>
      <description>How to fix Exim SMTP AUTH rewritting the from address</description>
      <content:encoded><![CDATA[<p>When using SMTP Authentication with exim and the default configuration
you will find that exim rewrites the sender address to "email@address"@smtp_server_hostname</p>
<pre><code>Return-Path:    &lt;"andrew@topdog.za.net"@xxxx.xxxx.co.za&gt;
...
Sender:     "andrew@topdog.za.net"@xxxx.xxxx.co.za
...
</code></pre>
<p>To fix this you need to modify your acl_check_rcp acl and add sender_retain to
control.</p>
<pre><code>accept  authenticated = *
          control       = submission/sender_retain
</code></pre>
<p>Restart exim and you are good to go.</p>]]></content:encoded>
    </item>
    <item>
      <title>Block Spam from domains on the South Africa ISPA Spam Hall of Shame using DNSBL Part2</title>
      <link>http://www.topdog.za.net/2012/05/11/block-spam-from-domains-on-the-south-africa-ispa-spam-hall-of-shame-using-dnsbl-part2</link>
      <pubDate>Fri, 11 May 2012 07:30:00 SAST</pubDate>
      <category><![CDATA[Postfix]]></category>
      <category><![CDATA[Tips]]></category>
      <category><![CDATA[Exim]]></category>
      <category><![CDATA[Email]]></category>
      <category><![CDATA[Linux]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/05/11/block-spam-from-domains-on-the-south-africa-ispa-spam-hall-of-shame-using-dnsbl-part2</guid>
      <description>Block Spam from domains on the South Africa ISPA Spam Hall of Shame using DNSBL Part2</description>
      <content:encoded><![CDATA[<p>I previously <a href="http://www.topdog.za.net/2012/04/22/tip:-block-spam-from-domains-on-the-south-africa-ispa-spam-hall-of-shame-using-dnsbl/">wrote</a>
about how to block domains named in the ISPA Spam Hall of Shame using DNSBL at
SMTP time, these domains have now resorted to using 3rd party senders to try and get their Junk
through. Because they are using 3rd party senders the envelope from address is no longer the one
that is listed on the hall of shame.</p>
<p>In this post i will describe how you can catch the mail that has slipped through your SMTP DNSBL
checks.</p>
<p>To identify these messages i use <a href="http://spamassassin.apache.org/">Spamassassin's</a> <a href="http://search.cpan.org/dist/Mail-SpamAssassin/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm">URIDNSBL plugin</a>
which extracts the uri's in an email and checks each of them against the DNSBL.</p>
<p>Create a file called ispa.cf in your Spamassassin configuration directory usually
/etc/mail/spamassassin with the following contents</p>
<pre><code># /etc/mail/spamassassin/ispa.cf
urirhsbl        URIBL_BARUWA    ispa.rbl.baruwa.net.   A
body            URIBL_BARUWA    eval:check_uridnsbl('URIBL_BARUWA')
describe        URIBL_BARUWA    Contains a URL listed in the Baruwa blocklist
score           URIBL_BARUWA    7.0
</code></pre>
<p>Restart Spamassassin and email from those domains that by pass the DNSBL checks by using 3rd
party senders should now be tagged as Spam by Spamassassin with a score of 7.0</p>
<p>Feedback is welcome, as Spam fighting is always an on going battle.</p>]]></content:encoded>
    </item>
    <item>
      <title>MailScanner book now free</title>
      <link>http://www.topdog.za.net/2012/05/01/mailscanner-book-now-free</link>
      <pubDate>Tue, 01 May 2012 12:39:00 SAST</pubDate>
      <category><![CDATA[Sysadmin]]></category>
      <category><![CDATA[Security]]></category>
      <category><![CDATA[Email]]></category>
      <category><![CDATA[Linux]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/05/01/mailscanner-book-now-free</guid>
      <description>MailScanner book now free</description>
      <content:encoded><![CDATA[<p><a href="http://www.jules.fm/">Julian Field</a> the author of <a href="http://www.mailscanner.info/">MailScanner</a>
and the of the MailScanner book has just announced that the MailScanner Book is now available for free.</p>
<p>So head off and <a href="http://www.mailscanner.info/files/MailScanner-Guide.pdf">get your copy</a>.</p>]]></content:encoded>
    </item>
    <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>TIP: Block Spam from domains on the South Africa ISPA Spam Hall of Shame using DNSBL</title>
      <link>http://www.topdog.za.net/2012/04/22/tip:-block-spam-from-domains-on-the-south-africa-ispa-spam-hall-of-shame-using-dnsbl</link>
      <pubDate>Sun, 22 Apr 2012 09:30:00 SAST</pubDate>
      <category><![CDATA[Postfix]]></category>
      <category><![CDATA[Howto]]></category>
      <category><![CDATA[Exim]]></category>
      <category><![CDATA[Email]]></category>
      <category><![CDATA[Linux]]></category>
      <category><![CDATA[Tips]]></category>
      <category><![CDATA[Security]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2012/04/22/tip:-block-spam-from-domains-on-the-south-africa-ispa-spam-hall-of-shame-using-dnsbl</guid>
      <description>TIP: Block Spam from domains on the South Africa ISPA Spam Hall of Shame using DNSBL</description>
      <content:encoded><![CDATA[<p>The South Africa Internet service providers association <a href="http://ispa.org.za/">(ISPA)</a> maintains a list of known
spammers dubbed the <a href="http://ispa.org.za/spam/hall-of-shame/">Spam Hall of Shame</a>.
The list is contains both domains as well as email addresses, this list is published
on a webpage without downloadable formats.</p>
<p>I extract the data from this web page and publish it in a DNSBL ispa.rbl.baruwa.net,
i use this DNSBL in my <a href="http://www.baruwa.net">SAAS mail security product</a>. So anyone
should be able to use it in a similar way to the other DNSBL's like spamhaus and
spamcop etc.</p>
<h2>Command line checking</h2>
<p>You can check if a domain is on the list using the normal command line utilities</p>
<p>Using host:</p>
<pre><code>host amazingresults.co.za.ispa.rbl.baruwa.net
</code></pre>
<p>Output:</p>
<pre><code>amazingresults.co.za.ispa.rbl.baruwa.net has address 127.0.0.2
</code></pre>
<p>Using dig:</p>
<pre><code>dig amazingresults.co.za.ispa.rbl.baruwa.net
</code></pre>
<p>Output:</p>
<pre><code>;; QUESTION SECTION:
;amazingresults.co.za.ispa.rbl.baruwa.net. IN A

;; ANSWER SECTION:
amazingresults.co.za.ispa.rbl.baruwa.net. 1993 IN A 127.0.0.2
</code></pre>
<p>Checking the TXT output:</p>
<pre><code>host -t txt amazingresults.co.za.ispa.rbl.baruwa.net
</code></pre>
<p>Output:</p>
<pre><code>amazingresults.co.za.ispa.rbl.baruwa.net descriptive text 
"Domain amazingresults.co.za is listed in the ISPA Hall of Shame,
http://ispa.org.za/spam/hall-of-shame/"
</code></pre>
<h2>Usage</h2>
<p>Usage of the DNSBL in various MTA's is described below.</p>
<h3>Exim</h3>
<p>Add the following to your rcpt acl (acl_check_rcpt:).</p>
<pre><code>drop    message       = REJECTED - $dnslist_text
        dnslists      = ispa.rbl.baruwa.net/$sender_address_domain
</code></pre>
<h3>Postfix</h3>
<p>Add to smtpd_recipient_restrictions after permit_mynetworks in your
main.cf file</p>
<pre><code>reject_rhsbl_client ispa.rbl.baruwa.net,
reject_rhsbl_sender ispa.rbl.baruwa.net,
</code></pre>
<h3>Sendmail</h3>
<p>Add to your mc file and rebuild the cf</p>
<pre><code>FEATURE(rhsbl,`ispa.rbl.baruwa.net',`"550 Mail from domain " $`'&amp;{RHS} " refused.
Domain is listed in the ISPA Hall of Shame -  http://ispa.org.za/spam/hall-of-shame/"')
</code></pre>
<h2>How the data is extracted</h2>
<p>The data is extracted using an <a href="http://www.topdog.za.net/2012/04/22/python-modules-you-should-know:-scrapy/">automated custom web</a> crawler written using <a href="http://scrapy.org/">Scrapy</a> in Python.
The crawler extracts both the domains and the email addresses, the domains are processed and added to the DNSBL,
the emails addresses get processed and added to the email blacklists on our <a href="http://www.baruwa.net">SAAS platform</a>.</p>
<h2>Update</h2>
<p>Some of these domains have resorted to using third party senders, which means the smtp
envelope is no longer the one listed on the hall of shame, i have written a <a href="http://www.topdog.za.net/2012/05/11/block-spam-from-domains-on-the-south-africa-ispa-spam-hall-of-shame-using-dnsbl-part2/">followup post</a>
which describes how you can identify and flag as spam these messages that bypass the
SMTP time DNSBL checks.</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>
    <item>
      <title>Mail server setup with Exim, MySQL, Cyrus-Imapd, Horde webmail on Centos 5.1</title>
      <link>http://www.topdog.za.net/2009/03/04/mail-server-setup-with-exim--mysql--cyrus-imapd--horde-webmail-on-centos-5.1</link>
      <pubDate>Wed, 04 Mar 2009 12:37:00 SAST</pubDate>
      <category><![CDATA[Horde]]></category>
      <category><![CDATA[Centos]]></category>
      <category><![CDATA[Howto]]></category>
      <category><![CDATA[Exim]]></category>
      <category><![CDATA[Cyrus]]></category>
      <category><![CDATA[Linux]]></category>
      <category><![CDATA[Email]]></category>
      <guid isPermaLink="true">http://www.topdog.za.net/2009/03/04/mail-server-setup-with-exim--mysql--cyrus-imapd--horde-webmail-on-centos-5.1</guid>
      <description>Mail server setup with Exim, MySQL, Cyrus-Imapd, Horde webmail on Centos 5.1</description>
      <content:encoded><![CDATA[<h2>Introduction</h2>
<p>This how to describes the installation and configuration of a mail system on
Centos 5.1 with selinux enabled for enhanced security. This system will be
able to service HTTP, HTTPS, SMTP, TLS, SMTP-AUTH, IMAP, POP3 clients and is
virtual enabled allowing more that one domain to be served from the system.</p>
<p>The webmail client imp will provide a feature rich interface with a webmail
component, an address book, calendaring, and ability to reset passwords all
with a highly configurable preference system to enable users to modify their
look and feel as well as the operation of the interface.</p>
<p>The IMAP/POP3 system is the high performance cyrus-imapd system that runs as a
sealed unit (mail users are not system users) and utilizes a high end/
performance back end for mail storage. The other cyrus-imapd features include,
mail indexing for quick search operations using squat, a notification daemon
that can be configured to notify via sms or email, sieve filtering system
(auto response, mail filtering, notifications, filing), and built in quota
system. This system will use pam_mysql via the SASL (saslauthd) mechanism to
authenticate users against the Mysql database back end shared by all the
components.</p>
<p>The exim system will be configured to enable users relay mail using TLS
secured SMTP-AUTH, using the same database backend that is shared by all the
components. Address verification will take place using SQL queries to the
mysql backend before any mail is accepted for delivery to the cyrus-imapd mail
store. Anti-virus checks are integrated into this system with the use of
clamav via a Unix domain socket. Spam checks are also run at smtp time via a
socket connection to the spamd spamassasin system messages scoring over 6 are
automatically rejected with out being spooled to the system.</p>
<p>The mysql database will store the user authentication information encrypted
using md5-hex as well as other information for the other webmail components.</p>
<p>This system is designed for high performance and security, cutting down on
open ports and prefering to use unix domain sockets and running selinux in
enforcing mode.</p>
<p>User account management takes place via the horde web interface allowing the
admin easy access to add and remove accounts or to manage passwords, it is
also possible to interact directly with the database table and make
alterations there.</p>
<h2>OS Installation notes</h2>
<p>For the purpose of keeping this howto precise i will not take you through the
actually installation of the Centos 5.1 system i will assume that you have a
bare bones install, a kickstart to help you get a bare bones install is can be
downloaded <a href="http://www.topdog-software.com/files/barebones.ks">here</a></p>
<p>For this tutorial i will be using the static IP address 192.168.1.4 and the
hostname mail.home.topdog-software.com with a domain of home.topdog-
software.com, please feel free to make alterations to suite your environment.
The working directory will be /usr/local/src all packages to be downloaded
should be downloaded and extracted there.</p>
<h2>Software installation</h2>
<h3>Install prerequisites</h3>
<p>Update the system.</p>
<pre><code>yum update
</code></pre>
<p>Configure rpmforge repo</p>
<pre><code>rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
</code></pre>
<p>Disable the repo (such that base packages not overwritten) edit /etc/yum.d/rpmforge.repo and set the following option</p>
<pre><code>enabled = 0
</code></pre>
<h3>Install Apache</h3>
<pre><code>yum install httpd php php-mysql php-xml php-imap php-mbstring php-mcrypt \
php-pecl-Fileinfo php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime \
php-pear-Auth-SASL php-pear-Date php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve \
php-pear-Net-Socket php-pear-Net-SMTP openssl mod_ssl -y
</code></pre>
<h3>Install Exim</h3>
<pre><code>yum install exim system-switch-mail -y
</code></pre>
<h3>Install Mysql</h3>
<pre><code>yum install mysql mysql-server -y
</code></pre>
<h3>Install Horde</h3>
<pre><code>yum install horde imp-h3 ingo-h3 turba-h3 kronolith-h3 -y
wget ftp://ftp.horde.org/pub/passwd/passwd-h3-3.0.1.tar.gz
tar xzvf passwd-h3-3.0.1.tar.gz -C /usr/share/horde
mv /usr/share/horde/passwd-h3-3.0.1 /usr/share/horde/passwd
</code></pre>
<h3>Install cyrus-imapd</h3>
<p>I will use the <a href="http://www.invoca.ch/pub/packages/cyrus-imapd/">Invoca systems source rpm</a> as it is more recent and support many features that the Centos
build does not provide.</p>
<pre><code>yum install db4-utils -y
rpm -Uvh http://www.topdog-software.com/oss/cyrus-imapd/cyrus-imapd-perl-2.3.11-3.i386.rpm
rpm -Uvh http://www.topdog-software.com/oss/cyrus-imapd/cyrus-imapd-utils-2.3.11-3.i386.rpm
rpm -Uvh http://www.topdog-software.com/oss/cyrus-imapd/cyrus-imapd-2.3.11-3.i386.rpm
</code></pre>
<h3>Install Pam_mysql</h3>
<pre><code>rpm -Uvh http://www.topdog-software.com/oss/pam_mysql/pam_mysql-0.7RC1-1.i386.rpm
</code></pre>
<h3>Install ClamAV</h3>
<pre><code>yum --enablerepo=rpmforge install clamav clamav-db clamd -y
</code></pre>
<h3>Install Spamassassin</h3>
<pre><code>yum install spamassassin -y
</code></pre>
<h2>Configuration</h2>
<h3>Configure Apache</h3>
<p>Enable virtual hosting and create default virtualhost, edit /etc/httpd/conf/httpd.conf and add at the end</p>
<pre><code>NameVirtualHost *:80
&lt;VirtualHost *:80&gt;
    ServerAdmin webmaster@home.topdog-software.com
&lt;/VirtualHost&gt;
</code></pre>
<p>Create the virtual host for horde webmail add this under the above</p>
<pre><code>&lt;VirtualHost *:80&gt;
        Servername mail.home.topdog-software.com
        DocumentRoot /usr/share/horde
        ErrorLog logs/mail-error_log
        CustomLog logs/mail-access_log common
&lt;/VirtualHost&gt;
</code></pre>
<p>Enable horde security settings edit the file /etc/httpd/conf.d/horde.conf and set as below</p>
<pre><code>#Alias /horde /usr/share/horde
&lt;Directory /usr/share/horde&gt;

    Options +FollowSymLinks
    php_admin_flag safe_mode off
    php_admin_flag magic_quotes_runtime off
    php_flag session.use_trans_sid off
    php_flag session.auto_start off
    php_admin_flag file_uploads on
    #php_admin_flag allow_url_fopen on

    php_value post_max_size 20M
    php_value upload_max_filesize 10M

    php_admin_value open_basedir "/usr/share/horde:/usr/share/horde/config:/usr/share/pear:/tmp"
    php_admin_flag register_globals off
&lt;/Directory&gt;

&lt;Directory /usr/share/horde/config&gt;
    Order Deny,Allow
    Deny from all
&lt;/Directory&gt;

&lt;DirectoryMatch "^/usr/share/horde/(.*/)?(config|lib|locale|po|scripts|templates)/(.*)?"&gt;
    Order Deny,Allow
    Deny from all
&lt;/DirectoryMatch&gt;
</code></pre>
<p>Increase PHP memory limit edit /etc/php.ini and change to below</p>
<pre><code>memory_limit = 64M
</code></pre>
<p>Enable horde under SSL edit /etc/httpd/conf.d/ssl.conf and add the following to the default virtualhost between the <VirtualHost _default_:443><VirtualHost> tags</p>
<pre><code>Servername mail.home.topdog-software.com:443
DocumentRoot /usr/share/horde
</code></pre>
<h3>Configure Exim</h3>
<p>Switch the MTA to exim</p>
<pre><code> system-switch-mail (select exim)
</code></pre>
<h4>Anti-virus / Sanesecurity Checks</h4>
<p>Configure Exim (/etc/exim/exim.conf) to use clamav to scan incoming mail and reject virus infected email and image and pdf spam at smtp time.</p>
<pre><code>av_scanner = clamd:/var/run/clamav/clamd.sock
</code></pre>
<h4>RBL's</h4>
<p>Configure the RBL's under acl_check_rcpt: </p>
<pre><code>drop    message       = REJECTED because $sender_host_address is in a black list spamhaus.org
           dnslists      = zen.spamhaus.org

drop    message       = REJECTED because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
           dnslists      = bl.spamcop.net

drop    message       = REJECTED because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
           dnslists      = dnsbl.sorbs.net
</code></pre>
<h4>Anti Spam</h4>
<p>If you want to reject messages from servers with no reverse dns add this under acl_check_rcpt:, it does have a exception list to which you can add domains where the acl should not be applied and trys to deliver a test message to sending address to verify if the sender is valid.</p>
<pre><code>drop  message   = REJECTED - We don't accept messages from hosts without reverse DNS
        log_message = No reverse DNS
        domains = ! lsearch;/etc/exim/checks_exempt_hosts
        !verify = reverse_host_lookup
        !verify = sender/callout=2m,defer_ok
        !condition =  ${if eq{$sender_verify_failure}{}}
</code></pre>
<p>To reject messages from clients that dont provide a HELO/EHLO add this to acl_check_rcpt:</p>
<pre><code>drop  message  = REFUSED - no HELO/EHLO greeting
        log_message = remote host did not present greeting
        condition = ${if def:sender_helo_name {false}{true}}
</code></pre>
<p>You can rate limit the connections to your server as well add this to acl_check_connect: to do so (read the exim docs on the parameters if you want to fine tune it for your site)</p>
<pre><code>deny ratelimit = 250 / 15m / strict
       message = You can only send $sender_rate per $sender_rate_period
       log_message = RATE: $sender_rate/$sender_rate_period (max $sender_rate_limit)

accept
</code></pre>
<p>Stop rogue spam bots from trashing your machine</p>
<pre><code>smtp_accept_max_nonmail = 30
smtp_max_unknown_commands = 1
</code></pre>
<p>Don't advertise pipelining</p>
<pre><code>pipelining_advertise_hosts =
</code></pre>
<p>Enable Spamassassin checks</p>
<pre><code>spamd_address = /var/run/spamassassin/spamd.sock
</code></pre>
<p>Reject all messages with score above 6 at smtp time. (acl_check_data)</p>
<pre><code>accept  condition  = ${if &gt;={$message_size}{100000} {1}}
        add_header = X-Spam-Note: SpamAssassin run bypassed due to message size

  warn    spam       = nobody/defer_ok
        add_header = X-Spam-Flag: YES

  accept  condition  = ${if !def:spam_score_int {1}}
        add_header = X-Spam-Note: SpamAssassin invocation failed

  warn    add_header = X-Spam-Score: $spam_score ($spam_bar)\n\
#       X-Spam-Report: $spam_report

  drop    condition = ${if &gt;{$spam_score_int}{60} {1}}
        message   = Your message scored $spam_score SpamAssassin point. Report follows:\n\
        $spam_report
</code></pre>
<h4>Mail routing</h4>
<p>Enable access to Mysql database</p>
<pre><code>hide mysql_servers = localhost/horde/horde/hordepassword
</code></pre>
<p>Modify the local delivery router to deliver to cyrus but verify the email address of user before delivery (in routers section of exim.conf)</p>
<pre><code>localuser:
  driver = accept
  local_parts = ${lookup mysql {SELECT REPLACE(user_uid,'${quote_mysql:@$domain}','') \
         as user FROM horde_users WHERE user_uid='${quote_mysql:$local_part@$domain}'}{$value}}
  transport = local_delivery
  cannot_route_message = Unknown user
</code></pre>
<p>Create a transport to deliver to cyrus via lmtp socket</p>
<pre><code>local_delivery:
  driver = lmtp
  socket = /var/lib/imap/socket/lmtp
  batch_max = 50
  user = cyrus
</code></pre>
<h4>SMTP Authentication</h4>
<p>Add the following to the authentication section of /etc/exim/exim.conf</p>
<pre><code>plain:
  driver = plaintext
  public_name = PLAIN
  server_prompts = :
  server_set_id = $2
  server_condition = ${if saslauthd{{$2}{$3}{pop}}{1}{0}}
  server_advertise_condition = true

login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_condition = ${if saslauthd{{$1}{$2}{pop}}{1}{0}}
  server_set_id = $1
  server_advertise_condition = true
</code></pre>
<h4>Full sample configuration</h4>
<p>Download the full configuration file <a href="http://www.topdog-
software.com/files/exim.conf.gz">here</a></p>
<h3>Configure Mysql</h3>
<p>Disable TCP networking edit /etc/my.cnf and the following in the mysqld section</p>
<pre><code>skip-networking
</code></pre>
<p>Set root password</p>
<pre><code>/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h impi password 'new-password' -p
</code></pre>
<h3>Configure Horde</h3>
<p>Edit the sql file and change the mysql password for the horde user</p>
<pre><code>cp /usr/share/horde/scripts/sql/create.mysql.sql .
vi create.mysql.sql

REPLACE INTO user (host, user, password)
    VALUES (
        'localhost',
        'horde',
-- IMPORTANT: Change this password!
        PASSWORD('hordepassword')
);
</code></pre>
<p>Create the user and populate the horde database</p>
<pre><code>mysql -p &lt; create.mysql.sql
</code></pre>
<p>Create the tables for turba (Address book)</p>
<pre><code>mysql -p horde &lt; /usr/share/horde/turba/scripts/sql/turba_objects.mysql.sql
</code></pre>
<p>Create the tables for kronolith (calendering)</p>
<pre><code>mysql -p horde &lt; /usr/share/horde/kronolith/scripts/sql/kronolith.mysql.sql
</code></pre>
<h4>Horde configuration</h4>
<p>Create horde base configuration /usr/share/horde/config/conf.php</p>
<pre><code>&lt;?php
$conf['debug_level'] = E_ALL;
$conf['max_exec_time'] = 0;
$conf['compress_pages'] = true;
$conf['umask'] = 077;
$conf['use_ssl'] = 2;
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = $_SERVER['SERVER_PORT'];
$conf['session']['name'] = 'Horde';
$conf['session']['use_only_cookies'] = true;
$conf['session']['cache_limiter'] = 'nocache';
$conf['session']['timeout'] = 0;
$conf['cookie']['domain'] = $_SERVER['SERVER_NAME'];
$conf['cookie']['path'] = '/';
$conf['sql']['username'] = 'horde';
$conf['sql']['password'] = 'hordepassword';
$conf['sql']['socket'] = '/var/lib/mysql/mysql.sock';
$conf['sql']['protocol'] = 'unix';
$conf['sql']['database'] = 'horde';
$conf['sql']['charset'] = 'iso-8859-1';
$conf['sql']['phptype'] = 'mysqli';
$conf['auth']['admins'] = array('Administrator', 'andrew@home.topdog-software.com');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['params']['driverconfig'] = 'horde';
$conf['auth']['params']['table'] = 'horde_users';
$conf['auth']['params']['username_field'] = 'user_uid';
$conf['auth']['params']['password_field'] = 'user_pass';
$conf['auth']['params']['encryption'] = 'md5-hex';
$conf['auth']['params']['show_encryption'] = false;
$conf['auth']['driver'] = 'sql';
$conf['signup']['allow'] = false;
$conf['log']['priority'] = PEAR_LOG_NOTICE;
$conf['log']['ident'] = 'HORDE';
$conf['log']['params'] = array();
$conf['log']['name'] = '/tmp/horde.log';
$conf['log']['params']['append'] = true;
$conf['log']['type'] = 'file';
$conf['log']['enabled'] = true;
$conf['log_accesskeys'] = false;
$conf['prefs']['params']['driverconfig'] = 'horde';
$conf['prefs']['driver'] = 'sql';
$conf['datatree']['params']['driverconfig'] = 'horde';
$conf['datatree']['driver'] = 'sql';
$conf['group']['driver'] = 'datatree';
$conf['cache']['default_lifetime'] = 1800;
$conf['cache']['params']['dir'] = Horde::getTempDir();
$conf['cache']['params']['gc'] = 86400;
$conf['cache']['driver'] = 'file';
$conf['token']['driver'] = 'none';
$conf['mailer']['params']['auth'] = '0';
$conf['mailer']['type'] = 'smtp';
$conf['vfs']['params']['driverconfig'] = 'horde';
$conf['vfs']['type'] = 'sql';
$conf['sessionhandler']['params']['persistent'] = false;
$conf['sessionhandler']['params']['rowlocking'] = true;
$conf['sessionhandler']['params']['socket'] = '/var/lib/mysql/mysql.sock';
$conf['sessionhandler']['params']['protocol'] = 'unix';
$conf['sessionhandler']['params']['hostspec'] = 'localhost';
$conf['sessionhandler']['params']['username'] = 'horde';
$conf['sessionhandler']['params']['password'] = 'hordepassword';
$conf['sessionhandler']['params']['database'] = 'horde';
$conf['sessionhandler']['type'] = 'mysql';
$conf['problems']['email'] = 'webmaster@home.topdog-software.com';
$conf['problems']['maildomain'] = 'home.topdog-software.com';
$conf['problems']['tickets'] = false;
$conf['menu']['apps'] = array();
$conf['menu']['always'] = true;
$conf['menu']['links']['help'] = 'authenticated';
$conf['menu']['links']['help_about'] = true;
$conf['menu']['links']['options'] = 'authenticated';
$conf['menu']['links']['problem'] = 'never';
$conf['menu']['links']['login'] = 'all';
$conf['menu']['links']['logout'] = 'authenticated';
$conf['hooks']['permsdenied'] = false;
$conf['hooks']['username'] = false;
$conf['hooks']['preauthenticate'] = false;
$conf['hooks']['postauthenticate'] = false;
$conf['hooks']['authldap'] = false;
$conf['portal']['fixed_blocks'] = array();
$conf['accounts']['driver'] = 'null';
$conf['imsp']['enabled'] = false;
$conf['kolab']['enabled'] = false;
</code></pre>
<p>Set horde preferences to make web mail the default application on logging in. Edit the file /usr/share/horde/config/prefs.php and modify $_prefs['initial_application'] to look as below</p>
<pre><code>$_prefs['initial_application'] = array(
    'value' =&gt; 'imp',
    'locked' =&gt; true,
    'shared' =&gt; true,
    'type' =&gt; 'select',
    'desc' =&gt; sprintf(_("What application should %s display after login?"), $GLOBALS['registry']-&gt;get('name'))
);
</code></pre>
<p>Make horde work from within the default root of the web servers, edit /usr/share/horde/config/registry.php and modify $this→applications['horde'] as below</p>
<pre><code>$this-&gt;applications['horde'] = array(
    'fileroot' =&gt; dirname(__FILE__) . '/..',
    'webroot' =&gt; '',
    'initial_page' =&gt; 'login.php',
    'name' =&gt; _("Horde"),
    'status' =&gt; 'active',
    'templates' =&gt; dirname(__FILE__) . '/../templates',
    'provides' =&gt; 'horde'
);
</code></pre>
<h4>IMP configuration</h4>
<p>Create imp base configuration /usr/share/horde/imp/config/conf.php</p>
<pre><code>&lt;?php
$conf['utils']['spellchecker'] = '/usr/bin/aspell';
$conf['utils']['gnupg'] = '/usr/bin/gpg';
$conf['utils']['gnupg_keyserver'] = array('pgp.mit.edu');
$conf['utils']['gnupg_timeout'] = '10';
$conf['utils']['openssl_cafile'] = '/etc/pki/tls/certs';
$conf['utils']['openssl_binary'] = '/usr/bin/openssl';
$conf['menu']['apps'] = array('ingo', 'kronolith', 'passwd', 'turba');
$conf['user']['select_sentmail_folder'] = false;
$conf['user']['allow_resume_all_in_drafts'] = true;
$conf['user']['allow_folders'] = true;
$conf['user']['allow_resume_all'] = false;
$conf['user']['allow_view_source'] = true;
$conf['user']['alternate_login'] = false;
$conf['user']['redirect_on_logout'] = false;
$conf['server']['change_server'] = false;
$conf['server']['change_port'] = false;
$conf['server']['change_protocol'] = false;
$conf['server']['change_smtphost'] = false;
$conf['server']['change_smtpport'] = false;
$conf['server']['server_list'] = 'none';
$conf['server']['sort_limit'] = '0';
$conf['server']['cache_folders'] = false;
$conf['server']['cache_msgbody'] = true;
$conf['mailbox']['show_attachments'] = false;
$conf['mailbox']['show_preview'] = false;
$conf['mailbox']['show_xpriority'] = false;
$conf['fetchmail']['show_account_colors'] = false;
$conf['fetchmail']['size_limit'] = '4000000';
$conf['msgsettings']['filtering']['words'] = './config/filter.txt';
$conf['msgsettings']['filtering']['replacement'] = '****';
$conf['spam']['reporting'] = false;
$conf['notspam']['reporting'] = false;
$conf['msg']['prepend_header'] = true;
$conf['msg']['append_trailer'] = true;
$conf['compose']['allow_cc'] = true;
$conf['compose']['allow_bcc'] = true;
$conf['compose']['allow_receipts'] = true;
$conf['compose']['special_characters'] = true;
$conf['compose']['use_vfs'] = false;
$conf['compose']['link_attachments'] = false;
$conf['compose']['add_maildomain_to_unexpandable'] = false;
$conf['compose']['attach_size_limit'] = '0';
$conf['compose']['attach_count_limit'] = '0';
$conf['hooks']['vinfo'] = false;
$conf['hooks']['signature'] = false;
$conf['hooks']['trailer'] = false;
$conf['hooks']['fetchmail_filter'] = false;
$conf['hooks']['mbox_redirect'] = false;
$conf['hooks']['mbox_icon'] = false;
$conf['hooks']['spam_bounce'] = false;
$conf['maillog']['use_maillog'] = true;
$conf['tasklist']['use_tasklist'] = true;
$conf['notepad']['use_notepad'] = true;
</code></pre>
<p>Create IMP servers configuration /usr/share/horde/imp/config/servers.php (remove all others) with content below</p>
<pre><code>&lt;?php

$servers['cyrus'] = array(
    'name' =&gt; 'localserver',
    'server' =&gt; 'localhost',
    'hordeauth' =&gt; 'full',
    'protocol' =&gt; 'imap/notls',
    'port' =&gt; 143,
    'maildomain' =&gt; '',
    'smtphost' =&gt; 'localhost',
    'smtpport' =&gt; 25,
    'realm' =&gt; '',
    'preferred' =&gt; '',
    'admin' =&gt; array(
        'params' =&gt; array(
            'login' =&gt; 'cyrus',
            'password' =&gt; '',
            'userhierarchy' =&gt; 'user.',
            'protocol' =&gt; 'imap/notls',
            'hostspec' =&gt; 'localhost',
            'port' =&gt; 143
        )
    ),
    'quota' =&gt; array(
        'driver' =&gt; 'cyrus',
        'params' =&gt; array(),
    ),
    'acl' =&gt; array(
        'driver' =&gt; 'rfc2086',
    ),
);
</code></pre>
<p>Prevent compose window from being a popup, edit /usr/share/horde/imp/config/prefs.php and change the variable $_prefs['compose_window'] to look like below</p>
<pre><code>$_prefs['compose_popup'] = array(
    'value' =&gt; 0,
    'locked' =&gt; true,
    'shared' =&gt; true,
    'type' =&gt; 'checkbox',
    'desc' =&gt; _("Compose messages in a separate window?"));
</code></pre>
<h4>Kronolith configuration</h4>
<p>Create kronolith base configuration /usr/share/horde/kronolith/config/conf.php</p>
<pre><code>&lt;?php
$conf['calendar']['params']['table'] = 'kronolith_events';
$conf['calendar']['params']['driverconfig'] = 'horde';
$conf['calendar']['driver'] = 'sql';
$conf['storage']['params']['table'] = 'kronolith_storage';
$conf['storage']['params']['driverconfig'] = 'horde';
$conf['storage']['driver'] = 'sql';
$conf['metadata']['keywords'] = false;
$conf['reminder']['server_name'] = 'home.topdog-software.com';
$conf['reminder']['from_addr'] = 'postmaster@home.topdog-software.com';
$conf['autoshare']['shareperms'] = 'none';
$conf['menu']['print'] = true;
$conf['menu']['import_export'] = true;
$conf['menu']['apps'] = array('imp', 'ingo', 'kronolith', 'turba');
</code></pre>
<h4>Turba configuration</h4>
<p>Configure the turba base configuration /usr/share/horde/turba/config/conf.php</p>
<pre><code>&lt;?php
$conf['menu']['import_export'] = true;
$conf['menu']['apps'] = array('imp', 'ingo', 'kronolith', 'turba');
$conf['client']['addressbook'] = 'localsql';
$conf['comments']['allow'] = true;
$conf['documents']['type'] = 'horde';
</code></pre>
<h4>Ingo configuration</h4>
<p>Configure the ingo base configuration /usr/share/horde/ingo/config/conf.php</p>
<pre><code>&lt;?php
$conf['menu']['apps'] = array('imp', 'kronolith', 'turba');
$conf['storage']['driver'] = 'prefs';
$conf['storage']['maxblacklist'] = 0;
$conf['storage']['maxwhitelist'] = 0;
$conf['rules']['userheader'] = true;
$conf['rules']['usefolderapi'] = true
</code></pre>
<p>Configure the ingo backend to use timsieved in /usr/share/horde/ingo/config/backends.php (remove all other backends)</p>
<pre><code>&lt;?php
$backends['sieve'] = array(
    'driver' =&gt; 'timsieved',
    'preferred' =&gt; 'localhost',
    'hordeauth' =&gt; 'full',
    'params' =&gt; array(
        'hostspec' =&gt; 'localhost',
        'logintype' =&gt; 'PLAIN',
        'usetls' =&gt; true,
        'port' =&gt; 2000,
        'scriptname' =&gt; 'ingo',
    ),
    'script' =&gt; 'sieve',
    'scriptparams' =&gt; array()
);
</code></pre>
<h4>Passwd configuration</h4>
<p>Configure the passwd base configuration /usr/share/horde/passwd/config/conf.php</p>
<pre><code>&lt;?php
$conf['menu']['apps'] = array('imp', 'ingo', 'kronolith', 'turba');
$conf['backend']['backend_list'] = 'hidden';
$conf['user']['change'] = true;
$conf['user']['refused'] = array('root', 'bin', 'daemon', 'adm', 'lp', 'shutdown',
'halt', 'uucp', 'ftp', 'anonymous', 'nobody', 'httpd', 'operator',
'guest', 'diginext', 'bind', 'cyrus', 'courier', 'games', 'kmem',
'mailnull', 'man', 'mysql', 'news', 'postfix', 'sshd', 'tty', 'www');
$conf['password']['strengthtests'] = false;
$conf['hooks']['full_name'] = true;
$conf['hooks']['default_username'] = false;
$conf['hooks']['username'] = false;
$conf['hooks']['userdn'] = false;
</code></pre>
<p>Configure the passwd back end to use the horde mysql database in /usr/share/horde/passwd/config/backends.php (remove all others)</p>
<pre><code>&lt;?php
$backends['hordesql'] = array (
    'name' =&gt; 'Horde Authentication',
    'preferred' =&gt; '',
    'password policy' =&gt; array(
        'minLength' =&gt; 5,
        'maxLength' =&gt; 8,
        'maxSpace' =&gt; 0,
        'minUpper' =&gt; 1,
        'minLower' =&gt; 1,
        'minNumeric' =&gt; 1,
        'minSymbols' =&gt; 1
    ),
    'driver' =&gt; 'sql',
    'params' =&gt; array_merge($conf['sql'],
                            array('table' =&gt; 'horde_users',
                                  'user_col' =&gt; 'user_uid',
                                  'pass_col' =&gt; 'user_pass',
                                  'show_encryption' =&gt; false)),
);
</code></pre>
<h4>Secure Horde installation</h4>
<p>Secure the horde installation</p>
<pre><code> chown apache:root -R /usr/share/horde/config
 chown apache:root -R /usr/share/horde/*/config
 chmod -R go-rwx /usr/share/horde/config
 chmod -R go-rwx /usr/share/horde/*/config
 chown -R root:root /usr/share/horde/scripts
 chown -R root:root /usr/share/horde/*/scripts
 chmod -R go-rwx /usr/share/horde/scripts
 chmod -R go-rwx /usr/share/horde/*/scripts
 chmod a-rwx /usr/share/horde/test.php
 chmod a-rwx /usr/share/horde/*/test.php
 find /usr/share/horde/ -iname readme -exec rm -f {} \;
 find /usr/share/horde/ -iname todo -exec rm -vf {} \;
 find /usr/share/horde/ -iname license -exec rm -vf {} \;
 find /usr/share/horde/ -iname copying -exec rm -vf {} \;
 find /usr/share/horde/ -iname docs -exec rm -vrf {} \;
</code></pre>
<h3>Configure Cyrus-imapd</h3>
<p>The cyrus-imapd system will have virtual hosting enabled, sieve scripts,
quota's set to 10MB, auto creation (&amp; auto subscription) of the mailbox with
these folders (INBOX,sent-mail,drafts,spam,trash). Authentication of users
will take place aganist the Mysql database via SASL using the saslauthd
daemon.</p>
<p>Create the configuration /etc/imapd.conf with the following content</p>
<pre><code>configdirectory: /var/lib/imap
servername: TDS-IMAP/POP3
partition-default: /var/spool/imap
virtdomains: on
defaultdomain: localhost.localdomain
admins: andrew@home.topdog-software.com
postmaster: support@home.topdog-software.com
quotawarn: 85
lmtp_over_quota_perm_failure: 1
lmtp_strict_quota: 1
autocreatequota: 10240
createonpost: 1
autocreateinboxfolders: sent-mail|drafts|spam|trash
autosubscribeinboxfolders: sent-mail|drafts|spam|trash
autocreate_sieve_script: /etc/default_sieve
autocreate_sieve_compiledscript: /etc/default_sieve_script.bc
sievedir: /var/lib/imap/sieve
md5_dir: /var/lib/imap/md5
#sievenotifier: sms
#sendsms: /usr/bin/mysmsprog
sendmail: /usr/sbin/sendmail
hashimapspool: true
sasl_pwcheck_method: saslauthd
sasl_mech_list: PLAIN
allowplainwithouttls: 0
tls_cert_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
tls_key_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
tls_ca_file: /etc/pki/tls/certs/ca-bundle.crt
loglevel: info
</code></pre>
<p>Create the configuration /etc/cyrus.conf with the following content</p>
<pre><code>START {
  # do not delete this entry!
  recover       cmd="ctl_cyrusdb -r"

  # this is only necessary if using idled for IMAP IDLE
  idled         cmd="idled"
  # replication
  # syncclient       cmd="/usr/lib/cyrus-imapd/sync_client -r"
}

# UNIX sockets start with a slash and are put into /var/lib/imap/sockets
SERVICES {
  # add or remove based on preferences
  imap          cmd="imapd" listen="imap" prefork=1 proto=tcp maxchild=100 maxfds=1000 provide_uuid=1
#  imaps                cmd="imapd -s" listen="imaps" prefork=1
  pop3          cmd="pop3d" listen="pop3" prefork=1 proto=tcp maxchild=100 maxfds=1000 provide_uuid=1
#  pop3s                cmd="pop3d -s" listen="pop3s" prefork=1
  sieve         cmd="timsieved" listen="localhost:sieve" prefork=0 proto=tcp maxfds=1000 provide_uuid=1

  # these are only necessary if receiving/exporting usenet via NNTP
#  nntp         cmd="nntpd" listen="nntp" prefork=3
#  nntps                cmd="nntpd -s" listen="nntps" prefork=1

  #fud
  # fud           cmd="fud" listen="fud" prefork=1 proto="udp"
  # at least one LMTP is required for delivery
#  lmtp         cmd="lmtpd" listen="lmtp" prefork=0
  lmtpunix      cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=1 maxfds=1000 provide_uuid=1

  # this is only necessary if using notifications
  notify        cmd="notifyd" listen="/var/lib/imap/socket/notify" proto="udp" prefork=1
  # replication
}

EVENTS {
  # this is required
  checkpoint    cmd="ctl_cyrusdb -c" period=30 maxfds=1000

  # this is only necessary if using duplicate delivery suppression,
  # Sieve or NNTP
  delprune      cmd="cyr_expire -E 3" at=0400

  # this is only necessary if caching TLS sessions
  #tlsprune     cmd="tls_prune" at=0400
  squat         cmd="squatter"  period=30
}
</code></pre>
<h3>Configure Pam_mysql</h3>
<p>Pam_mysql will be used to authenticate the following cyrus-imapd services
aganist the mysql database, IMAP,POP,SIEVE,LMTP,CSYNC.</p>
<h4>Pam_mysql configuration</h4>
<p>Enable pam_mysql for the services make the changes below.</p>
<p>/etc/pam.d/imap</p>
<pre><code>auth       optional     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
account    required     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
</code></pre>
<p>/etc/pam.d/pop</p>
<pre><code>auth       optional     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
account    required     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
</code></pre>
<p>/etc/pam.d/sieve</p>
<pre><code>auth       optional     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
account    required     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
</code></pre>
<p>/etc/pam.d/lmtp</p>
<pre><code>auth       optional     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
account    required     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
</code></pre>
<p>/etc/pam.d/csync</p>
<pre><code>auth       optional     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
account    required     pam_mysql.so user=horde passwd=hordepassword \
host=/var/lib/mysql/mysql.sock db=horde table=horde_users usercolumn=user_uid passwdcolumn=user_pass crypt=3
</code></pre>
<h4>Saslauthd configuration</h4>
<p>Edit /etc/sysconfig/saslauthd and modify to below</p>
<pre><code>SOCKETDIR=/var/run/saslauthd

# Mechanism to use when checking passwords.  Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled to use.
MECH=pam

# Additional flags to pass to saslauthd on the command line.  See saslauthd(8)
# for the list of accepted flags.
FLAGS="-r -n 0 -c"
</code></pre>
<h3>Configure ClamAV</h3>
<p>Add the clamav user to the exim group.</p>
<pre><code>usermod -G exim clamav
</code></pre>
<p>Change the location of the socket and disable TCP. Make changes to /etc/clamd.conf</p>
<pre><code>LocalSocket /var/run/clamav/clamd.socket
#TCPSocket 3310
#TCPAddr 127.0.0.1
</code></pre>
<p>Install sane security signatures</p>
<pre><code>wget http://www.sanesecurity.co.uk/clamav/update_sanesecurity.txt -O /usr/local/bin/update_sanesecurity.sh
chmod +x /usr/local/bin/update_sanesecurity.sh
ln -s /usr/local/bin/update_sanesecurity.sh /etc/cron.hourly/
/usr/local/bin/update_sanesecurity.sh
</code></pre>
<p>Enable local selinux module for clamav, create file clamdlocal.te and add the following</p>
<pre><code>module clamdlocal 1.0;

require {
        type proc_t;
        type var_t;
        type sysctl_kernel_t;
        type var_spool_t;
        type clamd_t;
        class dir { write search read remove_name add_name };
        class file { write getattr read lock create unlink };
}

#============= clamd_t ==============
allow clamd_t proc_t:file { read getattr };
allow clamd_t sysctl_kernel_t:dir search;
allow clamd_t sysctl_kernel_t:file read;
allow clamd_t var_spool_t:dir read;
allow clamd_t var_spool_t:file { read getattr };
allow clamd_t var_t:dir { write read add_name remove_name };
allow clamd_t var_t:file { write getattr read lock create unlink };
</code></pre>
<p>Compile and load the module</p>
<pre><code>checkmodule -M -m -o clamdlocal.mod clamdlocal.te
semodule_package -o clamdlocal.pp -m clamdlocal.mod
semodule -i clamdlocal.pp
</code></pre>
<h3>Configure Spamassassin</h3>
<p>Modify the startup options edit /etc/sysconfig/spamassassin and modify as below</p>
<pre><code>SPAMDOPTIONS=" -l -d -c -m5 -H -m 10 --socketpath=/var/run/spamassassin/spamd.sock --socketowner=exim"
</code></pre>
<p>Enable local spamd module for spamassassin, create file spamdlocal.te and add the following</p>
<pre><code>module spamdlocal 1.0;

require {
        type spamd_t;
        type spamd_var_run_t;
        class capability { fowner chown kill };
        class sock_file { write create unlink getattr setattr };
}

#============= spamd_t ==============
allow spamd_t self:capability { fowner chown kill };
allow spamd_t spamd_var_run_t:sock_file { write create unlink getattr setattr };
</code></pre>
<p>Compile and install the module</p>
<pre><code>checkmodule -M -m -o spamdlocal.mod spamdlocal.te
semodule_package -o spamdlocal.pp -m spamdlocal.mod
semodule -i spamdlocal.pp
</code></pre>
<h2>Final touches</h2>
<h3>Disable services</h3>
<p>Disable unwanted services, use this <a href="http://www.topdog-
software.com/files/disable_service.sh.gz">script</a></p>
<h3>Enable services</h3>
<pre><code>chkconfig --level 234 exim on
chkconfig --level 234 mysqld on
chkconfig --level 234 spamassassin on
chkconfig --level 234 clamd on
chkconfig --level 234 httpd on
chkconfig --level 234 saslauthd on
chkconfig --level 234 cyrus-imapd on

service mysqld restart
service saslauthd restart
service spamassassin restart
service clamd restart
service exim restart
service cyrus-imapd restart
service httpd restart
</code></pre>
<h3>Create admin user</h3>
<p>Create a file admin.sql and add the following (modify the password to suite you)</p>
<pre><code>USE horde;

REPLACE INTO horde_users (user_uid,user_pass)
    VALUES (
        'andrew@home.topdog-software.com',
-- Change this
        md5('verystrongpassword'),
);
</code></pre>
<p>Add user to database</p>
<pre><code>mysql -p horde &lt; admin.sql
</code></pre>
<h3>Firewall</h3>
<p>Add these rules in your configuration file /etc/sysconfig/iptables</p>
<pre><code>*raw
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT

*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT

*filter
:FORWARD DROP [0:0]
:INPUT DROP [0:0]
:OUTPUT DROP [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m multiport -j ACCEPT --dports 80,443,25,110,143
-A INPUT -p icmp -m icmp -m limit --icmp-type 8 --limit 5/min -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -s 192.168.1.4 -j ACCEPT
COMMIT
</code></pre>
<h3>Login</h3>
<p>Phew ! you are done. Open your browser and go to
<a href="https://192.168.1.4/">https://192.168.1.4/</a> and login with the details above,
you can the create other users under administration → users. You can test all
the other features as well.</p>
<h2>References</h2>
<ul>
<li><a href="http://www.horde.org">http://www.horde.org</a></li>
<li><a href="http://wiki.horde.org/CentOS5InstallationNotes">http://wiki.horde.org/CentOS5InstallationNotes</a></li>
<li><a href="http://sanesecurity.co.uk/clamav/">http://sanesecurity.co.uk/clamav/</a></li>
<li><a href="http://www.exim.org/">http://www.exim.org/</a></li>
<li><a href="http://cyrusimap.web.cmu.edu/imapd/install.html">http://cyrusimap.web.cmu.edu/imapd/install.html</a></li>
<li><a href="http://pam-mysql.sourceforge.net/">http://pam-mysql.sourceforge.net/</a></li>
<li><a href="http://dev.mysql.com/">http://dev.mysql.com/</a></li>
</ul>]]></content:encoded>
    </item>
    <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>
