Just in case anyone else runs into this on Centos7 OpenVZ
Seems the default install does not work at least on the OP one which we finally got working.
If you get this message but are not seeing the email in the inbox and permissions and everything else is right:
delivered via spamassassin service)
Open config file and change the below line
nano /etc/postfix/master.cf
From:
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
To:
spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
If this is on Ubuntu and your getting that error the line might need to be using the Ubuntu lib path of /usr/lib/dovecot/deliver
spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
service dovecot restart && service postfix restart && service spamassassin restart;
service dovecot status && service postfix status && service spamassassin status;
Hopefully, that fixes the issue.
Optional things that might be needed that we did try during debugging.
If you get this error:
spamc[7957]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
Disable IPv6:
Append below lines in /etc/sysctl.conf:
nano /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
To make the settings affective, execute :
sysctl -p
Add missing spamd user:
groupadd spamd
useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
chown spamd:spamd /var/log/spamassassin
service spamassassin restart
Create this file with the below value to ensure spamd listening on localhost
[root@srv ~]# cat /etc/mail/spamassassin/spamc.conf
-d 127.0.0.1
[root@srv ~]#