l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
November 4: Social gathering
Next Installfest:
TBD
Latest News:
Oct. 24: LUGOD election season has begun!
Page last updated:
2004 Aug 06 10:18

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Script auto installing SA-Exim on Debian stable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Script auto installing SA-Exim on Debian stable



Hmm, I posted this to vox, but I imagine vox-tech is more appropriate.
It's a script for automatically installing SA-Exim on Debian stable.
It's a great way to combat spam.

brian


#!/bin/bash

# No comments yet, but I pulled out the ten tons of shotgun splatter
# from the last version. I am just wondering about how to get apt to
# automatically follow the dependencies. I had to fish them out and put
# them in my list in order for this to work. Only other way I found was
# to run dselect manually. There must be another way.

# Anyway, use at your own risk. I tested this a few times, but don't come
# crying to me because your mail server is hosed. 

# brian
# Brian E. Lavender
# brian@brie.com


# 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.
#

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@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/
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.