[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: courier-mta + amavisd-new + spamassassin



On Saturday 20 November 2004 14:56, Horst Bursik wrote:
> hi,
>
> Does anybody have experiences with courier-mta + amavisd-new +
> spamassassin?
>
> Amavisd-new works great with postfix and sendmail but the last time i
> tried to use amavisd-new in combination with courier it was nearly
> impossible. With a lot of hacks in the amavis-code i accomplished
> what i wanted but it's far away from a clean setup and most
> important: i could only use parts of the full amavis functionality.
>
> This was half a year ago and hopefully there had been some
> improvements in either amavis or courier, or someone with more
> perl-experience than I found a solution?
>
> I couldn't find anything useful in the web so I'm trying it here. If
> anyone can give me some tips i would be very grateful.
>
> tia,
> horst

I made some notes for myself last time I installed the combo you 
mention. Maybe you can use some of it, maybe you can't. The patch I 
refer to is a slightly edited version of the courier patch that is 
included in the amavisd-new Debian package. I had to slighty adjust the 
pacth here and there - otherwise it would not apply cleanly (maybe this 
has changed since I did my install?).

I hope to have gotten everything written down, but I haven't yet 
followed/verified my written down instructions myself yet, so there may 
in fact be bits of pieces missing in this 'recipe'. Anyhow, here goes:


# Install amavisd-new with all dependencies
sudo apt-get install amavisd-new
update-rc.d -f amavis remove
update-rc.d amavis defaults 21 21

# Now fetch sources, courier patch, and rebuild
sudo apt-get source amavisd-new
sudo apt-get build-dep amavisd-new
chown -R frederik:frederik amavisd-new*  (as root)
cd amavisd-new-20030616p10
cp debian/etc/amavisd.conf .
wget \
http://sentinel.dk/linux/debian/patches/amavisd-new-courier-debian.patch
cat amavisd-new-courier-debian.patch | patch -p0
cp amavisd.conf debian/etc/amavisd.conf
dpkg-buildpackage -rfakeroot -us -uc

# Install new patched package to replace the unpatched one
sudo dpkg -i amavisd-new_20030616p10-3_all.deb

## Configuration notes
# Run amavisd-new via manual start/stop (and not via courierfilter).

# In amavisd.conf:
$mydomain = 'sentinel.dk';
$daemon_user  = 'amavis';
$daemon_group = 'daemon';
$pid_file  = "/var/run/amavis/amavisd.pid";
$lock_file = "/var/run/amavis/amavisd.lock";
$forward_method = undef;
$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -f \
 ${sender} -- ${recipient}';
$unix_socketname = "/var/lib/courier/allfilters/amavisd";
$unix_socket_protocol = 'courier';

# Set various file ownership and permissions.
touch /var/log/amavis.log
chown amavis:daemon /var/log/amavis.log
chmod 640 /var/log/amavis.log

chown -R amavis:daemon /var/lib/amavis
find /var/lib/amavis -type d -exec chmod 750 {} \;
find /var/lib/amavis -type f -exec chmod 640 {} \;

# Activate amavisd-new as a filter through courierfilter/filterctl.
ln -sf /usr/sbin/amavisd-new /usr/lib/courier/filters/amavisd
chmod 755 /var/lib/courier/allfilters

# Ensure that /etc/courier/enablefiltering exists and contains "esmtp".
# This is default for Debian installations, btw.

# Restart amavisd-new
/etc/init.d/amavis restart

# If clamav is not already member of secondary groups daemon and
# amavis, add it manually and restart clamav for changes to take effect.
adduser clamav daemon
adduser clamav amavis
/etc/init.d/clamav-daemon restart


SpamAssassin notes at: 
http://www.sentinel.dk/cookbook/?SpamAssassin_with_Courier

B/R,
-- 
Frederik Dannemare | mailto:frederik@dannemare.net
http://qa.debian.org/developer.php?login=Frederik+Dannemare
http://frederik.dannemare.net | http://www.linuxworlddomination.dk



Reply to: