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
#1
Centos 7 : Setup Spamassassin
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
Code:
sudo nano /etc/mail/spamassassin/local.cf
You have to add the following lines, if already there just uncoment #
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
Code:
sudo nano /etc/postfix/master.cf
About line 11 in top add after smtpd
Code:
-o content_filter=spamassassin
Full line looks like that
Code:
smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin
And the end - bottom add
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
Code:
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
On roundcube webmail it will be marked as spam.

Test spam message to see if it works : http://spamassassin.apache.org/gtube/
Reply
Thanks given by: mostafiz , poudenes


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 rajinik.qa - 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 12 19,946 11-21-2019, 02:57 AM
Last Post: FernandoGarcia
[How To] Update from PHP v5.4.16 to v5.6.31 (Includes suhosin patch) [CentOS] betatester3.0 5 4,392 03-18-2019, 01:23 AM
Last Post: BigBang
Proper CRON setup TGates 9 14,692 05-15-2018, 01:07 AM
Last Post: johnk42

Forum Jump:


Users browsing this thread: 1 Guest(s)