I am running postfix postfix-3.3.1_1,1 and clamav-milter clamav-milter-0.100.1_1 on FreeBSD 11.2. Postfix and the milter are set to communicate via a socket. I am not able to get the milter and postfix work together, I must be overlooking something.
In my maillog I get these messages:
xSep 21 11:33:57 mail2 postfix/smtpd[85759]: warning: connect to Milter service unix:/var/run/clamav/clmilter.sock: Permission denied
Postfix runs as user:group postfix:postfix. Clamav runs as clamav:clamav. (When I run clamav as postfix:postfix, the problem still persists.) User postfix is also member of the clamav group.
The permissions on the socket itself are:
srwxrwxrwx 1 clamav clamav 0B Sep 21 11:46:26 2018 /var/run/clamav/clmilter.sock
In clamav-milter.conf I run default values, changing the user to postfix did not work:
MilterSocket unix:/var/run/clamav/clmilter.sock
# MilterSocket unix:/var/spool/postfix/var/run/clamav/clmilter.sock
# MilterSocket inet:8890
# ClamdSocket unix:/var/run/clamav/clmilter.sock
#MilterSocket inet:7357
# Define the group ownership for the (unix) milter socket.
# Default: disabled (the primary group of the user running clamd)
#MilterSocketGroup postfix
# Sets the permissions on the (unix) milter socket to the specified mode.
# Default: disabled (obey umask)
#MilterSocketMode 660
# Remove stale socket after unclean shutdown.
#
# Default: yes
FixStaleSocket yes
# Run as another user (clamav-milter must be started by root for this option to work)
#
# Default: unset (don't drop privileges)
User postfix
In rc.conf
clamav_milter_enable="YES"
clamav_milter_socket="/var/run/clamav/clmilter.sock"
clamav_milter_socket_user="postfix"
clamav_milter_socket_group="postfix"
In main.cf of postfix it is also quite standard:
smtpd_milters = unix:/var/run/clamav/clmilter.sock inet:127.0.0.1:8891