<?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>Denie&#039;s Tech Blog &#187; Sendmail</title>
	<atom:link href="http://blog.nataprawira.com/tech/category/sendmail/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nataprawira.com/tech</link>
	<description>Information Technology for Life!</description>
	<lastBuildDate>Mon, 19 Jul 2010 09:20:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up DomainKeys on Centos</title>
		<link>http://blog.nataprawira.com/tech/2010/03/09/setting-up-domainkeys-on-centos/</link>
		<comments>http://blog.nataprawira.com/tech/2010/03/09/setting-up-domainkeys-on-centos/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:30:22 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[DomainKeys]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=140</guid>
		<description><![CDATA[

This is a quick walk through on how to set up domain keys on Centos 5 using sendmail. It should also be very similar for Redhat or Fedora.

Domainkeys is a method mostly used by yahoo to verify that the sender of an email is valid. I did notice that gmail changes the domainkeys header line [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F03%2F09%2Fsetting-up-domainkeys-on-centos%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F03%2F09%2Fsetting-up-domainkeys-on-centos%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h2><span style="font-weight: normal;font-size: 13px">This is a quick walk through on how to set up domain keys on Centos 5 using sendmail. It should also be very similar for Redhat or Fedora.</span></h2>
<div>
<p>Domainkeys is a method mostly used by yahoo to verify that the sender of an email is valid. I did notice that gmail changes the domainkeys header line to a pass value but I don’t know if they block/accept mail based on that.<span id="more-140"></span></p>
<p>First install some dependencies.</p>
<blockquote><p><strong>yum install sendmail-devel openssl-devel</strong></p></blockquote>
<p>First download the latest version of dk-milter by going to http://sourceforge.net/projects/dk-milter/</p>
<blockquote><p><strong>cd /usr/src/<br />
wget http://downloads.sourceforge.net/dk-milter/dk-milter-1.0.0.tar.gz</strong></p></blockquote>
<p>Then extract it using the command</p>
<blockquote><p><strong>tar xzf dk-milter-1.0.0.tar.gz<br />
cd dk-milter-2.6.0</strong></p></blockquote>
<p>Start by copying the sample config file to the proper directory and the make/make installing</p>
<blockquote><p><strong>cp site.config.m4.dist devtools/Site/site.config.m4<br />
make; make install</strong></p>
<p><span> </span></p></blockquote>
<p>You may see a few errors during the install, as long as they are just about creating the man pages you should be alright. Now change back to a good working directory and create your new keys.</p>
<blockquote><p><strong>cd ~/ssl-gen<br />
openssl genrsa -out rsa.private 768<br />
openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM</strong></p></blockquote>
<p>Make the directory and move the private key into it.</p>
<blockquote><p><strong>mkdir -p /var/db/domainkeys/<br />
cp rsa.private /var/db/domainkeys/mail.key.pem</strong></p></blockquote>
<p>Now we should set up our DNS TXT records with our public key. This is how it should look in a bind zone file. Put the public key only and not the “BEGIN RSA PRIVATE…” or “END RSA…” parts of the key with out parenthesis.</p>
<blockquote><p><strong>mail._domainkey.jkurtzman.com.         IN TXT  “k=rsa; t=y; p=(Paste the public key here)”<br />
_domainkey.jkurtzman.com.                 IN TXT  “t=y; o=~”</strong></p></blockquote>
<p>You can use the following command to verify that your TXT record was set up correctly.</p>
<blockquote><p><strong>dig +short mail._domainkey.jkurtzman.com TXT</strong></p></blockquote>
<p>Now we will need to make the init script so the it starts when the computer reboots. Put the following into a file called <strong>/etc/init.d/domainkeys</strong>. Of course be sure to change the domain to your own domain. Remember to fix any lines that have wrapped when copying. Especially the COMMAND line.</p>
<blockquote><p><strong>#!/bin/sh<br />
#<br />
# “/etc/rc.d/init.d/dk-filter”<br />
# Start/stop script for the dk-filter daemon on RedHat Linux<br />
#<br />
# chkconfig: – 79 31<br />
# description: Acts as the “dk-filter” InputMailFilter (milter) for the \<br />
# Sendmail MTA to provide DomainKeys service</strong></p>
<p><strong>############################################################<br />
#<br />
# Be sure to edit these values:<br />
#<br />
KEYFILE=”/var/db/domainkeys/mail.key.pem”<br />
DOMAIN=”jkurtzman.com”<br />
SELECTOR=”mail”<br />
USER=”domainkeys”<br />
#<br />
############################################################</strong></p>
<p><strong>PIDFILE=”/var/run/dk-milter/pid”<br />
SUBMISSION_DAEMON=”smtp”<br />
PORT=8891</strong></p>
<p><strong># Source function library. Provides the “status” option<br />
. /etc/init.d/functions</strong></p>
<p><strong>test -x `which dk-filter` || exit 0</strong></p>
<p><strong>RETVAL=0</strong></p>
<p><strong>start() {<br />
echo -n $”Starting dk-filter: ”<br />
COMMAND=”dk-filter -u $USER -b s -p inet:$PORT@localhost -l -P $PIDFILE -s $KEYFILE -d $DOMAIN -S $SELECTOR -m$SUBMISSION_DAEMON -c nofws”<br />
# echo -e “Now executing\n”$COMMAND”&#8221;<br />
daemon $COMMAND<br />
RETVAL=$?<br />
echo<br />
[ $RETVAL -eq 0 ] &amp;&amp; touch /var/lock/subsys/dk-filter<br />
return $RETVAL<br />
}</strong></p>
<p><strong>stop() {<br />
echo -n $”Stopping dk-filter: ”<br />
killproc dk-filter<br />
RETVAL=$?<br />
echo<br />
[ $RETVAL -eq 0 ] &amp;&amp; rm -f $PIDFILE /var/lock/subsys/dk-filter<br />
return $RETVAL<br />
}</strong></p>
<p><strong>restart() {<br />
stop<br />
start<br />
}</strong></p>
<p><strong>case “$1″ in<br />
start)<br />
start<br />
;;<br />
stop)<br />
stop<br />
;;<br />
status)<br />
status dk-filter<br />
;;<br />
restart)<br />
restart<br />
;;<br />
*)<br />
echo $”Usage: $0 {start|stop|status|restart}”<br />
exit 1<br />
esac</strong></p>
<p><strong>exit $?</strong></p></blockquote>
<p>Give your new file execute permisions, create a user for domain keys to run as, and start it</p>
<blockquote><p><strong>chmod +x /etc/init.d/domainkeys<br />
useradd domainkeys<br />
service domainkeys start</strong></p></blockquote>
<p>If everything work you should see that the dk-filter has started.<br />
Now run chkconfig so the service starts when you reboot.</p>
<blockquote><p><strong>chkconfig domainkeys on</strong></p></blockquote>
<p>Now add this to your /etc/mail/sendmail.mc file.</p>
<blockquote><p><strong>INPUT_MAIL_FILTER(`dk-filter’, `S=inet:8891@localhost’)</strong></p></blockquote>
<p>And make and restart sendmail.</p>
<blockquote><p><strong>cd /etc/mail<br />
make<br />
service sendmail restart</strong></p></blockquote>
<p>You should now be able to send email and be domainkey verified. If you are relaying mail through the mail server you will need to make sure you are using SMTP Authentication otherwise the  dk-filter will not add the header information.</p>
<p>Try sending an email to a yahoo account and see if you get secure icon.</p>
<p><span style="font-family: 'Trebuchet MS';font-size: x-small"> </span></p>
<h1><span style="font-family: 'Trebuchet MS'">Source:</span></h1>
<h1><span style="font-family: 'Trebuchet MS'"><a href="http://luxio.us/cMZ11e" target="_blank">http://luxio.us/cMZ11e </a></span></h1>
</div>

<div class="bitly_links">
<div class="bitly_linkstext">
Share this on : 
</div>
<ul>
	<li class="bitly_linksfirst"><a rel="nofollow" id="facebook" target="_blank" href="javascript:window.location='http%3A%2F%2Fwww.facebook.com%2Fshare.php%3Fu%3Dhttp%253A%252F%252Fbit.ly%252F9eRCUw%26amp%3Bt%3DSetting%2520up%2520DomainKeys%2520on%2520Centos';" title="Facebook">Facebook</a></li>
	<li><a rel="nofollow" id="friendfeed" target="_blank" href="javascript:window.location='http%3A%2F%2Fwww.friendfeed.com%2Fshare%3Ftitle%3DSetting%2520up%2520DomainKeys%2520on%2520Centos%26amp%3Blink%3Dhttp%253A%252F%252Fbit.ly%252F9eRCUw';" title="Friendfeed">Friendfeed</a></li>
	<li><a rel="nofollow" id="posterous" target="_blank" href="javascript:window.location='http%3A%2F%2Fposterous.com%2Fshare%3Flinkto%3Dhttp%253A%252F%252Fbit.ly%252F9eRCUw%26amp%3Btitle%3DSetting%2520up%2520DomainKeys%2520on%2520Centos%26amp%3Bselection%3D';" title="Posterous">Posterous</a></li>
	<li><a rel="nofollow" id="tumblr" target="_blank" href="javascript:window.location='http%3A%2F%2Fwww.tumblr.com%2Fshare%3Fv%3D3%26amp%3Bu%3Dhttp%253A%252F%252Fbit.ly%252F9eRCUw%26amp%3Bt%3DSetting%2520up%2520DomainKeys%2520on%2520Centos%26amp%3Bs%3D';" title="Tumblr">Tumblr</a></li>
	<li class="bitly_linkslast"><a rel="nofollow" id="twitter" target="_blank" href="javascript:window.location='http%3A%2F%2Ftwitter.com%2Fhome%3Fstatus%3DSetting%2520up%2520DomainKeys%2520on%2520Centos%2520-%2520http%253A%252F%252Fbit.ly%252F9eRCUw';" title="Twitter">Twitter</a></li>
</ul>
</div>
<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/03/09/setting-up-domainkeys-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing Sendmail</title>
		<link>http://blog.nataprawira.com/tech/2009/12/09/optimizing-sendmail/</link>
		<comments>http://blog.nataprawira.com/tech/2009/12/09/optimizing-sendmail/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 15:14:12 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=125</guid>
		<description><![CDATA[

Most of them involve changing the daemon&#8217;s configuration in /etc/sendmail.mc and rebuilding sendmail.cf
Specific things that can affect performance:
dnl # Sendmail, Chap 24.9.13, Page 955
dnl # Disable re-write of queue control file (will result in duplicates
dnl #   if the daemon is interrupted during a delivery)
define(`confCHECKPOINTINTERVAL&#8217;,`0&#8242;)dnl
dnl # Sendmail, Chap 24.9.21, Page 960
dnl # Disable throttling the acceptance [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F12%2F09%2Foptimizing-sendmail%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F12%2F09%2Foptimizing-sendmail%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Most of them involve changing the daemon&#8217;s configuration in <strong>/etc/sendmail.mc</strong> and <span style="text-decoration: underline">rebuilding</span> <strong>sendmail.cf</strong></p>
<p><span style="text-decoration: underline">Specific things that can affect performance</span>:</p>
<p>dnl # Sendmail, Chap 24.9.13, Page 955<br />
dnl # Disable re-write of queue control file (will result in duplicates<br />
dnl #   if the daemon is interrupted during a delivery)<br />
<strong>define(`confCHECKPOINTINTERVAL&#8217;,`0&#8242;)dnl<span id="more-125"></span></strong></p>
<p>dnl # Sendmail, Chap 24.9.21, Page 960<br />
dnl # Disable throttling the acceptance of new connections<br />
<strong>define(`confCONNECTION_RATE_THROTTLE&#8217;,`0&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.25, Page 967<br />
dnl # Specify the maximum size, in bytes, of buffered df* files (default is<br />
dnl #   4096 bytes; 0 turns this off and is not recommended)<br />
<strong>define(`confDF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.60, Page 1011<br />
dnl # Disable limit on the daemon spawning new children<br />
<strong>define(`confMAX_DAEMON_CHILDREN&#8217;,`0&#8242;)dnl </strong></p>
<p>dnl # Sendmail, Chap 24.9.66, Page 1016<br />
dnl # Disbale limit on the number of messages that may be processed<br />
dnl #  during any one queue run<br />
<strong>define(`confMAX_QUEUE_RUN_SIZE&#8217;,`0&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.19, Page 959<br />
dnl # Turn on connection caching and set maximum number of simultaneous<br />
dnl #  outbound connections kept open to 4; default is 2; this option also<br />
dnl #  depends on MCI_CACHE_TIMEOUT (below)<br />
<strong>define(`confMCI_CACHE_SIZE&#8217;,`4&#8242;)dnl </strong></p>
<p>dnl # Sendmail, Chap 24.9.19, Page 959<br />
dnl # Set time limit on how long a cached outbound connection may be<br />
dnl #  kept open to 120 seconds (2 minutes) &#8211; see MCI_CACHE_SIZE above<br />
<strong>define(`confMCI_CACHE_TIMEOUT&#8217;,`120s&#8217;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.72, Page 1022<br />
dnl # Disable time delay for queued messages not delivered on the first try<br />
<strong>define(`confMIN_QUEUE_AGE&#8217;,`0&#8242;)dnl </strong></p>
<p>dnl # Sendmail, Chapter 24.9.107, Page 1057<br />
dnl # Disable MTA setting that forces MTA to queue each message and to sync<br />
dnl #   to disk before forking (a system crash may result in lost mail)<br />
<strong>define(`confSAFE_QUEUE&#8217;,`false&#8217;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.109.13, Page 1065<br />
dnl # Disable IDENT (RFC 1413) calls/turn off sending user-host verification<br />
<strong>define(`confTO_IDENT&#8217;,`0&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.120, Page 1077<br />
dnl # Specify the maximum size, in bytes, of buffered xf* files (default is<br />
dnl #   4096 bytes; 0 turns this off and is not recommended)<br />
<strong>define(`confXF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 4.8.28, Page 192<br />
dnl # Turn off E-Mail canonization (should be done by MSA, and this<br />
dnl #     is a mail relay with no local users)<br />
<strong>FEATURE(`nocanonify&#8217;)dnl</strong></p>
<p>I&#8217;m assuming you&#8217;re using a modern version of sendmail &#8211; v8.12.10 or later. These settings may be different, or not exist at all, for older versions.</p>
<p><em><strong><a title="http://www.experts-exchange.com/Software/Server_Software/Email_Servers/SendMail/Q_21598211.html" href="http://www.experts-exchange.com/Software/Server_Software/Email_Servers/SendMail/Q_21598211.html" target="_blank">Source</a></strong></em></p>
<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/12/09/optimizing-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to manually install DKIM-Filter with Sendmail</title>
		<link>http://blog.nataprawira.com/tech/2009/08/15/how-to-manually-install-dkim-filter-with-sendmail/</link>
		<comments>http://blog.nataprawira.com/tech/2009/08/15/how-to-manually-install-dkim-filter-with-sendmail/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 19:32:32 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[Filter]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=89</guid>
		<description><![CDATA[

Source: [click here]

Max 30 mins work.

However, life is rarely so simple.
yum search dkim didn't find anything.

So, based on what I could find, I ended up here. Downloaded dkim-filter
2.4.1 and went on an epic voyage of discovery into the RFCs and other stuff.
I just want to install, configure and run the thing!

Anyway. I thought compilation would [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F15%2Fhow-to-manually-install-dkim-filter-with-sendmail%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F15%2Fhow-to-manually-install-dkim-filter-with-sendmail%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<pre>Source: [<a href="http://www.mail-archive.com/dkim-milter-discuss@lists.sourceforge.net/msg00535.html" target="_blank">click here</a>]

Max 30 mins work.

However, life is rarely so simple.
yum search dkim didn't find anything.

So, based on what I could find, I ended up here. Downloaded dkim-filter
2.4.1 and went on an epic voyage of discovery into the RFCs and other stuff.
I just want to install, configure and run the thing!
<span id="more-89"></span>
Anyway. I thought compilation would be straightforward, but no. More
unfamiliar stuff to read. I dutifully read the site.config.m4.dist, copied
to devtools/Site/site.config.m4 and hoped to make some intelligent decisions
on what options to enable.

 # ./Build
...
&gt;Making all in:
&gt;/etc/mail/dkim/dkim-milter-2.4.1/dkim-filter
&gt;Configuration: pfx=, os=Linux, rel=2.6.23.1-10.fc7, rbase=2,
&gt;rroot=2.6.23.1-10, arch=x86_64, sfx=, variant=optimized
&gt;Using M4=/usr/bin/m4
&gt;Creating
&gt;/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter
&gt;using /etc/mail/dkim/dkim-milter-2.4.1/devtools/OS/Linux
&gt;Making dependencies in
&gt;/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter
&gt;make[1]: Entering directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;rm -f sm_os.h
&gt;ln -f -s ../../include/sm/os/sm_os_linux.h sm_os.h
&gt;cc -M -I. -I../../include  -I../libdkim/   -D_REENTRANT config.c dkim-ar.c
&gt;dkim-filter.c stats.c test.c util.c   dkim-testkey.c   dkim-testssp.c    &gt;&gt;
&gt;Makefile
&gt;In file included from config.h:23,
&gt;                 from config.c:20:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from dkim-ar.h:19,
&gt;                 from dkim-ar.c:23:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;dkim-filter.c:59:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from config.h:23,
&gt;                 from dkim-filter.c:78:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from test.c:31:
&gt;test.h:24:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from util.c:49:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;make[1]: *** [depend] Error 1
&gt;make[1]: Leaving directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;Making in
&gt;/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter
&gt;make[1]: Entering directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;cc -O2 -I. -I../../include  -I../libdkim/   -D_REENTRANT -DXP_MT   -c -o
&gt;config.o config.c
&gt;In file included from config.h:23,
&gt;                 from config.c:20:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from config.h:23,
&gt;                 from config.c:20:
&gt;dkim-filter.h:86: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_connect’
&gt;dkim-filter.h:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_envfrom’
&gt;dkim-filter.h:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_header’
&gt;dkim-filter.h:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_eoh’
&gt;dkim-filter.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_body’
&gt;dkim-filter.h:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_eom’
&gt;dkim-filter.h:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_abort’
&gt;dkim-filter.h:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_close’
&gt;make[1]: *** [config.o] Error 1
&gt;make[1]: Leaving directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;make: *** [all] Error 2

After some googling, a "yum install sendmail-devel" fixed this problem, and
a ./Build -c completed successfully.
I copied /devtools/OS/Linux to /devtools/Site/site.Linux.m4

./Build install was successful after manually creating dirs /usr/man/man15
and /usr/man/man18
Fedora manuals are in /usr/share/man
The files /usr/bin/dk* should have ownership root:root instead of bin.

Sendmail of Fedora 7 is currently 8.14.1:
# sendmail -d0.1
Version 8.14.1
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
 MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
 NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
 TCPWRAPPERS USERDB USE_LDAP_INIT

I created the keys, updated the dns zone files and decided to use user smmsp
instead of creating yet another user.

I created:
/var/db/dkim :
-rw-r----- 1 smmsp smmsp 887 2008-01-01 08:30 jan2008.admin.key.pem
-rw-r--r-- 1 smmsp smmsp 272 2008-01-01 08:30 jan2008.admin.public.pem

/var/run :
drwxr-xr-x 2 smmsp   smmsp   4096 2008-01-04 09:23 milter

and created this basic start/stop init script:
/etc/init.d/dkim-filter
then:
chkconfig --add dkim-filter
chkconfig dkim-filter on

contents:
&gt;#
&gt;# dkim-filter        Starts /usr/bin/dkim-filter
&gt;#
&gt;# chkconfig: 2345 67 33
&gt;#
&gt;# description: Domain Keys Milter
&gt;# processname: dkim-filter
&gt;#
&gt;# Source function library.
&gt;. /etc/init.d/functions
&gt;
&gt;[ -f /usr/bin/dkim-filter ] || exit 0
&gt;RETVAL=0
&gt;
&gt;umask 077
&gt;
&gt;start() {
&gt;        echo -n $"Starting dkim-filter: "
&gt;        /usr/bin/dkim-filter -x /etc/mail/dkim.conf
&gt;        RETVAL=$?
&gt;        if [ $RETVAL -eq 0 ]
&gt;        then
&gt;                echo_success
&gt;                touch /var/lock/subsys/dkim-filter
&gt;        else
&gt;                echo_failure
&gt;        fi
&gt;        echo
&gt;}
&gt;stop() {
&gt;        echo -n $"Shutting down dkim-filter: "
&gt;        /bin/kill `cat /var/run/milter/dkim-filter.pid 2&gt; /dev/null ` &gt;
&gt; /dev/null 2&gt;&amp;1
&gt;        RETVAL=$?
&gt;        sleep 3
&gt;        if [ $RETVAL -eq 0 ]
&gt;        then
&gt;                echo_success
&gt;                rm -f /var/lock/subsys/dkim-filter
&gt;                rm -f /var/run/milter/dkim-filter.pid
&gt;        else
&gt;                echo_failure
&gt;        fi
&gt;        echo
&gt;}
&gt;rhstatus() {
&gt;        status dkim-filter
&gt;}
&gt;restart() {
&gt;        stop
&gt;        start
&gt;}
&gt;
&gt;case "$1" in
&gt;  start)
&gt;        start
&gt;        ;;
&gt;  stop)
&gt;        stop
&gt;        ;;
&gt;  status)
&gt;        rhstatus
&gt;        ;;
&gt;  restart|reload)
&gt;        restart
&gt;        ;;
&gt;  condrestart)
&gt;        [ -f /var/lock/subsys/dkim-filter ] &amp;&amp; restart || :
&gt;        ;;
&gt;  *)
&gt;        echo $"Usage: $0 {start|stop|status|restart|condrestart}"
&gt;        exit 1
&gt;esac
&gt;
&gt;exit $?

Now for configuration files:

/etc/mail/dkim.conf :
Canonicalization        relaxed/simple
Domain                  /etc/mail/domains
KeyFile                 /var/db/dkim/jan2008.admin.key.pem
#MTA                    MTA
Selector                jan2008.admin
SignatureAlgorithm      rsa-sha256
Socket                  inet:[EMAIL PROTECTED]
#Socket                 /var/run/milter/dkim-filter.sock
Syslog                  Yes
SyslogSuccess           Yes
Userid                  smmsp
PidFile                 /var/run/milter/dkim-filter.pid
SubDomains              Yes
X-Header                No
SendReports             No

/etc/mail/domains contains just one domain on one line.

and added to sendmail.rc:
INPUT_MAIL_FILTER(`dkim-filter', `S=inet:[EMAIL PROTECTED]')

I started the script with
/etc/init.d/dkim-filter start
and it worked, eg:
&gt;Jan  4 10:58:10 gaia dkim-filter[6033]: Sendmail DKIM Filter v2.4.1 starting
&gt;(args: -x /etc/mail/dkim.conf)

It even adds signatures to my messages (hopefully to this one), but silently
crashes regularly without any indication on processing a simple locally
generated mail from a perl script and/or/exor from logwatch or virus
notification from MailScanner. eg:

DKIMDEBUG=ct :
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260: from=&lt;[EMAIL
&gt;PROTECTED]&gt;, size=1780,, nrcpts=1, msgid=&lt;[EMAIL PROTECTED]&gt;,
&gt;proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
&gt;Jan  3 02:57:18 gaia dkim-filter[6926]: thread 0x41e02950 header
&gt;Jan  3 02:57:18 gaia last message repeated 6 times
&gt;Jan  3 02:57:18 gaia dkim-filter[6926]: thread 0x41e02950 eoh
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260:
&gt;milter_sys_read(dkim-filter): cmd read returned 0, expecting 5
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260: Milter (dkim-filter): to
&gt;error state
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260: to=&lt;[EMAIL PROTECTED]&gt;,
&gt;delay=00:00:00, mailer=esmtp, pri=31780, stat=queued

I have spent the last couple of days trying to solve this
The only relevant information I found was Jim Hermann's useful message and
thread last month
<a rel="nofollow" href="http://www.mail-archive.com/dkim-milter-discuss@lists.sourceforge.net/msg00409.html">http://www.mail-archive.com/dkim-milter-discuss@lists.sourceforge.net/msg00409.html</a>

I'm disappointed, disillusioned and frustrated in trying to nail jelly to a
wall... This doesn't say anything useful at all!
&gt;milter_sys_read(dkim-filter): cmd read returned 0, expecting 5

It only seems to happen by locally generated mail, sometimes it even seemed
as if having a Reply-To: field influenced its crash frequency, but without
real diagnostic tools, skills and a lot of time, I can't solve it. I'm an
experienced sysadmin, not a C programmer! Programmers should try to make all
our lives easier! <img src='http://blog.nataprawira.com/tech/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> 

I want to get this working reliably and dependably on a few production
systems, and know what options to compile with and what settings to use for
Fedora, but I'm now stumped.

When it does work, another gripe is this padding too short error, which may
or may not be a reason for the verification failure:
&gt;Jan  4 08:14:35 gaia dkim-filter[8389]: m047EY6O010080 SSL error:04067069:rsa
&gt;routines:RSA_EAY_PUBLIC_DECRYPT:pkcs1 padding too short; error:04077068:rsa
&gt;routines:RSA_verify:bad signature
&gt;Jan  4 08:14:35 gaia dkim-filter[8389]: m047EY6O010080: bad signature data
&gt;Jan  4 08:14:35 gaia sendmail[10080]: m047EY6O010080: Milter insert (1):
&gt;header: Authentication-Results:  gaia.haveland.com; dkim=neutral (verification
&gt;failed) [EMAIL PROTECTED]

How can a gmail signature fail verification? What did it fail on? What is
the "i" in  "header.i" ?
It was a mysql mailing list, so perhaps other headers got in the way, but
this isn't what I would call a robust solution! Omitheaders command in
dkim.conf seems to be a blanket fudge.

If we are to stand a chance of defeating spammers, then we have to make DKIM
easier to install and configure so mere mortals can install and use it, and
encourage adoption.  I'm sure many would like to see dkim-filter available
in rpm for various distros.

However, Network Solutions, amongst others need to wake up and allow people
to modify their DNS TXT attributes... Here's what their completely
ridiculous FAQ says on the subject:
<a rel="nofollow" href="http://customersupport.networksolutions.com/article.php?id=369">http://customersupport.networksolutions.com/article.php?id=369</a>

&gt;"Can I Make Changes To The TXT Record
&gt;
&gt; Network Solutions does not currently support changes to the
&gt; TXT record for a domain name registration.
&gt;
&gt; The TXT Record is strictly informational, not functional."

What planet are they living on?

Cheers,
Andy.</pre>
<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/08/15/how-to-manually-install-dkim-filter-with-sendmail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
