Fedora6에서 스팸어세신 설정.
작성자 정보
- 배현옥 작성
- 작성일
컨텐츠 정보
- 4,960 조회
- 3 댓글
- 0 추천
- 목록
본문
초보자도 쉽게 따라하는 Sendmail + Procmail + SpamAssassin 설정방법.
-리눅스란걸 제대로 알지도 못하면서 우리회사 메일서버의 스팸처리 문제를 맡게되어 이리저리 자료를 찾고 시행 착오를 겪으면서 알게된 설치방법입니다. 여러 사이트를 둘러보고 확인해 본 결과 방법이 획일적이지 못하고 쌩 초보자가 바로바로 질문도 못하면서 설치를 해야하는 스트레쓰를 좀 줄여보자는 취지에 이렇게 정리를 합니다. 고수분들 보시고 이상하다 싶은거 고쳤으면 좋겠다 하는 부분은 메일로 알려주시면 고치겠습니다...그리고 제가 참고한 사이트도 무지 많아 일일히 거론하지 못한 점 송구스럽습니다...대표적인 사이트는 "슈퍼유저(리눅스포털), 커피닉스, ihelpers, procmail.episode.co.kr, php스쿨, 외 등등..."사이트 및 여러 Q&A입니다. 감사합니다...-
설치 환경 : RedHat Fedora core 6
시스템 환경 : P4 1,5G / 256Mb RAM
메일서버 : SendMail + dovecot
스팸가드 : procmail + spamassassin
# 페도라6 설치시 사용자 설치로 들어간다.
- 서버설정에서 메일서버 설치
- 개발도구 설치 (스팸어세신 설치 및 운영시 Perl라이브러리등 필요)
#페도라 설치 완료후 다음과 같은 명령으로 프로그램의 설치 여부 확인.
예) ~]# rpm -qa | grep sendmail
~]# rpm -qa | grep procmail
위와 같이 터미날창에 입력 실행시 해당 프로그램의 버젼 표시가 나오는지 확인한다.
그리고 SpamAssassin은
~]#spamassassin -V
위와 같이 터미날에서 실행하면 현재 설치된 스팸어세신의 버젼 확인이
가능하다.
현재 최신 버젼은 SpamAssassin-3.1.7.tar 이며,
다운로드 홈페이지는 htpp://www.spamassassin.org 에서 다운 가능하다.
#SpamAssassin설치방법
1) 다운받은 스팸어세신을 압축을 해제한다.
~]# tar xvfz Mail-SpamAssassin-3.1.7.tar.gz
2) 압축해제후
~/]# cd Mail-SpamAssassin-3.1.7
설치는 cpan으로 하면 일일이 필요 모듈을 다운받아 설치 할 필요없이 한번에 끝
난다.
아래와 같이 입력한다.
~]# perl -MCPAN -e shell
cpan> o conf prerequisites_policy follow
cpan> install Digest::SHA1 HTML::Parser DB_File
cpan> install Net::DNS Mail::SPF::Query IP::Country
cpan> install Mail::Audit::Razor Net::Ident IO::Socket::INET6
cpan> install IO::Socket::SSL Time::HiRes DBI LWP::UserAgent
cpan> install HTTP::Date Archive::Tar IO::Zlib
cpan> quit
위와 같은 방법으로 필요한 모듈들을 설치하고 문제가 되는 것은 아래의 링크로
가서 검색하여 다운받고 개별 설치를 해준다..
Perl Module Search Link - http://search.cpan.org/
위의 과정이 끝나면 이제부터 스팸어세신의 설치 시작이다.
~Mail-SpamAssassin-3.1.7]# perl Makefile.PL
What email address or URL should be used in the suspected-spam report
text for users who want more information on your filter installation?
(In particular, ISPs should change this to a local Postmaster contact)
default text: [the administrator of that system]
NOTE: settings for "make test" are now controlled using "t/config.dist". See that file if you wish to customise what tests are run, and how.
checking module dependencies and their versions...
***************************************************************************
NOTE: the optional Mail::SPF::Query module is not installed.
Used to check DNS Sender Policy Framework (SPF) records to fight email
address forgery and make it easier to identify spams.
***************************************************************************
NOTE: the optional IP::Country module is not installed.
Used by the RelayCountry plugin (not enabled by default) to determine
the domain country codes of each relay in the path of an email.
***************************************************************************
NOTE: the optional Razor2 (version 2.61) module is not installed.
Used to check message signatures against Vipul's Razor collaborative
filtering network. Razor has a large number of dependencies on CPAN
modules. Feel free to skip installing it, if this makes you nervous;
SpamAssassin will still work well without it.
More info on installing and using Razor can be found
at http://wiki.apache.org/spamassassin/InstallingRazor .
***************************************************************************
NOTE: the optional Net::Ident module is not installed.
If you plan to use the --auth-ident option to spamd, you will need
to install this module.
***************************************************************************
NOTE: the optional LWP::UserAgent module is not installed.
The "sa-update" script requires this module to make HTTP requests.
***************************************************************************
NOTE: the optional HTTP::Date module is not installed.
The "sa-update" script requires this module to make HTTP
If-Modified-Since GET requests.
optional module missing: Razor2
optional module missing: Net::Ident
warning: some functionality may not be available,
please read the above report before continuing!
Checking if your kit is complete...
Looks good
Writing Makefile for Mail::SpamAssassin
Makefile written by ExtUtils::MakeMaker 6.30
여기까지 하면 아마도 Razor2와 Ident가 없다고 뜰텐데, 따로 다운받아서 설치를 해준후,
( http://razor.sourceforge.net, http://search.cpan.org/CPAN/authors/id/J/JP/JPC/Net-Ident-1.20.tar.gz/)
~Mail-SpamAssassin-3.1.1]# perl Makefile.PL 를 한번 더 해준다.
다음으로 넘어가서, 아래와 같이 해보자....
~Mail-SpamAssassin-3.1.7]# make
~Mail-SpamAssassin-3.1.7]# make test
~Mail-SpamAssassin-3.1.7]# make install
인스톨이 끝나면 다음과 같이 테스트를 해본다.
~Mail-SpamAssassin-3.1.1]# spamassassin -t < sample-nonspam.txt
~Mail-SpamAssassin-3.1.1]# spamassassin -t < sample-spam.txt
## 환 경 설 정
1)사용자추가
~]# groupadd spamd
~]# useradd -g spamd spamd
2)스크립트및 서비스 등록
~]# gedit /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" <=수정
3) "local.cf" 설정.
http://www.yrex.com/spam/spamconfig.php 에서 만들어서
/etc/mail/spamassassin/local.cf 복사해 주거나
/etc/mail/spamassassin/]# gedit /etc/mail/spamassassin/local.cf 직접 수정.
## 실행 스크립트 작성(레드햇계열)
실행 스크립트는 스팸어세신 설치파일 압축을 푼 폴더에 있다.
~/Mail-SpamAssassin-3.1.7/spamd/]# ls
~/Mail-SpamAssassin-3.1.7/spamd/]# cp redhat-rc-script.sh /etc/rc.d/init.d/spamd
~/etc/rc.d/init.d/]# chkconfig --add spamd
~/etc/rc.d/init.d/]# /etc/rc.d/init.d/spamd start(restart)
#주. redhat-rc-script.sh 는 설치 원본 폴더의 spamd폴더안에 있다.
-> ~Mail-SpamAssassin-3.1.7/spamd/
#Procmail 설정
~ root]# cat /etc/procmailrc ->procmailrc 파일이 없으면 직접 만들거나 아니면
http://procmail.episode.co.kr 에서 procmailrc를 다운받아 복사할것.
아래의 내용을 procmailrc 제일 첫번째로 등록한다.
#
# SpamAssassin procmail
#
DROPPRIVS=yes
:0fw
* < 256000
| /usr/bin/spamc
#추가적으로 sendmail.mc를 수정하여 procmail을 연계 시켜줘야한다.
페도리6의 경우 기본적으로 연계가 되어 있다.
관련자료
-
이전
-
다음
김성준님의 댓글
- 김성준
- 작성일
전 cd check 에 이상 없어서 설치를 진행하는데 사용자 정의 프로그램 설치 부분에서 에러가 생기고 시스템이 꺼져버리더라구요.
참고로 전 카이스트 미러 사이트에서 다운 받았습니다.
해당 컴퓨터는 Fedora 5.0은 잘 깔리는데 6.0이 문제네요. ^^
참 그리고 유용한 저위의 정보 고맙습니다.
저도 한참 고민하구 있었거든요.
김성준님의 댓글
- 김성준
- 작성일
#] gedit /etc/sysconfig/spamassassin
cannot open display: (null)
Run 'gedit --help' to see a full list of available command line options.
배현옥님의 댓글
- 배현옥
- 작성일