[vox-tech] Anyone running a mail server on a dynamic IP?

Brian Lavender brian at brie.com
Tue Jun 22 12:20:20 PDT 2004


On Tue, Jun 22, 2004 at 11:27:57AM -0700, Rick Moen wrote:
> Quoting Brian Lavender (brian at brie.com):
> 
> > I am doing a talk on integrating SpamAssassin at the SMTP layer. The
> > implementation is SA-Exim. http://www.saclug.org/
> 
> Hi, Brian!  Man, I want to drive up and hear that.  In case it helps,
> here's something that works beautifully with Exim4 and SA-Exim:
> http://www.jcdigita.com/eximconfig/
> 
> It's a very extensive prebuilt set of Exim4 / Exiscan / SA-Exim / ClamAV
> / spfd configuration, ACL, and rc files.  Not installed here, since I'd 
> already painfully configured my own SA-Exim setup before discovering the
> Eximconfig site.
> 
> I recall that you're doing all this on Debian 3.0 "woody".  Might make
> things easier for you, generally (esp. w/r/t dependencies) if you
> switched to "sarge", but I salute your spirit in sticking to woody.

My first test was with Debian unstable, but with a mail server, I think
I want to run Debian stable. That's why I wrote a script that will
automatically install SA-Exim. Here it is. I don't know why, but I had
to fish out the dependencies for SpamAssassin for the whole thing to go
automatic. 


#!/bin/bash

# Fri Jun 18 04:31:14 PDT 2004
# 
# Automatic script to get SA-Exim running on Debian stable.
# Warning. This script uses specific Debian package repositories
# that may change. Use at your own risk.
#
# Brian E. Lavender
# brian at brie.com

if [ "$EUID" != "0" ]                                                           
then
	echo "This script must be run as root!!"
	exit
fi

sources="/etc/apt/sources.list"

grep -q unstable $sources

if [ $? -ne 0 ]
then
   echo "deb-src http://mirrors.kernel.org/debian/ unstable main" >> $sources
fi

grep -q ametzler $sources

if [ $? -ne 0 ]
then
	cat << __END__ >> $sources
### Andreas Metzler's Exim v4 packages, backported from sid 
deb http://www.logic.univie.ac.at/~ametzler/debian/exim4manpages/ woody/
deb http://www.logic.univie.ac.at/~ametzler/debian/gnutls/ woody/
__END__
fi

apt-get update

set -e

dpkg --set-selections << __END_SELECTIONS__
fakeroot  		install
debconf-utils		install
html2text		install
debhelper		install
libdigest-hmac-perl	install
libdigest-md5-perl	install
libdigest-sha1-perl	install
libnet-perl		install
liburi-perl		install
libmime-base64-perl	install
libmailtools-perl	install
libtime-hires-perl	install
libtimedate-perl	install
libhtml-parser-perl	install
libhtml-tagset-perl	install
libssl-dev		install
libnet-dns-perl		install
libtest-simple-perl 	install
exim			purge
exim4		 	install
exim4-base	 	install
exim4-config	 	install
exim4-daemon-light 	install
libgnutls10		install
libasn1			install
libgnutls7		install
libgcrypt1		install
libgcrypt7		install
liblzo1			install
libpth14		install
libopencdk4		install
libopencdk8		install
libtasn1-0		install
libtasn1-2		install
__END_SELECTIONS__


apt-get -y dselect-upgrade 


while read package
do
apt-get source $package
pushd ${package}-*
fakeroot debian/rules binary
popd
dpkg -i ${package}*.deb
done << __END__ 
libdigest-nilsimsa-perl
razor
__END__

apt-get source spamassassin

pushd spamassassin*
fakeroot debian/rules binary
popd

dpkg -i spamc*.deb
dpkg -i spamassassin*.deb

apt-get source sa-exim

pushd sa-exim-*/debian

cat << __END__ > control
Source: sa-exim
Section: mail
Priority: optional
Maintainer: Sander Smeenk <ssmeenk at debian.org>
Build-Depends: lynx, debhelper (>= 4.1.16)
Standards-Version: 3.5.10

Package: sa-exim
Architecture: any
Depends: exim4-daemon-light (>>4.30-1) | exim4-daemon-heavy (>>4.30-1) | exim4-daemon-custom (>>4.30-1), spamc | spamassassin (<<2.30-2), ${shlibs:Depends}, debconf (>= 1.0.0)
Description: Use spamAssassin at SMTP time with the Exim v4 MTA
 SA-Exim lets you use spamAssassin at SMTP time with the Exim
 v4 MTA, which enables you to do many things with incoming Emails,
 including refusing them before they come in, or even teergrubing the
 sender (i.e. slowing him down, by tying his resources)
 .
 Homepage: http://marc.merlins.org/linux/exim/sa.html
__END__

popd

pushd sa-exim*
fakeroot debian/rules binary
popd

dpkg -i sa-exim*.deb


cat << __END__ > /etc/default/spamassassin 
# /etc/default/spamd.conf
# Duncan Findlay

# WARNING read README.spamd before using.  THERE ARE SECURITY RISKS!

# Change to one to enable spamd
ENABLED=1

# Options
# See man spamd for possible options. The -d option is automatically added.
OPTIONS="-c -m 10 -a -H"

# Set nice level of spamd
#NICE="--nicelevel 15"
__END__

/etc/init.d/spamassassin restart

perl -pi~ -e 's/^SAEximRunCond: 0/SAEximRunCond: 1/' /etc/exim4/sa-exim.conf

echo "Run dpkg-reconfigure exim4-config and use small config files"
echo "Then reload exim4 with the following command"
echo "/etc/init.d/exim4 reload"



-- 
Brian Lavender
http://www.brie.com/brian/


More information about the vox-tech mailing list