메뉴 닫기

Sendmail 설치하기

1. sendmail 설치 되어있는지 확인하기!

[root@DKYO backupsh]# rpm -qa | grep sendmail
sendmail-8.13.8-8.1.el5_7
sendmail-cf-8.13.8-8.1.el5_7

 

설치되어있다면 삭제해줍니다. (설치해보기 위한 것이니까요)

삭제하기전 센드메일 데몬이 돌아가고 있다면 일단 정지후 삭제해줍니다.

 

[root@DKYO backupsh]# netstat -nptl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      1520/sendmail: acce

 

[root@DKYO backupsh]# /etc/init.d/sendmail stop
sm-client을 종료 중:                                       [  OK  ]
sendmail를 종료 중:                                        [  OK  ]

 

2. sendmail 삭제

[root@DKYO backupsh]# yum remove sendmail

===========================================================================

 Package                                        Arch                                    Version                                                    Repository                                    Size
===========================================================================

Removing:
 sendmail                                       i386                                    8.13.8-8.1.el5_7                                           installed                                    1.3 M
Removing for dependencies:
 mdadm                                          i386                                    2.6.9-3.el5                                                installed                                    1.8 M
 redhat-lsb                                     i386                                    3.1-12.3.EL.el5.centos                                     installed                                     22 k
 sendmail-cf                                    i386                                    8.13.8-8.1.el5_7                                           installed                                    925 k

Transaction Summary
=====================================================================

ok [y/N]: y

**sendmail-cf 는 m4 명령어를 사용하기위해 필요해요 ~

 

3. sendmail 설치

[root@DKYO backupsh]# yum -y install sendmail sendmail-cf

 

4. 설치후 smtp 인증기능 추가하기

vi /etc/mail/sendmail.mc

아래 목록 주석 해제해주기(dnl 이 주석입니다. dnl을 지우면됩니다.

TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl

 

저장후 나와서

아래 명령어로 바뀐설정 적용시키기

[root@DKYO ~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf  

vi로 다시 sendmail.cf 파일을 열어 SMTP daemon option의 smtp포트에

대해 모두 허용시킨다.

[root@DKYO ~]# vi /etc/mail/sendmail.cf
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1 Name=MTA     <<<색칠되있는 부분을 아래와같이 변경

O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA

 

내부 방화벽이 작동중이라면 iptables에 25번 포트를 허용시켜줍니다.

-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 25 -j ACCEPT

 

5. 메일 발송테스트

# mail to asd@gmail.com   <<< 메일발송하기
Subject: hello world         <<< 메일제목
hihihi                            <<< 내용
.                                  <<< 종료후 메일보내기 ( . 입력후 엔터를 입력하면됩니다.)
EOT

[polldaddy rating=”7739789″]

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x