setup spamassassin ubuntu 12.04 for zpanel

 http://forums.sentora.io/showthread.php?tid=22
Ubuntu :How to setup Spamassassin
How to setup Spamassassin

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

2: First add the group spams:
Code: (Select All)
groupadd spamd

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

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

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

6: Setting up spamassassin
Code: (Select All)
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: (Select All)
SAHOME="/var/log/spamassassin/"

8: start spamassassin
Code: (Select All)
service spamassassin start

Configuring Postfix

9: Open Postfix config file using:
Code: (Select All)
nano /etc/postfix/master.cf

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

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

12: restart postfix
Code: (Select All)
service postfix restart

Configuring Spamassassin

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

14 : make rules
Code: (Select All)
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: (Select All)
service spamassassin restart

No comments:

Post a Comment