ClamAV Milter

CentOS 7 – still discovering it. ClamAV & ClamAV Milter related things have changed a bit.

First of all, install what you need

yum install clamav-milter-systemd clamav-scanner-systemd

Then, there’s no configuration file.

cp /usr/share/doc/clamav-server-0.98.4/clamd.conf /etc/clamd.d/clamd.conf

Now edit the file, like so:

# Example
LogSyslog yes
DatabaseDirectory /var/lib/clamav
TCPSocket 3310
User clamscan
AllowSupplementaryGroups yes

Start it with

systemctl restart clamd@clamd.service

Now ClamAV Milter, edit config file /etc/mail/clamav-milter.conf

# Example
MilterSocket inet:8894
User clamilt
AllowSupplementaryGroups yes
ClamdSocket tcp:
LogSyslog yes
OnClean Accept
OnInfected Reject
OnFail Defer

Add the 8894 port to SELinux cnfiguration

semanage port -a -t milter_port_t -p tcp 8894

Then restart ClamAV Milter

systemctl restart clamav-milter

And configure your MTA to use it. In Postfix, edit /etc/postfix/ and to your smtpd_milters line add inet: and restart Postfix.

Don’t forget to install freshclam, to be able to update your antivirus:

yum install clamav-update

Then edit /etc/sysconfig/freshclam and comment the line


In /etc/freshclam.conf comment the line Example

# Example

Now just run once:


One thought on “ClamAV Milter

  1. Bill P. December 4, 2014 at 8:42 am

    2 things I hate:

    1. A blog that makes you fill in a bunch of garbage just to be able to comment.

    2. Making something like this seem easy when it’s not.

    I keep getting the “Please configure the MilterSocket directive” error message even though I’ve done it your way, my way and ten other ways besides. Any other ideas?

Leave a Reply

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box
Name *
Email *