--- 디지털 인쇄로 책을...

     ---리룩스서버컴퓨터 백업

  공개 자료실 

 文學위의 文學 출판사입니다. PDF로 전환하여 복사기로 책을 만듭니다. 자세한 내용은, '디지털 인쇄'에서 확인해 보세요!

리눅스(Linux) 서버

센드메일 -설정 파일들

2005.04.09 05:51

문학 조회 수:2327

sendmail관련 패키지가 설치되어 있는지 확인합니다.
[root@ns root]# rpm -qa|grep sendmail
sendmail-8.11.6-4hl
sendmail-doc-8.11.6-4hl
sendmail-cf-8.11.6-4hl
[root@ns root]#

만일, 설치되어 있지 않으면 시디롬을 마운트 후 설치합니다.

[root@ns mail]# mount /mnt/cdrom
cd /mnt/cd [root@ns mail]#
[root@ns mail]# cd /mnt/cdrom/Hancom/RPMS/
[root@ns RPMS]# rpm -Uvh sendmail-8.11.6-4hl.i386.rpm
Preparing... ########################################### [100%]

sendmail.cf

/etc/sendmail.cf 파일은 sendmail 패키지의 기본 설정 파일입니다. 이 설정파일은 리눅스 설정 파일 중 방대하고, 암호화(?) 형식이라 전문적인 기능을 요하지 않는다면 변경할 필요가 없습니다.
[root@ns root]# cat /etc/sendmail.cf|more
#
# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

######################################################################
######################################################################
#####
##### SENDMAIL CONFIGURATION FILE
#####
#####
######################################################################
######################################################################

local-host-names

/etc/mail/local-host-names 파일은 네임서버를 운영하며 가상 도메인 서비스를 운영할 때 도메인을 등록하여 사용할 경우 필요한 파일입니다.

[root@ns root]# cat /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
[root@ns root]#

access

/etc/mail/access 파일은 특정호스트나 도메인의 메일 RELAY를 허용하거나 거부를 제어하는 파일로써, 메일 서버를 설정하는데 매우 유심하게 설정을 해야 하는 부분입니다.

[root@ns root]# cat /etc/mail/access
# Check the /usr/share/doc/sendmail-8.11.6/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail-8.11.6/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
211.255.253 RELAY

위의 굵은 표시는 설정하려고 하는 메일서버의 네트워크 대역폭을 지정한 것입니다. 내부의 127.0.0.1과 211.255.253 대역을 가진 IP의 호스트만 RELAY기능을 허용한다는 내용입니다.

허용하고자 한 대역을 추가한 다음에는 makemap 명령으로 access.db 디비 파일을 갱신합니다.
[root@ns mail]# makemap hash /etc/mail/access.db < /etc/mail/access
[root@ns mail]#

virtusertable

/etc/mail/virtusertable 파일은 여러개의 도메인을 하나의 서버에서 서비스하는 호스팅일 때, 동일 유저명에 대해 사용을 할 수 있게 합니다. 자세한 내용은 추후 설명토록 하겠습니다.

데몬 실행

한컴리눅스에서는 다른 설정사항은 그대로 디폴트로 사용하며, access파일만 허용하려는 IP 대역대를 추가한 다음, 데몬을 재 실행하면 기본적인 메일서버의 기능을 사용할 수 있습니다.

[root@ns mail]# /etc/rc.d/init.d/sendmail stop
sendmail를 종료하고 있습니다: [실패]
[root@ns mail]# /etc/rc.d/init.d/sendmail start
sendmail (을)를 시작합니다: [ 확인 ]
[root@ns mail]#