Hello
The "How to configure Spamassassin" section to wiki here -->
https://wiki.centos-webpanel.com/how-to-configure-spamassassin is outdated.
So it would be great to be updated with the following or just update the configuration files locations mentioned there.
Step 1. Edit the configuration (/etc/mail/spamassassin/local.cf) file with the settings below
required_hits 5
report_safe 0
required_score 5
rewrite_header Subject [***SPAM***]
Step 2. Edit /etc/sysconfig/spamassassin file with below config (replacing everything in it) and save it
SAHOME="/var/lib/spamassassin/"
SPAMDOPTIONS="-d -c -m5 -H --username nobody -s ${SAHOME}spamd.log"
Step 3. Edit configuration file in Postfix. Open the file /etc/postfix/master.cf and edit/add the config below then save it.
smtp inet n - n - - smtpd
-o content_filter=smtp-amavis:127.0.0.1:10024
-o receive_override_options=no_address_mappings
-o content_filter=spamassassin
spamassassin unix - n n - - pipe
user=nobody argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
Step 4. Restart Postfix and SpamAssasin services
You are ready to go
Extra configuration tips
- In case you want mail to be deleted automaticaly and not receive the header rewritten with [***SPAM***] then you can set
report_safe 1
to step 1.
- If you wish to make server more strict you can set the following flag lower. So 0 will always pass but if we set it to 3 that means a lot of mail will get flaged.
required_score 5
- One more configuration you could play is the following. The more you lower this value your mailserver will become strict.
required_hits 5