RE: Centos 7 : Setup Spamassassin
03-15-2016, 12:01 AM
(This post was last modified: 03-15-2016, 12:43 AM by rajinik.qa.)
(02-23-2015, 07:32 AM)Untouchable Wrote: All steps that described bellow, tested and working on Centos 7 Vps + Sentora 1.0.0
1. Before we start, lets check for updates
Code:su -c 'yum update'
2. Let's install now spamassassin, ( about 10mb )
Code:sudo yum install spamassassin
3. Time for configuration
You have to add the following lines, if already there just uncoment #Code:sudo nano /etc/mail/spamassassin/local.cf
Code:rewrite_header Subject ***SPAM***
Code:required_hits 5.0
Code:report_safe 0
Code:required_score 5
Required_hits 5 is for small mail serv. You can increase it more if you need
Report_safe is on 0 here, but you can change to 1 or 2 ( see spamassassin guides )
Rewrite_header we call it ***SPAM*** here, you can call it as you want
Required_score can set form 0 -> 5 depends what you need
4. Now let's create a unique user and group
Code:sudo groupadd spamd
Code:sudo useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
Code:sudo chown spamd:spamd /var/log/spamassassin
5. Configure the Postfix master.cf file to use the SpamAssassin
About line 11 in top add after smtpdCode:sudo nano /etc/postfix/master.cf
Full line looks like thatCode:-o content_filter=spamassassin
And the end - bottom addCode:smtp inet n - n - - smtpd -o content_filter=spamassassin
Code:spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
6. Update spamassassin rules
Code:sa-update --nogpg
7. Restart postfix - spamassassin
Code:systemctl restart spamassassin
Code:systemctl restart postfix
8. Check if spamassassin is listening
Code:ss -tnlp | grep spamd
9. Test : create and send an email from external mail service with subject
On roundcube webmail it will be marked as spam.Code:XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
Test spam message to see if it works : http://spamassassin.apache.org/gtube/
hello,
I have followed above steps and i believe, setup is done. However i dont see the serve enabled on my services tab on VPS. what could b the reason?
Below is what i see after point 8, is this correct? please advise, thanks
=================
[root@mail ~]# ss -tnlp | grep spamd
LISTEN 0 128 127.0.0.1:783 *:* users("spamd child",3319,5),("spamd child",3318,5),(" /usr/bin/spamd ",3317,5))
LISTEN 0 128 ::1:783 :::* users("spamd child",3319,6),("spamd child",3318,6),(" /usr/bin/spamd ",3317,6))
=============================================
thanks