Site icon Learning & Doing

Install SpamAssassin – Postfix

Requirment :

– Sudah ada Postfix yg terinstall di server

Cara install :

yum install spamassassin

# buat user untuk spamassassin nya

groupadd spamfilter
useradd -g spamfilter -s /bin/false -d /usr/local/spamassassin spamfilter
chown spamfilter: /usr/local/spamassassin

# Config Spam Assassin

edit :
vi /etc/mail/spamassassin/local.cf

yg harus ada :

required_hits 5
report_safe 0
required_score 5.0

edit juga :
vi /etc/sysconfig/spamassassin

yg harus ada :

# Options to spamd
SAHOME=”/usr/local/spamassassin”
SPID_DIR=”/var/run/spamassassin”
SUSER=”spamfilter”
SPAMDOPTIONS=”-d -c -m5 –username ${SUSER} -H ${SAHOME} -s ${SAHOME}/spamfilter.log”

# running service nya :

service spamassassin start
chkconfig spamassassin on

# kemudian Konfig postfix nya.

edit :

vi /etc/postfix/master.cf

tambahkan seperti line berikut :

smtp inet n – n – – smtpd -o content_filter=spamassassin
spamassassin unix – n n – – pipe user=spamfilter argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

# kemudian restart service postfix nya

service postfix restart

# test mail

nanti kalo di test di header / view source nya akan ada :

X-Spam-Flag: YES
X-Spam-Level: **************************************************
X-Spam-Status: Yes, score=1000.0 required=5.0 tests=GTUBE,RCVD_IN_DNSWL_NONE,
TVD_SPACE_RATIO autolearn=no version=3.3.1

Exit mobile version