0
I am using Postfix 2.10.1, Spamassassin 5.16.3 on CentOS 7.
PROBLEM: Postfix stopped sending and receiving mail.
/var/log/maillog displays the two lines:
Aug 3 18:56:15 myServer postfix/error[15579]: C1166215DA: to=, relay=none, delay=5.2, delays=5.2/0.01/0/0.01, dsn=4.3.0, status=deferred (mail transport unavailable)
and
Aug 3 18:52:19 myServer postfix/pipe[15124]: fatal: get_service_attr: unknown username: spamd
WHAT CAUSED THE PROBLEM
On Plesk onyx Tools & Settings > Spam Filter: The following 2 are ticked
Switch on server-wide SpamAssassin spam filtering
Apply individual settings to spam filtering
And the following values were set:
The maximum number of worker spamd processes to run = 1
The score that a message must receive to qualify as spam = 7
Then I followed the steps at this link:
https://janikarhunen.fi/tackle-spam-with-spamassassin-on-centos-7-and-postfix
1) added the following to /etc/mail/spamassassin/local.cf :
groupadd spamd
useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
chown spamd:spamd /var/log/spamassassin
NOTE: I couldn't find "spamassassin" folder in /var/log/ !
2) restarted spamassassin service: systemctl start spamassassin
3) Update the spam rules by running: sa-update
4) edited /etc/postfix/master.cf
smtp inet n - n - - smtpd
replaced with
smtp inet n - n - - smtpd -o content_filter=spamassassin
and added this line at the end of the file:
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
5) restarted Postfix : systemctl restart postfix
Please note that when changes in (4) were reversed, mailing started to work normally.
Please help.