Clamav / EXIM On CentOS 7

Home » CentOS » Clamav / EXIM On CentOS 7
CentOS 4 Comments

Me again,

I’m still building my new mail server and I’m struggling getting clamav and exim to talk to each other.

I’ve installed:

clamav-server-0.98.7-1.el7.x86_64
clamav-lib-0.98.7-1.el7.x86_64
clamav-0.98.7-1.el7.x86_64
clamav-milter-0.98.7-1.el7.x86_64
clamav-data-0.98.7-1.el7.noarch clamav-update-0.98.7-1.el7.x86_64
clamav-milter-systemd-0.98.7-1.el7.noarch clamav-filesystem-0.98.7-1.el7.noarch exim-mon-4.84-4.el7.x86_64
exim-4.84-4.el7.x86_64
exim-greylist-4.84-4.el7.x86_64
exim-pgsql-4.84-4.el7.x86_64
spamassassin-3.4.0-1.el7.x86_64

I configured EXIM and Spamassassin. I started the services

exim spamassassin clamav-milter

In EXIM I configured

av_scanner = clamd:/var/run/clamd.exim/clamd.sock spamd_address = 127.0.0.1 783

However when I tried to send a test email it failed saying

2015-08-24 22:45:13 1ZTzY6-0002f1-OL malware acl condition: clamd: unable to connect to UNIX socket (/var/run/clamd.exim/clamd.sock): No such file or directory
2015-08-24 22:45:13 1ZTzY6-0002f1-OL H

4 thoughts on - Clamav / EXIM On CentOS 7

  • If you try to locate that file, do you find it somewhere?
    When you list services (units) and grep with clamav, do you find some?

  • [root@ollie2 ~]# find / -iname clamd.sock
    [root@ollie2 ~]# systemctl list-unit-files –type=service
    […..]
    clamav-milter.service enabled exim.service enabled spamassassin.service enabled
    […..]
    [root@ollie2 ~]# ps ax|grep cla[m]
    [root@ollie2 ~]#

    Starting / restarting the clamav service does not generate any errors but the process doesn’t run

    Looking at the unit file

    /etc/systemd/system/multi-user.target.wants/clamav-milter.service

    it is expecting a config file of

    /etc/mail/clamav-milter.conf

    so I’ve edited that file to comment out the ‘example’ line. In here it defines the socket as

    /var/run/clamav-milter/clamav-milter.socket

    However, after saving this file the service still fails to start and the socket still doesn’t exist

  • Does the directory /var/run/clamav-milter/ exist and is it traversable and writable by the clamav user is running as?
    Socket creation mostly doesnt include recursive operation (creating the directory)

  • It looks like I’m barking up the wrong tree here. When I run the command in the terminal I get

    [root@ollie2
    clamav-milter]# /usr/sbin/clamav-milter -c /etc/mail/clamav-milter.conf –nofork=yes ERROR: No ClamdSocket specified ERROR: Failed to init the socket pool
    [root@ollie2 clamav-milter]#

    It looks like I don’t need clamav-milter as it seems to be wanting access to the clamd socket in exactly the same way as EXIM, i.e., EXIM wants to talk directly to clamd and not clamav-milter. The latter seems to be an interface for sendmail.

    I’m now looking at getting the clamd service running. I installed

    clamav-server-sysvinit-0.98.7-1.el7.noarch clamav-server-systemd-0.98.7-1.el7.noarch

    which I expected to give the the systemd unit file as well as the old init scripts. However I can’t see either. I also still don’t have a

    /etc/clamd.conf