출처 : http://blog.naver.com/win2107/100000908486

 

(기본)
메일 기본 디렉토리 : /etc/mail
메일 데몬 위치 : /usr/lib/sendmail

메일 환경파일 : /etc/mail/sendmail.cf

 

1. 기본으로 돌아가고 있는 sendmail 데몬을 죽입니다.
#/etc/init.d/sendmail stop
혹은
# ps -ef | grep sendmail
 ...
 ...
# kill -9 [sendmail PID]

 

2. 소스를 적당한 위치로 옮기고 아래와 같이 압축을 풉니다.
# gzip -cd sendmail.8.11.6.tar.gz | tar xvf -

or

# gzcat sendmail.8.11.6.tar.gz | tar xvf -
# cd sendmail-8.11.6

# ./Build

 

3. 정상적으로 Compile 이 되었다면, 현재디렉토리 밑에 "obj.SunOS.5.7.sun4" 라는 디렉토리가 생긴다.

그 다음에 아래 디렉토리로 이동하여

# cd ./cf/cf

 

아래와 같이 "generic-solaris2.mc"를 vi명령어로 열고
아래 라인을 마지막 줄에 추가하고 저장하고 나옵니다.

 

# vi generic-solaris2.mc (Relay를 위한 매크로 추가)
...
FEATURE(access_db,`dbm -o /etc/mail/access')dnl   <-- 이 라인을 추가합니다.
...
:wq!

 

4. m4명령어를 이용하여, sendmail.cf 를 만듭니다.

# /usr/ccs/bin/m4  ../m4/cf.m4  generic-solaris2.mc  >  sendmail.cf

 

5. 기존에 있던 sendmail.cf 등 기존파일을 백업해둡니다.
  가. sendmail 데몬 백업
       # cp /usr/lib/sendmail /usr/lib/sendmail.org
       # cp -r /etc/mail /etc/mail.org
  
6. source가 풀려있는 제일 상위 디렉토리로 이동한후 아래와 같이 데몬 등을 복사합니다.

# pwd
/sendmail-8.11.6     (소스가 풀려있는 디렉토리)

 

 가. sendmail 데몬 복사
    # cp ./obj.SunOS.5.7.sun/sendmail/sendmail /usr/lib/sendmail
    # chmod 555 /usr/lib/sendmail
    # chmod u+s /usr/lib/sendmail

 

 나. sendmail.cf 복사
    # cp ./cf/cf/sendmail.cf /etc/mail/sendmail.cf

 

7. 환경설정.(예, 도메인이 mail.solaris8.pe.kr 이라 가정하고, IP는 203.230.242.200이라 가정)

# vi /etc/mail/local-host-names    
mail
solaris8.pe.kr
mail.solaris8.pe.kr
:wq!

 

# vi /etc/mail/access
203.230.243  RELAY
solaris8.pe.kr RELAY
:wq!

 

# makemap dbm /etc/mail/access < /etc/mail/access  
(--> access파일 수정후 항상 위 명령을 실행해야 적용이 됩니다.)

 

8. sendmail 데몬 시작

# /usr/lib/sendmail -bd -q15m

9. 테스트
  가.버전확인
       # telnet localhost 25
        Trying 127.0.0.1...
        Connected to localhost.
        Escape character is '^]'.
        220 mail.solaris8.pe.kr ESMTP Sendmail 8.11.6+Sun/8.11.6; Mon, 21 Apr 2003 12:23:23 +0900 (KST)

   나. 메일 전송확인
      # mailx -v win2107@naver.com

       Subject : test mail
       내용적으시고, " control+D " 키 누르시면 전송됩니다.

 

----------------------------------------------------------------------------------------

[예제]

아래내용은 실제 Solaris7에서 Sendmail.8.12.9를 설치하면서 캡쳐한 내용입니다. 참고하세요

스크립트를 2003년 6월 14일 토요일 오전 09시 55분 16초에 시작


ns:/ #
ns:/ #
ns:/ #cd sendmail-8.12.9/


ns:/sendmail-8.12.9#>ls
./              INSTALL         PGPKEYS         contrib/        include/        libsmutil/      praliases/      test/
../             KNOWNBUGS       README          devtools/       libmilter/      mail.local/     rmail/          vacation/
Build*          LICENSE         RELEASE_NOTES   doc/            libsm/          mailstats/      sendmail/
FAQ             Makefile        cf/             editmap/        libsmdb/        makemap/        smrsh/
ns:/sendmail-8.12.9#>
ns:/sendmail-8.12.9#>
ns:/sendmail-8.12.9#>
ns:/sendmail-8.12.9#>./Build
Making all in:
/sendmail-8.12.9/libsm
Configuration: pfx=, os=SunOS, rel=5.7, rbase=5, rroot=5.7, arch=sun4, sfx=, variant=optimized
Using M4=/usr/local/bin/m4
Creating /sendmail-8.12.9/obj.SunOS.5.7.sun4/libsm using /sendmail-8.12.9/devtools/OS/SunOS.5.7
Making dependencies in /sendmail-8.12.9/obj.SunOS.5.7.sun4/libsm
if [ -r /usr/include/sysexits.h ]; \
then \
        ln -s /usr/include/sysexits.h; \
fi
rm -f sm_os.h
ln -f -s ../../include/sm/os/sm_os_sunos.h sm_os.h
gcc -M -I. -I../../include -DNDBM -DNIS -DNISPLUS -DMAP_REGEX -DSOLARIS=20700  assert.c debug.c errstring.c exc.c heap.c match.c rpool.c strdup.c strerror.c strl.c clrerr.c fclose.c feof.c ferror.c fflush.c fget.c fpos.c findfp.c flags.c fopen.c fprintf.c fpurge.c fput.c fread.c fscanf.c fseek.c fvwrite.c fwalk.c fwrite.c get.c makebuf.c put.c refill.c rewind.c setvbuf.c smstdio.c snprintf.c sscanf.c stdio.c strio.c ungetc.c vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c vsprintf.c vsscanf.c wbuf.c wsetup.c string.c stringf.c xtrap.c strto.c test.c path.c strcasecmp.c strrevcmp.c signal.c clock.c config.c shm.c mbdb.c strexit.c cf.c ldap.c niprop.c mpeix.c   t-event.c t-exc.c t-rpool.c t-string.c t-smstdio.c t-match.c t-strio.c t-heap.c t-fopen.c t-strl.c t-strrevcmp.c t-types.c t-path.c t-float.c t-scanf.c t-shm.c t-cf.c b-strcmp.c >> Makefile
Making in /sendmail-8.12.9/obj.SunOS.5.7.sun4/libsm
gcc -O -I. -I../../include -DNDBM -DNIS -DNISPLUS -DMAP_REGEX -DSOLARIS=20700   -c  assert.c

.....

.....

....
8.12.9/obj.SunOS.5.7.sun4/libsmutil/libsmutil.a /sendmail-8.12.9/obj.SunOS.5.7.sun4/libsm/libsm.a  -lresolv -lsocket -lnsl
groff -Tascii -man vacation.1 > vacation.0 || cp vacation.0.dist vacation.0

 

ns:/sendmail-8.12.9#>ls
./                   LICENSE              contrib/             libsm/               obj.SunOS.5.7.sun4/  vacation/
../                  Makefile             devtools/            libsmdb/             praliases/
Build*               PGPKEYS              doc/                 libsmutil/           rmail/
FAQ                  README               editmap/             mail.local/          sendmail/
INSTALL              RELEASE_NOTES        include/             mailstats/           smrsh/
KNOWNBUGS            cf/                  libmilter/           makemap/             test/
ns:/sendmail-8.12.9#>


ns:/sendmail-8.12.9#>cd obj.SunOS.5.7.sun4


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4#>ls
./           editmap/     libsmdb/     mail.local/  makemap/     rmail/       smrsh/
../          libsm/       libsmutil/   mailstats/   praliases/   sendmail/    vacation/
ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4#>


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4#>cd ..


ns:/sendmail-8.12.9#>cd cf/cf


ns:/sendmail-8.12.9/cf/cf#>ls
./                       cs-solaris2.mc           generic-linux.cf         generic-sunos4.1.cf      s2k-osf1.mc
../                      cs-sunos4.1.mc           generic-linux.mc         generic-sunos4.1.mc      s2k-ultrix4.mc
Build*                   cs-ultrix4.mc            generic-mpeix.cf         generic-ultrix4.cf       submit.cf
Makefile                 cyrusproto.mc            generic-mpeix.mc         generic-ultrix4.mc       submit.mc
README                   generic-bsd4.4.cf        generic-nextstep3.3.cf   huginn.cs.mc             tcpproto.mc
chez.cs.mc               generic-bsd4.4.mc        generic-nextstep3.3.mc   knecht.mc                ucbarpa.mc
clientproto.mc           generic-hpux10.cf        generic-osf1.cf          mail.cs.mc               ucbvax.mc
cs-hpux10.mc             generic-hpux10.mc        generic-osf1.mc          mail.eecs.mc             uucpproto.mc
cs-hpux9.mc              generic-hpux9.cf         generic-solaris.cf       mailspool.cs.mc          vangogh.cs.mc
cs-osf1.mc               generic-hpux9.mc         generic-solaris.mc       python.cs.mc
ns:/sendmail-8.12.9/cf/cf#>


ns:/sendmail-8.12.9/cf/cf#>vi generic-solaris.mc
divert(-1)
#
# Copyright (c) 1998, 1999, 2001 Sendmail, Inc. and its suppliers.
#       All rights reserved.
# Copyright (c) 1983 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.
#
#

#
#  This is a generic configuration file for SunOS 5.x (a.k.a. Solaris 2.x
#  and Solaris 7 through the present version).
#
#  It has support for local and SMTP mail only.  If you want to
#  customize it, copy it to a name appropriate for your environment
#  and do the modifications there.
#
divert(0)dnl
VERSIONID(`$Id: generic-solaris.mc,v 8.13 2001/06/27 21:46:30 gshapiro Exp $')
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
# 아래부분 추가
FEATURE(access_db,`dbm -o -T /etc/mail/access')dnl
#
MAILER(local)dnl
MAILER(smtp)dnl
...
:wq!

ns:/sendmail-8.12.9/cf/cf#>


ns:/sendmail-8.12.9/cf/cf#>/usr/local/bin/m4 ../m4/cf.m4 generic-solaris.mc > sendmail.cf
*** WARNING: missing -T<TMPF> in argument of FEATURE(`access_db', dbm -o /etc/mail/access)


ns:/sendmail-8.12.9/cf/cf#>
ns:/sendmail-8.12.9/cf/cf#>
ns:/sendmail-8.12.9/cf/cf#>
ns:/sendmail-8.12.9/cf/cf#>ls -ld sendmail.cf
-rw-r--r--   1 root     sys        53554  6월 17일  11:48 sendmail.cf


ns:/sendmail-8.12.9/cf/cf#>
ns:/sendmail-8.12.9/cf/cf#>cp sendmail.cf /etc/mail/sendmail.cf


ns:/sendmail-8.12.9/cf/cf#>cd ../..


ns:/sendmail-8.12.9#>
ns:/sendmail-8.12.9#>cd obj.SunOS.5.7.sun4/


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4#>ls
./           editmap/     libsmdb/     mail.local/  makemap/     rmail/       smrsh/
../          libsm/       libsmutil/   mailstats/   praliases/   sendmail/    vacation/


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4#>cd sendmail


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>ls -ld sendmail
-rwxr-xr-x   1 root     other     628948  6월 14일  10:00 sendmail*


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>
ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>cp sendmail /usr/lib/sendmail


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>
ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>
ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>ls -la /usr/lib/sendmail
-r-sr-xr-x   1 root     bin       628948  6월 14일  12:07 /usr/lib/sendmail*


ns:/sendmail-8.12.9/obj.SunOS.5.7.sun4/sendmail#>cd ../..


ns:/sendmail-8.12.9#>/usr/lib/sendmail -bd -q15m      

                               (물론 다 환경설정되었다는 가정하에 메일데몬을 시작한다)

                               (환경설정은 위쪽 설명 참고하세요~~)


ns:/sendmail-8.12.9#>cd /etc/mail
ns:/etc/mail#>
ns:/etc/mail#>ls -la
총 7300
drwxr-xr-x   2 root     mail        1024  6월 14일  12:08 ./
drwxr-xr-x  43 root     sys         4096  6월 17일  08:54 ../
-rw-r--r--   1 root     sys           35  4월  1일  10:38 access
-rw-r--r--   1 root     sys        40960 2001년  9월 25일 access.db
-rw-r--r--   1 root     sys            0  6월 16일  12:04 access.dir
-rw-r--r--   1 root     sys         1024  6월 16일  12:04 access.pag
-rw-r--r--   1 root     sys         1217 2002년  5월  8일 aliases
-rw-r--r--   1 root     sys            0 2001년  9월 25일 aliases.db
-rw-r--r--   1 root     sys            0 2001년  9월 25일 aliases.dir
-rw-r--r--   1 root     sys         1201 2001년  9월 25일 aliases.org
-rw-r--r--   1 root     sys         1024  4월  1일  10:40 aliases.pag
-rw-r--r--   1 root     bin         5266  1월  7일  23:59 helpfile
-rw-r--r--   1 root     bin           70  4월  1일  10:39 local-host-names
-r--r--r--   1 bin      bin        33412 2001년  9월 25일 main.cf
-rwxr-xr-x   1 root     sys        34782  4월  1일  11:17 main.cf.new*
-rwx------   1 root     sys          831 2001년  9월 25일 makemap_script*
-rw-r--r--   1 root     sys           23  4월  1일  10:39 relay-domains
-r-sr-xr-x   1 root     other     734508  6월 14일  11:57 sendmail.8.11.6.daemon*
-r-sr-xr-x   1 root     other     623968  6월 14일  11:59 sendmail.8.12.1.daemon*
-r-sr-xr-x   1 root     other     744696  6월 14일  11:56 sendmail.8.12.8.daemon*
-r-sr-xr-x   1 root     other     729936  6월 14일  12:01 sendmail.8.9.3*
-r--r--r--   1 root     sys        53554  6월 17일  11:48 sendmail.cf
-r--r--r--   1 root     other      34109  6월 14일  11:57 sendmail.cf.8.12.8
-rw-r--r--   1 root     other      53554  6월 17일  11:57 sendmail.cf.8.12.9
-r--r--r--   1 root     sys        34109  4월  1일  11:17 sendmail.cf.old
-r--r--r--   1 root     sys        34128 2001년  9월 25일 sendmail.cf.pre107684
-r--r--r--   1 root     other      34109  4월  1일  11:17 sendmail.cf.pre107684-08
lrwxrwxrwx   1 root     other          8  4월  1일  11:17 sendmail.hf -> helpfile
-rw-r--r--   1 root     sys           33  6월 17일  11:49 sendmail.pid
-r-sr-xr-x   1 root     sys       389476  3월 28일  10:59 sendmail_893_deamon*
-r--r--r--   1 bin      bin        34108 2001년  9월 25일 subsidiary.cf
-rwxr-xr-x   1 root     sys        35483  4월  1일  11:17 subsidiary.cf.new*
-rw-r--r--   1 root     bin            5 2001년  9월 25일 trusted-users
ns:/etc/mail#>cd


ns:/#>telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.co.kr ESMTP Sendmail 8.12.9/8.12.9; Tue, 17 Jun 2003 12:05:15 +0900 (KST)
quit
221 2.0.0 xxx.co.kr closing connection
Connection closed by foreign host.


ns:/#>

ns:/etc/mail#>
스크립트가 2003년 6월 14일 토요일 오후 01시 01분 30초에 완료

 

이상입니다....^^꽤 되었네요~ 이작업 했던게..요즘은 다 까먹었네여~ 열심히...

 

'OS 운영체제 및 보안 > Solaris' 카테고리의 다른 글

Solaris 한글 환경설정  (0) 2008.11.28
Solaris messages log(inetd, netbios)  (0) 2008.11.25
Solaris9 SCSI HDD 추가하기  (0) 2008.11.13
Solaris8 에서 APM 및 라이브러리 설치  (0) 2008.11.07
Solaris APM Setting  (0) 2008.11.07
Solaris 시스템 부하 측정 및 판단 참고 기준  (0) 2008.10.24
Solaris root passwoord 변경  (0) 2008.10.24
fsck 명령어  (0) 2008.10.24
DNS 셋팅  (0) 2008.10.24
Solaris 10 설치  (0) 2008.10.24