본문 바로가기

Linux/Mail

메일서버(sendmail,saslauthd,dovecot) 세팅

centos5 - 메일서버(sendmail,saslauthd,dovecot) 세팅 기술자료

2009/03/06 10:10

복사 http://blog.naver.com/shoeu/80064571116

// 설치 //

1. yum install sendmail (centos5 설치시 기본설치되어있음)
2. yum install sendmail-cf ( sasl 설정을 위해 깔아야 함)
3. yum install dovecot ( pop3 서버 설치)

// sendmail 설정 //
1. vi /etc/mail/sendmail.cf
   -> #Cwlocalhost (주석처리)
   -> DaemonPortOption=port=stmp,Name=MTA
2. vi /etc/mail/local-host-names
   -> localhost
   -> example.com.kr
   -> example.comm 등 메일서버의 도메인명 기록
3. vi /etc/mail/access
   -> localhost.localdomain RELAY
   -> localhost   RELAY
   -> example.co.kr  RELAY
   -> mail.example.co.kr  RELAY
   -> example.com  RELAY
   -> mail.example.com  RELAY
   ... 등 메일서버 이용을 허용하는 도메인 또는 IP주소
4. makemap hash /etc/mail/access < /etc/mail/access (access.db 생성)

   makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable

   makemap hash /etc/mail/domaintable < /etc/mail/domaintable
   makemap hash /etc/mail/mailertable < /etc/mail/mailertable


5. service sendmail start

// sasl 설정 //
1. vi /etc/mail/sendmail.mc
   -> dnl 주석풀기
      TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
      define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
   -> Daemon_Option ('port=smtp,Addr=0.0.0.0,Name=MTA')dnl
2. m4 /etc/mail/sendmail.mc > /etc/sendmail.cf (sendmail.cf 파일 재 생성, sendmail-cf 가 깔려있어야 에러없음)
3. vi /etc/mail/sendmail.cf
   -> #Cwlocalhost (주석처리)
4. service sendmail restart
5. service saslauthd restart
6. telnet localhost 25
   -> ehlo localhost
      auth Login Plain 나오면 성공

 

//  pop3 서버 구축(dovecot 추천) //

환경설정
1. vim /etc/dovecot.conf
   -> protocols = imap imaps pop3 pop3s (주석풀고 설정)
   -> listen = [::]

서비스추가
2. ntsysv -> dovecot 서비스 체크

서비스 실행
3. service dovecot start

 

// 서비스 동작 확인 //
1. telnet localhost 110
   -> user myid(계정명)
      +OK Password required for myid.
   -> pass 1234(패스워드)
      +OK myid has 0 visible messages (0 hidden) in 0 octets.
   -> quit

// 관리자 계정 추가(master@aaa.com, webmaster@aaa.com) //
  1. adduser webmaster
  2. passwd webmaster
  3. vi /etc/aliases
     -> 맨아래 # Person who should get root's mail
        root:           myid,webmaster (주석풀고 계정명 추가, root계정으로 오는메일을 myid,webmaster계정도 받아볼수 있음)
  4. cd /etc
  5. makemap hash aliases < aliases (aliases.db생성)
  6. 확인 : strings /etc/aliases.db | grep 계정명

참고) 디렉토리 생성없이 계정만 추가 : adduser -M 계정명
      디렉토리 삭제동반하는 계정삭제 : userdel -r 계정명

'Linux > Mail' 카테고리의 다른 글

SMTP error code  (0) 2009.03.06
procmail을 이용한 스팸 메일 필터링  (0) 2008.10.09
Squirrelmail 설치하기  (0) 2008.10.09
sendmail 스팸처리  (0) 2008.10.09
Relaying denied. IP name lookup failed  (0) 2008.10.09