Now we build the dkim-milter package. Extract the source:
tar -zxvf dkim-filter-1.0.0.tar.gz
cd dkim-filter-1.0.0
There are two things to do to get it to compile. First we change a db
lookup because for some reason, the version of db4 that comes with RH8.0
doesn't use a db_open() with the same amount of parameters as the source code
expects.
perl -pi -e 's/# if DB_VERSION_CHECK\(4,0,0\)/# if DB_VERSION_CHECK\(4,1,0\)/' dkim-filter/dkim-stats.c dkim-filter/stats.c
The second thing we do is configure the m4 file:
cat > devtools/Site/site.config.m4 << EOF
APPENDDEF(`confENVDEF', `-D_FFR_STATS ')
define(`confMANROOT', `/usr/share/man/man')
EOF
Now we build and install it:
sh Build
sh Build install
mkdir /var/lib/dkim
Put a config file in place:
cat > /etc/sysconfig/dkim-milter << EOF
DKIM_CONFIG="/etc/mail/dkim-milter.conf"
EOF
cat > /etc/mail/dkim.conf << EOF
Background Yes
Canonicalization simple
Domain /etc/mail/dkim-milter.domains
DNSTimeout 60
InternalHosts /etc/mail/dkim-milter.internalhosts
# KeyFile /etc/mail/domainkeys/test.pem
Mode v
MTA MSA
On-BadSignature accept
On-DNSError accept
On-InternalError accept
On-NoSignature accept
On-SignatureMissing accept
Selector test
Socket inet:10036@localhost
Statistics /var/lib/dkim/test.db
Syslog Yes
X-Header No
EOF
cat > /etc/mail/dkim-milter.internalhosts << EOF
127.0.0.1
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
EOF
hostname > /etc/mail/dkim-milter.domains
Create an init script:
cat > /etc/init.d/dkim-milter << EOF
#! /bin/sh
#
#
# dkim-filter Start/Stop the dkim milter daemon.
#
# chkconfig: 2345 85 15
# description: dkim is Domain Keys Identified Mail. It is a method of \
# computing cryptographic signatures for message headers in \
# an attempt to detect/prevent email forgeries.
# processname: dkim-filter
. /etc/init.d/functions
if [ -f /etc/sysconfig/dkim-milter ]; then
. /etc/sysconfig/dkim-milter
else
echo "No dkim-milter config file in /etc/sysconfig"
exit
fi
case "$1" in
start)
echo -n "Starting DKIM milter: "
daemon /usr/bin/dkim-filter -x $DKIM_CONFIG
;;
stop)
echo -n "Shutting down DKIM milter: "
killproc dkim-filter
;;
restart)
$0 stop
$0 start
;;
reload|force-reload)
echo -n "Reload service DKIM: "
killproc dkim-filter -HUP
;;
status)
echo -n "Checking for service DKIM: "
status /usr/bin/dkim-filter
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|reload}"
exit 1
esac
echo
EOF
Make the init script executable and set it to start at boot:
chmod +x /etc/init.d/dkim-milter
chkconfig --add dkim-milter