Anti-SPAM 을 위한 sendmail 환경 설정
상태바
Anti-SPAM 을 위한 sendmail 환경 설정
  • 이석기 컨설턴트
  • 승인 2001.12.10 00:00
  • 댓글 0
이 기사를 공유합니다

A3 보안 컨설팅

제목 : Anti-SPAM 을 위한 sendmail 환경 설정
분류 : [Adv] A3 Security Advisory

I. SPAM mail 이란?

II. 문제점

외부의 SPAM 메일 발송자가 특정 메일 서버를 relay host 로서 사용함으로써 다음과 같은 문제점을 일으킨다.

- relay host에 메일 전송 에러로 인해 Returned 되는 메일들이 수백건 또는 수천건이 됨으로써 spool 디렉토리 밑의 root 파일이 수십 Mbytes 크기가 되어 System Full 을 일으킨다.

- SPAM 메일의 수신자가 볼 때 메일의 송신자가 relay host가 되어 송신자로서 비난을 대신 받게된다.

- SPAM mailler black-list 에 올라가게 되는 경우 SPAM 이 아닌 메일을 보내도 Target host 에서 SPAM 이라 판단하고 return 되어버리는 불상사가 일어날 수도 있다.

III. 해결책

A. Sendmail Version 확인

원하는 host 의 sendmail version 을 확인해보고

(한글) http://cair.kaist.ac.kr/~chester/sendmail.html
(영문) http://www.sendmail.org/

에서 sendmail 을 8.8.8 이상을 받아와 설치한다.

(sendmail 8.8.8 이상을 설치하는 방법은 설명하지 않는다.)

B. /etc/sendmail.cf 고치기

아래의 내용을 /etc/sendmail.cf 에 첨가한다.
내용: (Downloadable Version)

-- Cut Here --

# please use the .m4 file, this file is not maintained!
F{LocalIP} /etc/mail/LocalIP
F{RelayTo} /etc/mail/relayto

Scheck_rcpt
# make sure you have TABs here, not BLANKs! sendmail will complain
# otherwise...
# first: get client addr
R$+ $: $(dequote "" $&{client_addr} $) $| $1
R0 $| $* $@ ok no client addr: directly invoked
R$={LocalIP}$* $| $* $@ ok from here
# not local, check rcpt
R$* $| $* $: $>3 $2
# remove local part, maybe repeatedly
R$+ $:$>remove_local $1
# still something left?
R$*<@$+>$* $#error $@ 5.7.1 $: 550 we do not relay

Sremove_local
# remove RelayTo part (maybe repeatedly)
R$*<@$*$={RelayTo}.>$* $>3 $1 $4
R$*<@$=w.>$* $: $>remove_local $>3 $1 $3
R$*<@$*>$* $@ $1<@$2>$3
# dequote local part
R$- $: $>3 $(dequote $1 $)
R$*<@$*>$* $: $>remove_local $1<@$2>$3

-- End --

/etc/mail/LocalIP (Down)
relay 를 허용할 local client 의 IP address 를 적는다.
해당 host 를 SMTP Server 로 쓰는 사용자들을 위해서 해당 사용자들에게만 relay 를 허용할 목적으로 작성하는 file이다.

/etc/mail/relayto (Down)
relay 되어도 좋은 주소를 적는다.
자신의 host 를 거쳐서 해당 address 로 보내지는 메일에 대해서만 relay 를 허용할 목적으로 작성하는 file 이다.

위 file 들은 위치와 filename 변경이 가능하여 적을 내용이 없다면 내용 없이 file 만 만들어 놓는다.

C. sendmail 을 restart 한다.

# kill -HUP sendmail.pid

IV. Reference

http://maps.vix.com/tsi/ar-what.html
: relay problem 이 끼치는 영향에 대해 설명한 site

http://maps.vix.com/tsi/ar-test.html
: relay problem 을 가지고 있는지 test 하는 site

http://www.sendmail.org/antispam.html
: sendmail 8.8.x 에서 Anti-SPAM 을 위한 정보

http://www.informatik.uni-kiel.de/%7Eca/email/check.html
: sendmail 8.8.x 에서 check_* 를 이용하여 SPAM 을 막는 정보


댓글삭제
삭제한 댓글은 다시 복구할 수 없습니다.
그래도 삭제하시겠습니까?
댓글 0
댓글쓰기
계정을 선택하시면 로그인·계정인증을 통해
댓글을 남기실 수 있습니다.