I have a Postfix mail server, using Amavis and Spamassassin to check for unwanted e-mails. I have removed ClamAV because it'd basically freeze the whole server every time someone received an e-mail, and server-side virus-scanning does not seem to important for my use case.

Spamassassin is still triggered by Amavis, and I'd like to keep it that way.
Basically what I want is for Amavis to stop trying to trigger a virusscan for each e-mail.

May 29 07:49:14 robinj amavis[19859]: (19859-01) (!)connect to /tmp/clamd.socket failed, attempt #1: Can't connect to UNIX socket /tmp/clamd.socket: No such file or directory
May 29 07:49:15 robinj amavis[19859]: (19859-01) (!)connect to /tmp/clamd.socket failed, attempt #1: Can't connect to UNIX socket /tmp/clamd.socket: No such file or directory
May 29 07:49:15 robinj amavis[19859]: (19859-01) (!)ClamAV-clamd: All attempts (1) failed connecting to /tmp/clamd.socket, retrying (2)
May 29 07:49:21 robinj amavis[19859]: (19859-01) (!)connect to /tmp/clamd.socket failed, attempt #1: Can't connect to UNIX socket /tmp/clamd.socket: No such file or directory
May 29 07:49:21 robinj amavis[19859]: (19859-01) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /tmp/clamd.socket (All attempts (1) failed connecting to /tmp/clamd.socket) at (eval 139) line 603.\n
May 29 07:49:21 robinj amavis[19859]: (19859-01) (!)WARN: all primary virus scanners failed, considering backups
May 29 07:49:21 robinj amavis[19859]: (19859-01) (!!)AV: ALL VIRUS SCANNERS FAILED

I've tried commenting out several options in /etc/amavis/conf.d/15-av_scanners, but it's starting to look like if I comment something out it'll just use the default config for that which is the same as what was there in the first place.

# ['ClamAV-clamd',
#   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
#   qr/\bOK$/m, qr/\bFOUND$/m,
#   qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],

This is, as you can see, commented out. As a result it simply looks for backup scanners, none of which are present. This, however, still spams the logs with the above messages and delays mail delivery.
Commenting out backup scanners has absolutely no effect on this (in fact when this is commented out it'll still trigger what used to be there if it exists).

How can I configure Amavis to still use Spamassassin, but stop trying to scan every e-mail for virusses?


Solution 1:

Since you want to disable virus checking entirely, the easiest way to do so is find the @bypass_virus_checks_maps line in the Amavis configuration files (amavis.conf or conf.d/50-user) and change it to this;

bypass_virus_checks_maps => [1];

Solution 2:

On Ubuntu you can disable anti-virus checks by commenting out the following two lines in /etc/amavis/conf.d/15-content_filter_mode:

@bypass_virus_checks_maps = (
    \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);

See: https://help.ubuntu.com/community/PostfixAmavisNew