Intro
This system is based on Debian testing as at 26-Oct-2004 and utilises postfix,amavis-new, clamav and spamassassin to create a smtp server that accepts mail for a specific fomain from the internet filters and virus checks the mail and passes it on to *some other* server inside a network.
The server has a static ip address of 192.168.0.2 and can see the internet via a netgear router that is configured to forward any smtp traffic into 192.168.0.2. The internal mail server is 192.168.0.20 for user pop3 accessPostfix
amavisd-new
To install :-
apt-get install amavisd-newThe configuration of amavisd is more complex and requires adjustments to postfix as well. Firstly it is necessary to add in the content_filter line to /etc/postfix/main.cf. Then the /etc/postfix/master.cf should be configured to call amavisd.
/etc/postfix/master.cf should have these lines added :-
smtp-amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_looks=yes
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restrictions_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetwork=127.0.0.0/8
-o strict_rfc821_envelopes=yes
ClamAV
ClamAV is my prefered (open source) antivirus option and i installed the clamd version (daemon)
apt-get install clamav-daemonIn the questions i selected to use the daemon mode of freshclam as well to keep the virus definitions upto date. The amavisd config file seemed to have clamav options already enabled so it was (almost) ready to use out of the box for me:-) this is what i found in /etc/amavis/amavisd.conf:- (i did have to adjust the path for clamd.ctl, it is shown below)
### http://www.clamav.net/
['Clam Antivirus-clamd',
\&ask_daemon, ["CONTSCAN \n", "/var/run/amavis/clamd.ctl"],
qr/\bOK$/, qr/\bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
# NOTE: run clamd under the same user as amavisd; match the socket
# name (LocalSocket) in clamav.conf to the socket name in this entry
# When running chrooted one may prefer: ["CONTSCAN \n","$MYHOME/clamd"],
There was one issue with access to ClamAV from amavis, to solve this I made clamav run as user amavis and had the contrl file inside alavis' home directory by changing the following two options in /etc/clamav/clamav.conf
LocalSocket /var/run/amavis/clamd.ctl
User amavis
Spamassassin
Spamassassin support is also native to amavisd-new but you still need the spamassassin packages
apt-get spamassassinshould do it. can't remember exatly what i did left notes at work!, tomorrow maybe :-)
Previous page: X509-Cert-Generation
Next page: IPSEC-VPN-Server-HowTo
