Spamassassin Configuration after Mailserver (or groupware) installation with Postfix

If you install OX or Kopano, spamassassin will not configured automatically for postfix. You need to configure them manually (so far I know). To achieve this you need to modify two files.
First edit the file /etc/mail/spamassassin/local.cf
and uncomment and change the value of:
report_safe 0 << 0 for only marking. If you put 1 then spam marked messages will be automatically deleted. Not very wise.
required_score 8.0 <<as you are setting OX or Kopano I am guessing you’re setting this for many users. 8.0 is required if your mail box size is more than 90+.
rewrite_header Subject [SPAM] < service spamassassin restart
Then run the spamassasin update. Command > sa-update
First part is done. Spam assassin is now configured but we need to integrate this with postfix. Here is the step:
Edit the file /etc/postfix/master.cf
at the bottom of the file add the following code:
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

then modify the line where
smtp inet n - n - - smtpd -o content_filter=spamassassin

-o content_filter=spamassassin < service postfix restart

Thats it. You’ve configured spamassassin for your mail server.
Thanks from Dhaka, Bangladesh.

Source: https://www.tecmint.com/integrate-clamav-and-spamassassin-to-protect-postfix-mails-from-viruses/

1 Like
Mastodon