Amavis without clamd

Hi all,

i am running a fedora (31) mailserver with amavis and spamassassin. For some time now amavis installs also clamav and a clamd@amavisd service.

=============================================================================================================================================================================================================
 Package                                                 Architecture                               Version                                                Repository                                   Size
=============================================================================================================================================================================================================
Installing:
 amavis                                                  noarch                                     2.12.0-5.fc31                                          fedora                                      363 k
Installing dependencies:
 clamav-data                                             noarch                                     0.101.5-1.fc31                                         updates                                     164 M
 clamav-filesystem                                       noarch                                     0.101.5-1.fc31                                         updates                                      14 k
 clamav-lib                                              x86_64                                     0.101.5-1.fc31                                         updates                                     811 k
 perl-Archive-Zip                                        noarch                                     1.67-1.fc31                                            updates                                     107 k
 perl-Convert-UUlib                                      x86_64                                     2:1.6-1.fc31                                           updates                                     221 k
 altermime                                               x86_64                                     0.3.10-21.fc31                                         fedora                                       65 k
 libidn                                                  x86_64                                     1.35-6.fc31                                            fedora                                      240 k
 perl-Authen-SASL                                        noarch                                     2.16-18.fc31                                           fedora                                       52 k
 perl-BerkeleyDB                                         x86_64                                     0.63-2.fc31                                            fedora                                      147 k
 perl-Convert-ASN1                                       noarch                                     0.27-15.fc31                                           fedora                                       55 k
 perl-Convert-BinHex                                     noarch                                     1.125-12.fc31                                          fedora                                       45 k
 perl-Convert-TNEF                                       noarch                                     0.18-16.fc31                                           fedora                                       22 k
 perl-Digest-SHA1                                        x86_64                                     2.13-28.fc31                                           fedora                                       54 k
 perl-File-LibMagic                                      x86_64                                     1.16-8.fc31                                            fedora                                       41 k
 perl-GSSAPI                                             x86_64                                     0.28-28.fc31                                           fedora                                       60 k
 perl-IO-Multiplex                                       noarch                                     1.16-14.fc31                                           fedora                                       26 k
 perl-IO-stringy                                         noarch                                     2.111-14.fc31                                          fedora                                       67 k
 perl-JSON                                               noarch                                     4.02-3.fc31                                            fedora                                       97 k
 perl-MIME-tools                                         noarch                                     5.509-8.fc31                                           fedora                                      239 k
 perl-Net-LibIDN                                         x86_64                                     0.12-35.fc31                                           fedora                                       31 k
 perl-Net-Server                                         noarch                                     2.009-6.fc31                                           fedora                                      204 k
 perl-Text-Soundex                                       x86_64                                     3.05-14.fc31                                           fedora                                       30 k
 perl-Text-Unidecode                                     noarch                                     1.30-10.fc31                                           fedora                                      141 k
 perl-Unix-Syslog                                        x86_64                                     1.1-34.fc31                                            fedora                                       31 k
Installing weak dependencies:
 clamd                                                   x86_64                                     0.101.5-1.fc31                                         updates                                     109 k
 arj                                                     x86_64                                     3.10.22-31.fc31                                        fedora                                      187 k
 cabextract                                              x86_64                                     1.9-3.fc31                                             fedora                                       50 k
 freeze                                                  x86_64                                     2.5.0-27.fc31                                          fedora                                       36 k
 lzop                                                    x86_64                                     1.04-2.fc31                                            fedora                                       59 k
 nomarch                                                 x86_64                                     1.4-22.fc31                                            fedora                                       25 k
 p7zip                                                   x86_64                                     16.02-15.fc31                                          fedora                                      689 k
 p7zip-plugins                                           x86_64                                     16.02-15.fc31                                          fedora                                      1.0 M
 pax                                                     x86_64                                     3.4-32.fc31                                            fedora                                       79 k
 perl-DBD-SQLite                                         x86_64                                     1.64-1.fc31                                            fedora                                      195 k
 perl-LDAP                                               noarch                                     1:0.66-4.fc31                                          fedora                                      367 k
 unzoo                                                   x86_64                                     4.4-25.fc31                                            fedora                                       28 k

Transaction Summary
=============================================================================================================================================================================================================
Install  37 Packages
â—Ź clamd@amavisd.service - clamd scanner (amavisd) daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd@.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-12-09 11:33:59 CET; 18min ago
     Docs: man:clamd(8)
           man:clamd.conf(5)
           https://www.clamav.net/documents/
 Main PID: 1458 (clamd)
    Tasks: 2 (limit: 2351)
   Memory: 0B
      CPU: 52.672s
   CGroup: /system.slice/system-clamd.slice/clamd@amavisd.service
           └─1458 /usr/sbin/clamd -c /etc/clamd.d/amavisd.conf

The service is disabled but however it starts automatically after a reboot. Do you know a way how to disable the service without getting problems after an update?

Best regards,
Paul

Hi,

I’ve not used Amavis mail server before, but familiar with exim on cpanel servers and can advise spamassassin uses clamd to scan for viruses on incoming and outgoing (probably). This is now the default behavior, but can be disabled; but I wouldn’t recommend this unless clamd is proving to resource intensive.

I suspect that amavis is calling the clamd service, disabled just means the service won’t start on boot.
From a quick google it looks like this can be disabled by adding the following to amavis.conf:

bypass_virus_checks_maps => [1]

If clamd is still getting started you can mask it:

systemctl mask clamd@amavisd.service

Thanks Tom.

1 Like

Hi @p7k! Welcome to Fedora. Please take a look at the posts in #start-here if you’ve not had a chance yet.

I see that clamav-server-systemd is a “weak dependency”:

https://src.fedoraproject.org/rpms/amavis/blob/master/f/amavis.spec#_20

This means that it isnt necessary, but may be required by amavis. More on weak dependencies here:

By default, dnf installs these weak dependencies so that users don’t have to install them manually. To get it to not install these in a transaction, you can add this to the dnf command: --setopt=install_weak_deps=False

So,

sudo dnf install amavis --setopt=install_weak_deps=False

should not pull in the weak deps.

1 Like

Thank you very much! That was exactly what I was looking for. Nice to see that the Ansible dnf module also supports this option.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.