How to install and configure SpamAssassin with Postfix in Debian 8
- Category : Linux Helpline (Easy Guide)
- Posted on : Mar 01, 2019
- Views : 2,166
- By : Tadashi P.
1. Introduction
Spamassassin is a spam detection and prevention software intentionally made for incoming email spamming. We can prevent incoming spam mails by using various methods such as making content-matching rules. It flags an email as spam according to the resulting score of the mail which gets during the test.
In this article, We can see how to install and configure Spamassassin 3.4 in Debian 8.
2. Requirement
All the system softwares should be uptodate before starting the installation. Please follow the below commands to update your Debian system.
# apt-get update # apt-get upgrade
3. Installation
After completing the software update, please install SpamAssassin using the following command :
# apt-get install spamc spamassassin
Thus the installation is completed. You can see the version by executing the commands below :
# spamassassin -V SpamAssassin version 3.4.0 running on Perl version 5.20.2
4. Setting Privileges
By default, The SpamAssasin will run under the root. We need to assign it to a low privileged user as a security measure. Executing the below commands one by one :
# groupadd -g 5555 spamd # useradd -u 5555 -g spamd -s /sbin/nologin -d /usr/local/spamassassin spamd # mkdir -p /usr/local/spamassassin/log # chown spamd:spamd -R /usr/local/spamassassin
5. Enable SpamAssasin
To enable SpamAssassin daemon, Open the file /etc/default/spamassassin and edit the option ‘ENABLED=0’ to ‘ENABLED=1’.
6. Configure Spamassassin
Open the file given below :
# vi /etc/spamassassin/local.cf
Add or Change the following parameters and save the file.
rewrite_header Subject *****SPAM***** required_score 3.0 report_safe 0 use_bayes 1 bayes_auto_learn 1
We have completed the Spamassassin configuration. Let see the postfix configuration.
7. Configure Postfix
Open the postfix master.cf file :
# vi /etc/postfix/master.cf
Search for the line given below :
smtp inet n - - - - smtpd
Change the line as below :
smtp inet n - - - - smtpd -o content_filter=spamassassin
Then, add the following line at the end of the file :
spamassassin unix - n n - - pipe user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
Atlast, Save the file and restart the services :
# service spamassassin restart # service postfix restart
Now you can see the SpamAssassin starts running :
# netstat -tnulp | grep spam
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 15972/spamassassin.
8. Conclusion
Thus we have completed the installation and configuration of SpamAssassin.
Categories
- cPanel Question 47
- cPanel Software Management 29
- cPanel Tutorials 13
- Development 29
- Domain 13
- General 19
- Linux Helpline (Easy Guide) 156
- Marketing 47
- MySQL Question 13
- News 2
- PHP Configuration 14
- SEO 4
- SEO 42
- Server Administration 84
- SSL Installation 54
- Tips and Tricks 24
- VPS 3
- Web Hosting 44
- Website Security 22
- WHM questions 13
- WordPress 148
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Recent Articles
-
Posted on : Sep 17
-
Posted on : Sep 10
-
Posted on : Aug 04
-
Posted on : Apr 01
Tags
- ts
- myisam
- vpn
- sql
- process
- kill
- tweak
- server load
- attack
- ddos mitigation
- Knowledge
- layer 7
- ddos
- webmail
- DMARC
- Development
- nginx
- seo vpn
- Hosting Security
- wireguard
- innodb
- exim
- smtp relay
- smtp
- VPS Hosting
- cpulimit
- Plesk
- Comparison
- cpu
- encryption
- WHM
- xampp
- sysstat
- optimize
- cheap vpn
- php-fpm
- mariadb
- apache
- Small Business
- Error
- Networking
- VPS
- SSD Hosting
- Link Building
- centos
- DNS
- optimization
- ubuntu