This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Centos 7 : Setup Spamassassin
RE: Centos 7 : Setup Spamassassin
(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
su -c 'yum update'

2. Let's install now spamassassin, ( about 10mb )
sudo yum install spamassassin

3. Time for configuration
sudo nano /etc/mail/spamassassin/
You have to add the following lines, if already there just uncoment #
rewrite_header Subject ***SPAM***
required_hits 5.0
report_safe 0
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
sudo groupadd spamd
sudo useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
sudo chown spamd:spamd /var/log/spamassassin

5. Configure the Postfix file to use the SpamAssassin
sudo nano /etc/postfix/
About line 11 in top add after smtpd
-o content_filter=spamassassin
Full line looks like that
smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin
And the end - bottom add
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
sa-update --nogpg

7. Restart postfix - spamassassin
systemctl restart spamassassin
systemctl restart postfix

8. Check if spamassassin is listening
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.

Test spam message to see if it works :

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 *:* usersSad("spamd child",3319,5),("spamd child",3318,5),(" /usr/bin/spamd ",3317,5))
LISTEN 0 128 ::1:783 :::* usersSad("spamd child",3319,6),("spamd child",3318,6),(" /usr/bin/spamd ",3317,6))
Thanks given by:

Messages In This Thread
Centos 7 : Setup Spamassassin - by Untouchable - 02-23-2015, 07:32 AM
RE: Centos 7 : Setup Spamassassin - by Smile - 02-24-2015, 09:07 PM
RE: Centos 7 : Setup Spamassassin - by mostafiz - 03-22-2015, 03:32 AM
RE: Centos 7 : Setup Spamassassin - by bbspike - 01-13-2016, 04:34 AM
RE: Centos 7 : Setup Spamassassin - by JElder - 03-09-2016, 01:02 PM
RE: Centos 7 : Setup Spamassassin - by TGates - 03-09-2016, 07:08 PM
RE: Centos 7 : Setup Spamassassin - by - 03-15-2016, 12:01 AM
RE: Centos 7 : Setup Spamassassin - by chongma - 03-26-2017, 06:35 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
Fail2ban for Sentora (Centos 7) bbspike 14 21,116 01-14-2020, 07:32 AM
Last Post: Vedran B
[How To] Update from PHP v5.4.16 to v5.6.31 (Includes suhosin patch) [CentOS] betatester3.0 5 4,916 03-18-2019, 01:23 AM
Last Post: BigBang
Proper CRON setup TGates 9 15,781 05-15-2018, 01:07 AM
Last Post: johnk42

Forum Jump:

Users browsing this thread: 1 Guest(s)