[SA-exim] script for installing SA-Exim on Debian stable

Brian Lavender brian at brie.com
Tue Jun 15 22:23:08 PDT 2004


Here's a hack I came up with to get SA-Exim on Debian stable. It's
definitely a hack, but with a base Debian system, it will get you
SA-Exim up and running. It will configure the sources list for deb 
packages from Metzler's site plus add the deb-src for the source
packages that need to be grabbed, build them and then install them. 

brian


#!/bin/bash

# Tue Jun 15 19:58:47 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

dpkg --set-selections << __END_SELECTIONS__
adduser						install
apt						install
apt-utils					install
at						install
autoconf					install
autoconf2.13					install
automake					install
autoproject					install
autotools-dev					install
base-config					install
base-files					install
base-passwd					install
bash						install
bc						install
biff						install
bin86						install
bind9-host					install
binutils					install
bison						install
blt						install
blt-common					install
blt-dev						install
bonobo						install
bsdgames					install
bsdmainutils					install
bsdutils					install
c2man						install
cflow						install
console-common					install
console-data					install
console-tools					install
console-tools-libs				install
cpio						install
cpp						install
cpp-2.95					install
cpp-3.0						install
cron						install
cutils						install
cvs						install
cxref						install
dc						install
ddd						install
debconf						install
debconf-utils					install
debhelper					install
debianutils					install
defoma						install
dh-make						install
dh-make-perl					install
dhcp-client					install
dialog						install
diff						install
dnsutils					install
doc-debian					install
doc-linux-text					install
dpkg						install
dpkg-dev					install
e2fsprogs					install
ed						install
emacs20						install
emacsen-common					install
esound-clients					install
esound-common					install
exim4						install
exim4-base					install
exim4-config					install
exim4-daemon-light				install
fakeroot					install
fdutils						install
file						install
fileutils					install
findutils					install
finger						install
fingerd						install
flex						install
ftnchek						install
ftp						install
ftpd						install
fweb						install
g++						install
g++-2.95					install
g77						install
g77-2.95					install
gadfly						install
gcc						install
gcc-2.95					install
gcc-3.0						install
gcc-3.0-base					install
gconf						install
gdb						install
gdk-imlib1					install
gettext						install
gettext-base					install
gettext-el					install
gimp-python					install
gimpprint-locales				install
glibc-doc					install
gnome-bin					install
gnome-libs-data					install
gnupg						install
gnupg-doc					install
gnutls3						install
grep						install
groff-base					install
gs						install
gs-common					install
gsfonts						install
gsfonts-x11					install
gzip						install
hostname					install
html2text					install
htmlgen						install
iamerican					install
ibritish					install
iconx						install
idle						install
idle-python2.1					install
ifupdown					install
imlib-base					install
indent						install
info						install
ipchains					install
ipmasqadm					install
iptables					install
ispell						install
itcl3.1						install
itcl3.1-dev					install
itk3.1						install
itk3.1-dev					install
klogd						install
less						install
lesstif1					install
libart2						install
libaudiofile0					install
libbonobo2					install
libc6						install
libc6-dev					install
libcap1						install
libcapplet0					install
libdb2						install
libdb3						install
libdigest-hmac-perl				install
libdigest-md2-perl				install
libdigest-md4-perl				install
libdigest-md5-perl				install
libdigest-nilsimsa-perl				install
libdigest-perl					install
libdigest-sha1-perl				install
libdns5						install
libdps1						install
libefs1						install
libesd0						install
libexpat1					install
libfreetype6					install
libgal-data					install
libgal19					install
libgcc1						install
libgconf11					install
libgcrypt1					install
libgcrypt7					install
libgdbmg1					install
libgdk-pixbuf-gnome2				install
libgdk-pixbuf2					install
libgimp1.2					install
libgimpprint1					install
libglade-gnome0					install
libglade0					install
libglib1.2					install
libgmp3						install
libgnome32					install
libgnomeprint-bin				install
libgnomeprint-data				install
libgnomeprint15					install
libgnomesupport0				install
libgnomeui32					install
libgnorba27					install
libgnorbagtk0					install
libgnutls10					install
libgnutls5					install
libgnutls7					install
libgpg-error0					install
libgtk1.2					install
libgtk1.2-common				install
libgtkhtml20					install
libgtkxmhtml1					install
libhtml-format-perl				install
libhtml-parser-perl				install
libhtml-tagset-perl				install
libhtml-tree-perl				install
libident					install
libisc4						install
libjpeg62					install
libldap2					install
liblockfile1					install
libltdl3					install
libltdl3-dev					install
liblwres1					install
liblzo1						install
libmailtools-perl				install
libmime-base64-perl				install
libncurses5					install
libnet-dns-perl					install
libnet-perl					install
libnet-ph-perl					install
libnet-snpp-perl				install
libnet-telnet-perl				install
libnewt0					install
libnss-db					install
liboaf0						install
libopencdk4					install
libopencdk8					install
liborbit0					install
libpam-modules					install
libpam-runtime					install
libpam0g					install
libpanel-applet0				install
libpaperg					install
libpcap0					install
libpcre3					install
libperl5.6					install
libpgsql2					install
libpng2						install
libpopt0					install
libpth14					install
libreadline4					install
libsane						install
libsasl7					install
libssl-dev					install
libssl0.9.6					install
libstdc++2.10-dev				install
libstdc++2.10-glibc2.2				install
libstdc++3					install
libtasn1-0					install
libtasn1-2					install
libtest-cmd-perl				install
libtest-simple-perl				install
libtiff3g					install
libtime-hires-perl				install
libtime-modules-perl				install
libtimedate-perl				install
libtool						install
libungif4g					install
liburi-perl					install
libusb-0.1-4					install
libwrap0					install
libwww-perl					install
libxaw6						install
libxaw7						install
libxml1						install
libzvt2						install
lilo						install
liwc						install
locales						install
login						install
logrotate					install
lpr						install
lsof						install
ltrace						install
lynx						install
m4						install
mailx						install
make						install
makedev						install
man-db						install
manpages					install
manpages-dev					install
mawk						install
mbr						install
mime-support					install
modconf						install
modutils					install
mount						install
mpack						install
mtools						install
mtr						deinstall
mtr-tiny					install
mutt						install
nano						install
ncurses-base					install
ncurses-bin					install
ncurses-term					install
net-tools					install
netbase						install
netcat						install
netcdfg3					install
nethack						install
nethack-common					install
nethack-x11					install
netkit-inetd					install
netkit-ping					install
nfs-common					install
nfs-kernel-server				install
nowebm						install
nvi						install
oaf						install
passwd						install
patch						install
pciutils					install
pdksh						install
perl						install
perl-base					install
perl-modules					install
pidentd						install
portmap						install
ppp						install
pppconfig					install
pppoe						install
pppoeconf					install
procps						install
psfontmgr					install
psmisc						install
python						install
python-bobo					install
python-bobopos					install
python-dev					install
python-doc					install
python-egenix-mxdatetime			install
python-examples					install
python-extclass					install
python-gdbm					install
python-gdk-imlib				install
python-gendoc					install
python-glade					install
python-gnome					install
python-gtk					install
python-imaging					install
python-imaging-sane				install
python-imaging-tk				install
python-kjbuckets				install
python-ldap					install
python-mpz					install
python-netcdf					install
python-newt					install
python-numeric					install
python-numeric-tutorial				install
python-pmw					install
python-pygresql					install
python-tk					install
python-xml					install
python2.1					install
python2.1-dev					install
python2.1-doc					install
python2.1-egenix-mxdatetime			install
python2.1-egenix-mxtools			install
python2.1-examples				install
python2.1-gdbm					install
python2.1-imaging				install
python2.1-imaging-sane				install
python2.1-imaging-tk				install
python2.1-kjbuckets				install
python2.1-mpz					install
python2.1-numeric				install
python2.1-tk					install
python2.1-xml					install
python2.1-xmlbase				install
razor						install
rcs						install
reportbug					install
sa-exim						install
screen						install
sed						install
setserial					install
sharutils					install
shellutils					install
slang1						install
slatec						install
spamassassin					install
spamc						install
ssh						install
stl-manual					install
strace						install
sysklogd					install
syslinux					install
sysvinit					install
t1lib1						install
talk						install
talkd						install
tar						install
tasksel						install
tcl8.3						install
tcl8.3-dev					install
tcpd						install
tcsh						install
telnet						install
telnetd						install
texinfo						install
textutils					install
time						install
tix41						install
tk8.3						install
tk8.3-dev					install
tktable						install
tktable-dev					install
traceroute					install
urlview						install
util-linux					install
util-linux-locales				install
vacation					install
wenglish					install
whiptail					install
whois						install
xbase-clients					install
xfree86-common					install
xlibmesa3					install
xlibs						install
xlibs-dev					install
xpdf						install
xpdf-common					install
xpdf-reader					install
xpdf-utils					install
xutils						install
ytalk						install
zlib1g						install
zsh						install
__END_SELECTIONS__

apt-get dselect-upgrade << __END__
y
__END__

while read foo
do
apt-get source $foo
done << __END__ 
libdigest-nilsimsa-perl
razor
sa-exim
spamassassin
__END__

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

while read foo
do
pushd ${foo}-*
fakeroot debian/rules binary
popd
done << __END__
libdigest-nilsimsa-perl
razor
sa-exim
spamassassin
__END__

# Now install the new Debian package versions.

while read package
do
dpkg -i $package
done << __END__
libdigest-nilsimsa-perl_*.deb
razor_*.deb
sa-exim_*.deb
spamassassin_*.deb
spamc_*.deb
__END__

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 SA-Exim mailing list