There are a lot of packages required for this setup. Here are the main ones:
- Postfix - Mail Transfer Agent (MTA)
- clamav - Free antivirus for email scanning
- spamassassin - Spam blocking
- Amavisd-new - The glue that sticks Postfix and scanning apps together.
- MySQL - All user accounts and scan settings will be saved here.
- Dovecot - Local Delivery Agent (LDA), pop3 and imap daemon. Handles everything to do with each individual mail folder.
I installed Amavisd-new from source. There are some packages I just prefer the vanilla flavour of and this howto assumes a vanilla installation. If you go with the distro release, you'll need to use your distro file paths for anything amavis. You can get the vanilla release from http://www.ijs.si/software/amavisd/#download (This guide assumes version 2.6.4).
You can use the following commands to install all the packages required for this guide.
Web Packages
I have listed these because I used them for Roundcube Webmail and phpMyAdmin (which makes performing any MySQL operations a lot simpler). Both Roundcube Webmail and phpMyAdmin I install from original source into the restricted document root directory for their corresponding virtual host.
# apt-get install apache2-mpm-worker apache2-doc apache2-utils apache2-suexec
# apt-get install php5 php5-cgi php5-common php5-curl php5-gd php5-mysql php5-pspell php5-snmp php5-sqlite php5-tidy php5-xsl \ php5-intl php5-imagick php5-imap php5-mcrypt php5-memcache php5-memcached php5-sasl
# apt-get install pure-ftpd-mysql
# apt-get install aspell aspell-doc aspell-en aspell-tl
MySQL
# apt-get install mysql-client mysql-server
set mysql root password
Email Packages
# apt-get install postfix postfix-mysql postfix-doc
# apt-get install dovecot-common dovecot-imapd dovecot-pop3d
# apt-get install clamav
# apt-get install spamassassin pyzor razor
Amavisd-new
These packages are required for amavisd-new to decode email attachments and other things. Say yes to all dependencies.
# apt-get install gzip bzip2 arc cpio lha arj rar unrar zoo pax lzop freeze ripole tnef cabextract libcrypt-openssl-rsa-perl \ libconvert-tnef-perl libio-stringy-perl libarchive-zip-perl libmime-tools-perl libnet-cidr-perl libnet-server-perl \ libcompress-raw-zlib-perl libmail-dkim-perl libconvert-uulib-perl libberkeleydb-perl libio-multiplex-perl \ libconvert-binhex-perl libunix-syslog-perl libcrypt-openssl-bignum-perl libio-socket-ssl-perl p7zip p7zip-full rpm2cpio
Install amavisd-new following http://www.ijs.si/software/amavisd/INSTALL.txt

