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.

Ubuntu :How to setup Spamassassin
#1
Ubuntu :How to setup Spamassassin
How to setup Spamassassin

1: Use apt-get to install Spamassassin and spamc.
Code:
apt-get install spamassassin spamc
Add Spamassassin user

2: First add the group spams:
Code:
groupadd spamd

3: Then add the user spamd with the home irectory /var/log/spamassassin:
Code:
useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd

4: then create the directory /var/log/spamassassin and change the ownership:
Code:
mkdir /var/log/spamassassin
chown spamd:spamd /var/log/spamassassin

Setting Up Spamassassin
5: Open the spamassassin config file using:
Code:
nano /etc/default/spamassassin

6: Setting up spamassassin
Code:
Find ENABLED=0 and change to ENABLED=1
Find CRON=0 and change to CRON=1
Find OPTIONS and change the line to
OPTIONS="--create-prefs --max-children 2 --username spamd \ -H ${SAHOME} -s ${SAHOME}spamd.log"
save and exit

7: Now create a variable named SAHOME with the Spamassassin home directory:
Code:
SAHOME="/var/log/spamassassin/"

8: start spamassassin
Code:
service spamassassin start

Configuring Postfix

9: Open Postfix config file using:
Code:
nano /etc/postfix/master.cf

10: Find the the line
Code:
smtp    inet n     -     -     -     -     smtpd
add "-o content_filter=spamassassin" after smtpd

11 End of the file add:
Code:
spamassassin unix - n n - - pipe user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

12: restart postfix
Code:
service postfix restart

Configuring Spamassassin

13: Open the Spamassassin default rules file using:
Code:
nano /etc/spamassassin/local.cf

14 : make rules
Code:
change #rewrite_header Subject ***** SPAM ***** to
rewrite_header Subject [*** SPAM ***]
change required_score 5.0 to required_score 3.0
use_bayes from 0 to 1
bayes_auto_learn from 0 to 1

15: now restart spamassassin
Code:
service spamassassin restart
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
Thanks given by: kellenw , lino69 , rafaht , fairbanksk , Bobses , ashok , hayden29


Messages In This Thread
Ubuntu :How to setup Spamassassin - by Diablo925 - 07-18-2014, 07:35 AM
RE: Ubuntu :How to setup Spamassassin - by ballen - 07-21-2014, 07:11 PM
RE: Ubuntu :How to setup Spamassassin - by TumTum - 07-23-2014, 07:55 AM
RE: Ubuntu :How to setup Spamassassin - by ballen - 02-02-2015, 10:44 PM
RE: Ubuntu :How to setup Spamassassin - by Me.B - 02-02-2015, 11:16 PM
RE: Ubuntu :How to setup Spamassassin - by ballen - 02-02-2015, 11:29 PM
RE: Ubuntu :How to setup Spamassassin - by xanaul - 09-29-2015, 01:44 AM
RE: Ubuntu :How to setup Spamassassin - by TGates - 10-30-2015, 05:01 AM
RE: Ubuntu :How to setup Spamassassin - by Bobses - 01-03-2016, 08:11 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
Upgrade to Ubuntu 16.04 from 14.04 HogensHero 7 10,424 10-04-2019, 11:20 AM
Last Post: type-00
Proper CRON setup TGates 9 15,785 05-15-2018, 01:07 AM
Last Post: johnk42
Ubuntu: How to setup TLS on postfix and dovecot Diablo925 28 60,802 02-15-2018, 08:46 PM
Last Post: duane

Forum Jump:


Users browsing this thread: 1 Guest(s)