Today i will show you how to install Sophos AV with Postfix. I assume that Postfix is already configured.
First of all we will install AMaViS.
apt-get install amavis
Installation Sophos AV on Linux
- We will download the installer on the website of Sophos first
- In the next step we need to copy the installer to our server
scp <path-to.tgz> <user>@<server>:
- Connect to the server and change to the root user
server>server# sudo su -
- With the tar comment we uncompress the installer in /tmp
server# cd /tmp
server# tar -xvfz <path-to>.tgz
- Now we start the installation
server# cd /tmp/sophos-av
- Press <enter> and <space> to scroll through the terms and conditions. Press ‘Y’ to confirm.
- Install Sophos AV in the default location
Where do you want to install Sophos Anti-Virus? [/opt/sophos-av]
- On the next step we will choose the running mode.
On-Access: Scan runs in daemon mode. This mode needs more memory but scanning files faster.
OnDemand: It use Sophos AV only when the file pushed to the scanner.
I have choosen on-demand.
Do you want to enable on-access scanning? Yes(Y)/No(N) [Y] n
- Select the update server
Which type of auto-updating do you want? From Sophos(s)/From own server(o)/None(n) [s]
- Choose ‘f’ for the free sophos version (without support)
Do you wish to install the Free (f) or Supported (s) version of SAV for Linux? [s] f
- If you are using an proxy server enter this in the next step.
Do you need a proxy to access Sophos updates? Yes(Y)/No(N) [N]
- Now the installation is finished.
Connect postfix and AMaViS
- Edit postfix main.cf
- Add the content filter
content_filter = smtp-amavis:[127.0.0.1]:10024
- For Postfix to receive the mail from AMaViS again, two services must be defined in master.cf.
smtp-amavis unix - - n - 2 smtp
127.0.0.1:10025 inet n - n - - smtpd
Connect AMaViS with Sophos
- In the AMaViS configuration we will configure the scanner
- Search for parameter av_scanners_backup
- In the array you will find Sophos Anti Virus (sweep)
- Comment the entry with #
- Copy the entry
- Paste the entry in the av_scanners parameter
- Uncomment the lines here
- Now AMaViS is connected with Sophos AV
Activate AV-Scans in AMaViS
- AMaViS needs to configure for virus scans
- So we will edit the file /etc/amavis/conf.d/15-content_filter_mode and uncomment the following files
-#@bypass_virus_checks_maps = (
-# \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
+@bypass_virus_checks_maps = (
+ \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
systemctl restart postfix systemctl restart amavis