본문 바로가기

리눅스

[리눅스] Sendmail 및 SquirrelMail 웹메일 설치하기-1

728x90

Sendmail 및 SquirrelMail 웹메일 설치하기-1

1. Sendmail 설치
1.1. 패키지 설치
sendmail, sendmail-cf

[root@mail ~]$ rpm -qa | grep sendmail
sendmail-8.13.8-8.el5

[root@mail ~]$ yum -y install sendmail sendmail-cf

1.2. Sendmail 서버 환경 설정
1.2.1. sendmail.cf sendmail.mc 백업

[root@mail mail]$ pwd
/etc/mail

[root@mail mail]$ mv sendmail.cf sendmail.cf.org

[root@mail mail]$ cp sendmail.mc sendmail.mc.org

1.2.2. sendmail.mc 수정(smtp 사용자 인증 메커니증 설정)

[root@mail mail]$ vi sendmail.mc
<변경 전 : 주석(dnl) 제거>
     52 dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
     53 dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
<변경 후>
     52 TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
     53 define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

<변경 전 : 릴레이 IP 수정>
    116 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
<변경 후>
    116 DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl

1.2.3. sendmail.cf 생성
m4 유틸리티를 사용하여 sendmail.cf 파일 생성

[root@mail mail]$ m4 sendmail.mc > sendmail.cf

1.2.4. sendmail.cf 수정

[root@mail mail]$ vi sendmail.cf
<변경 전 : 할당받은 도메인 변경>
     95 #Dj$w.Foo.COM
<변경 후>
     95 Djmail.sangchul.kr
※ 도메인을 설정할 시에는 /etc/access, /etc/mail/local-host-names 파일에도 도메인을 입력해 놓아야 한다.

1.2.5. access파일 및 local-host-names파일 수정

[root@mail ~]$ vi /etc/mail/access
Connect:127.0.0.1                       RELAY

Connect:mail.sangchul.kr                RELAY
Connect:192.168.0.50                    RELAY
[root@mail mail]$ vi local-host-names
# local-host-names - include all aliases for your machine here.
mail.sangchul.kr

1.3. 메일 접속 테스트

[root@mail mail]$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.sangchul.kr ESMTP Sendmail 8.13.8/8.13.8; Fri, 10 Dec 2010 03:06:40 +0900
quit
221 2.0.0 mail.sangchul.kr closing connection
Connection closed by foreign host.
[root@mail mail]$

[TIP] 릴레이 설정 확인 방법

[root@mail mail]$ telnet relay-test.mail-abuse.org
728x90