2012. 2. 3. 14:13
Linux
sendmail과 spamassassin을 이용하여 스팸메일을 걸러내도록 해보자.
yum을 이용하여 spamassassin 설치
설치확인
[root@mail mail]# rpm -qa spamassassin
spamassassin-3.3.1-2.el6.i686
서비스를 올릴 계정으로 spmad 생성
[root@mail mail]# useradd -s /bin/false spamd
[root@mail mail]# cat /etc/passwd | grep spam
[root@mail mail]# cat /etc/passwd | grep spam
spamd:x:886:887::/home/spamd:/bin/false
아래내용을 복사해서 해당 파일에 넣어주자
[root@mail mail]# vi /etc/sysconfig/spamassassin
#Hint : If you want to enable SpamAssassin debugging
# (the debug output goes to /var/log/maillog) then use :
# SPAMDOPTIONS="-x -u spamd -H /home/spamd -d -D"
# Don't leave debugging turned on unnecessarily though,
# because it will slow down a busy server.
#
# Otherwise, for normal operation (debugging disabled) use :
SPAMDOPTIONS="-x -u spamd -H /home/spamd -d"
[root@mail mail]# vi /etc/mail/spamassassin/local.cf
#SpamAssassin config file for version 3.x
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)
# How many hits before a message is considered spam.
required_score 7.5
# Change the subject of suspected spam
rewrite_header subject [SPAM]
# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 1
# Enable the Bayes system
use_bayes 1
# Enable Bayes auto-learning
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 0
use_dcc 0
use_pyzor 1
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages all
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales all
*required_score가 낮을수록 더 엄격하게 필터링이 된다.
*도메인을 화이트 리스트를 추가하려면 whitelist_from *@abc.com 로 추가해 준다.
[root@mail mail]# vi /etc/procmailrc
DROPPRIVS=yes
#SpamAssassin Procmail start
#
:0fw: spamassassin.lock
* < 256000
| spamc -u $LOGNAME
#SpamAssassin End
이제 서비스를 올려보자.
[root@mail mail]# service sendmail restart
[root@mail mail]# service spamassassin start
[root@mail mail]# ps -aux | grep spam
root 30221 0.3 6.9 45244 35348 ? Ss 13:40 0:05 /usr/bin/spamd -x -u spamd -H /home/spamd -d -r /var/run/spamd.pid
spamd 30222 1.4 8.0 50836 41424 ? S 13:40 0:25 spamd child
spamd 30224 0.0 7.5 48120 38396 ? S 13:40 0:01 spamd child
반응형
'Linux' 카테고리의 다른 글
시스템 파티션 리마운트 (0) | 2012.09.03 |
---|---|
sendmail 메일큐의 메일제목 확인 (0) | 2012.04.10 |
Sendmail 속도 올리기 (0) | 2012.01.12 |
dovecot 서비스 시작 에러 "libmysqlclient.so.15: cannot open shared object file" (0) | 2011.08.29 |
IPOP3 서비스 사용하기 (0) | 2011.07.15 |