Skip to content. | Skip to navigation

Navigation

Personal tools

Mail Applications

Building a mail system

AMaViS

A Mail Virus Scanner

AMaViS does stuff! What more can you say?

In this case you are looking for the daemon version of AMaViS (not the standalone version which requires all sorts of things you can't get anymore).

Building and Installing

First of all you need to install all of the required Perl modules -- of which there are many listed in the README file. Get going!

Note

You may have to explicitly find Unix-syslog-0.100.tar.gz. The chances are that you''ll be trying to install Unix-syslog-0.99.tar.gz using CPAN. The problem lies in that Perl and the author of the module disagree on how to write version numbers for code.

cd .../amavisd-new-2.3.3
mkdir /usr/local/${PWD##*/}

Create the user/group first and any useful directories.

Note

We give the AMaViS user a home directory as SpamAssassin will be writing its knowledgebase in there.

su
groupadd amavis
useradd -g amavis -d /var/amavis -m amavis
passwd -l amavis

mkdir /var/amavis /var/amavis/tmp /var/amavis/var /var/amavis/db /var/amavis/home
chown -R amavis:amavis /var/amavis
chmod -R 750 /var/amavis

Copy the AMaViS damon code into /usr/local twizzling the #! line as we go to pick up our version of Perl (you may not want to do that):

sed -e '1s!bin!local/bin!' amavisd > /usr/local/${PWD##*/}/amavisd
chown root /usr/local/${PWD##*/}/amavisd
chmod 755 /usr/local/${PWD##*/}/amavisd

cp amavisd.conf /usr/local/${PWD##*/}
chown root /usr/local/${PWD##*/}/amavisd.conf
chmod 644  /usr/local/${PWD##*/}/amavisd.conf

mkdir /var/virusmails
chown amavis:amavis /var/virusmails
chmod 750 /var/virusmails

Configuration

Edit amavisd.conf probably just changing:

  1. user/group to amavis
  2. $mydomain to your default domain. All of SpamAssassin's remarks will be emailed to the aliases we set up when installing Postfix earlier.

Startup

Note

SMF!

cat <<EOF > /etc/init.d/amavis
#! /sbin/sh

AMAVIS_USER=amavis
AMAVIS_TOP=/usr/local/${PWD##*/}

# need to pick up the correct perl
PATH=/usr/local/bin:\$PATH

case "\$1" in
start)
       \${AMAVIS_TOP}/amavisd -c \${AMAVIS_TOP}/amavisd.conf
       ;;
stop)
       /usr/bin/pkill -x -u \${AMAVIS_USER} amavisd
       ;;
reload)
       \${AMAVIS_TOP}/amavisd -c \${AMAVIS_TOP}/amavisd.conf reload
       ;;
esac
EOF
chmod a+x /etc/init.d/amavis

Post-Install

It's only now that you can find out what else AMaViS thinks you are missing (no, really, it's documented like this). You need to run AMaViS and see what it whinges about:

/usr/local/${PWD##*/}/amavisd -c /usr/local/${PWD##*/}/amavisd.conf -u amavis debug

Note

AMaViS can be quite cryptic when complaining about the config file being missing. The upshot is to give an absolute pathname to it.

In this case, we are short of the following two Perl modules:

  1. Mail::Field
  2. Net::Server

Finally, when it does run check the output to see that it has found ClamAV. It'll report something like Found secondary av scanner ClamAV-clamscan.

Document Actions