내가 갖고 있는 도메인(firstdedicated.co.kr)으로 내가 소유한 서버에서 메일을 보내고 받을 수 있게 설정해 보자.
제일먼저 확인해야 할 것은 도메인이 사용하는 네임서버의 zone 파일에서 mx 레코드가 내 서버의 ip로 연결되어 있어야 한다.

firstdedicated.co.kr 도메인의 MX레코드가 아래와 같이 설정 되어있다.

                MX      10 mail
mail            A       192.168.0.16

그럼 이제부터 192.168.0.16의 서버에서 xxx@firstdedicated.co.kr의 주소로 들어오는 메일을 받을수 있게 설정해 보자.

* 받는 메일서버 설정

메일을 받기 위해서는 우선 pop3 데몬이 떠 있어야 한다. xinetd.d 디렉토리내에 ipop3d 를 사용한다면 별 어려움 없이 pop3데몬을 띄울수 있다.
기본적으로 제공되는 ipop3 데몬을 띄우기 위해서 /etc/xinetd.d/ipop3d 파일을 편집기로 열고 disable = yes 부분만 disable = no로 변경시키고 xinetd 데몬을 리스타트 하면 된다.

1. /etc/xinetd.d/ipop3d 파일 수정.

[root@localhost root]# cat /etc/xinetd.d/ipop3d
service pop3
{
       disable = no
       socket_type     = stream
       wait    = no
       user    = root
       server  = /usr/sbin/ipop3d
       log_on_success  += USERID
       log_on_failure  += USERID
}

2. xinetd 데몬 리스타트

[root@localhost root]# /etc/rc.d/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

3. 110번 포트 확인

[root@localhost root]# netstat -nat | grep LISTEN | grep 110
tcp        0      0 0.0.0.0:110            0.0.0.0:*               LISTEN

4. /etc/mail/local-host-names 파일에 메일을 사용할 도메인 추가한 후 sendmail 데몬 리스타트

[root@localhost root]# cat /etc/mail/local-host-names
firstdedicated.co.kr
[root@localhost root]# /etc/rc.d/init.d/sendmail restart
Shutting down sendmail:                                    [  OK  ]
Shutting down sm-client:                                   [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]

이상의 설정만 하면 메일을 받을수 있게 된다. useradd명령으로 계정을 추가하고 메일을 사용하면 된다.


* 보내는 메일서버 설정

위의 설정은 메일을 받기만 할수 있도록 설정한 것이다.
내 서버(192.168.0.16) 에서 메일을 보낼수 있도록 설정을 하는것 역시 별 어려움 없이 할수 있다.
sendmail 설정파일(/etc/sendmail.cf)에는 기본적으로 smtp가 닫혀 있도록 설정이 되어 있다.
smtp를 열어놓기 위해서는 sendmail.cf 파일에서 한줄만 수정하면 된다.

1. sendmail.cf 수정

sendmail.cf 파일에서 아래부분을 찾아 주석(#)을 제거하고 sendmail을 리스타트 하면 smtp가 열리게 된다. 그런데 아래에서 주석만 제거할 경우는 localhost, 즉 서버내에서만 mail command로 메일을 발송할수 있고 원격에서 아웃룩 등으로 연결해서 사용할수가 없게 된다. 아웃룩 등으로 서버에 접속해서 메일을 보낼수 있게 설정하려면 Addr=127.0.0.1 부분을 삭제 하면 된다.

#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
--->  O DaemonPortOptions=Port=smtp, Name=MTA  (수정)

2. sendmail 리스타트

[root@localhost root]# /etc/rc.d/init.d/sendmail restart
Shutting down sendmail:                                    [  OK  ]
Shutting down sm-client:                                   [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]

"Addr=127.0.0.1"을 삭제하지 않고 localhost만 smtp가 열렸을때는 아래와 같이 127.0.0.1의 주소에 대해서만 LISTEN 된다.
[root@localhost mail]# netstat -nat | grep LISTEN | grep 25
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN

"Addr=127.0.0.1"을 삭제하여 smtp가 완전히 열렸을때는 아래와 같이 모든주소(0.0.0.0)에 대해서 LISTEN 된다.
[root@localhost mail]# netstat -nat | grep LISTEN | grep 25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN

위와 같이 smtp가 완전히 허용된 경우, 아웃룩등의 메일 클라이언트 프로그램을 이용해서 메일을 발송할 수 있게 된다.
그런데 위와 같이 smtp를 열어놓을 경우는 어디에서나 smtp를 이용할수 있게 되기 때문에 spam 메일이 릴레이가 될 가능성이 높다.
spam 릴레이를 방지하기 위해서 서버내에 존재하는 계정으로 인증을 거쳐서 메일을 발송하도록, auth-smtp설정을 하면 된다.
이 또한 간단하게 수정이 가능하다.
sendmail.cf 파일에서 MD5 가 들어가는줄을 찾아서 주석을 제거해 주면 서버내에 존재하는 계정으로 인증을 거쳐야만 메일을 발송할 수 있도록 설정된다.

3. auth-smtp 설정

#O AuthMechanisms=GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
---> O AuthMechanisms=GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5

sendmail.cf를 수정했을 경우는 반드시 sendmail 데몬을 리스타트 해야 적용되게 된다. 마찬가지로, auth-smtp 설정을 했을때도 sendmail데몬을 리스타트 하면 적용되게 된다.
auth-smtp를 설정한 경우는 아웃룩을 사용할때, 보내는 서버의 "인증 필요" 부분을 체크하고 사용하면 된다.



* 보내는 메일 서버 설정시 sendmail.cf 파일을 수정하지 않고 /etc/mail/sendmail.mc 파일을 이용해서 sendmail.cf 파일을 새로 생성해서 사용할 수도 있다.  sendmail.cf 파일을 수정해서 sendmail을 재 구동했을때, 정상적으로 동작하지 않는다면 아래의 방법을 이용해 보기 바란다.

/etc/sendmail.cf 파일을 /etc/sendmail.cf.old로 변경해 놓고 작업을 시작한다.

1. /etc/mail/sendmail.mc에서 아래와 같이 수정한다.

  - auth-smtp 설정부분

dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
-> TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl    (앞의 dnl 삭제)

dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
-> define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl   (앞의 dnl 삭제)

- mail 릴레이 설정 부분

dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
-> DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl      (주석 제거 및 Addr 부분 수정)


2. m4 명령으로 sendmail.cf 파일 다시 생성한다.

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

3. sendmail 리스타트

[root@localhost root]# /etc/rc.d/init.d/sendmail restart
Shutting down sendmail:                                    [  OK  ]
Shutting down sm-client:                                   [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]

Trackback Address :: http://www.fduser.org/blog/trackback/28

  1. Tracked from sondra locke nude 2009/04/10 15:00 삭제

    Subject: sondra locke nude

    quaker steak lube restaurant <a href="http://egehudypuqacupo8832008.blogspot.com/">quaker steak lube restaurant</a>
  2. Tracked from connors pantyhose 2009/04/12 20:04 삭제

    Subject: connors pantyhose

    avatar katara naked <a href="http://udymaxuuuxolir6272008.blogspot.com/">avatar katara naked</a>
  3. Tracked from young naked teens 2009/04/14 12:48 삭제

    Subject: young naked teens

    exploited drunk teens <a href="http://neduwacocabi7002008.blogspot.com/">exploited drunk teens</a>
  4. Tracked from Clips Of Teen Sex 2009/04/16 20:54 삭제

    Subject: Clips Of Teen Sex

    Sex Offender List <a href="http://kalozu9852008.blogspot.com/">Sex Offender List</a>
  5. Tracked from asian lesbian porn 2009/04/20 19:44 삭제

    Subject: asian lesbian porn

    hilary duffs boobs <a href="http://asexusauat3832008.blogspot.com/">hilary duffs boobs</a>
  6. Tracked from shawnee smith sexy pics 2009/04/22 19:46 삭제

    Subject: shawnee smith sexy pics

    mistress legba <a href="http://eboladip1262008.blogspot.com/">mistress legba</a>
  7. Tracked from eufrat hardcore 2009/04/22 19:47 삭제

    Subject: eufrat hardcore

    leesburg implant dentist <a href="http://ouawugikubuke7402008.blogspot.com/">leesburg implant dentist</a>
  8. Tracked from biggest boobs inthe world 2009/04/22 22:13 삭제

    Subject: biggest boobs inthe world

    36ddd bras <a href="http://yjauaf8012008.blogspot.com/">36ddd bras</a>
  9. Tracked from free latina porn 2009/04/23 13:48 삭제

    Subject: free latina porn

    incredimail adult letters <a href="http://olaredohu5632008.blogspot.com/">incredimail adult letters</a>
  10. Tracked from sore throat formaldehyde 2009/04/23 16:45 삭제

    Subject: sore throat formaldehyde

    adult baby source <a href="http://jilonutuuerikufi3032008.blogspot.com/">adult baby source</a>
  11. Tracked from free adult movie clips 2009/04/27 15:25 삭제

    Subject: free adult movie clips

    nude college men <a href="%url">nude college men</a>
  12. Tracked from free adult search engines 2009/04/27 15:37 삭제

    Subject: free adult search engines

    skinny girls <a href="%url">skinny girls</a>
  13. Tracked from free adult sex videos 2009/04/27 15:59 삭제

    Subject: free adult sex videos

    free sex web cam <a href="%url">free sex web cam</a>
  14. Tracked from 1 free porn site 2009/04/27 18:40 삭제

    Subject: 1 free porn site

    russian child nude models <a href="http://iuilupyq1082008.blogspot.com/">russian child nude models</a>
  15. Tracked from 1000 bikinis 2009/04/27 19:00 삭제

    Subject: 1000 bikinis

    asu girls <a href="http://oqyfalygocyr4842008.blogspot.com/">asu girls</a>
  16. Tracked from 3pic teens 2009/04/27 20:38 삭제

    Subject: 3pic teens

    krystal forscutt nude <a href="http://kunyf3542008.blogspot.com/">krystal forscutt nude</a>
  17. Tracked from 1929 girls high yearbook boston massachusetts 2009/04/27 21:58 삭제

    Subject: 1929 girls high yearbook boston massachusetts

    joely fisher nude pics <a href="http://moselycerilir8772008.blogspot.com/">joely fisher nude pics</a>
  18. Tracked from 1977 girl scout murders 2009/04/27 22:28 삭제

    Subject: 1977 girl scout murders

    russian nude personals <a href="http://udunytutylawo4602008.blogspot.com/">russian nude personals</a>
  19. Tracked from 2 girls 1 finger video 2009/04/27 22:51 삭제

    Subject: 2 girls 1 finger video

    criss angel nude <a href="http://isirohypiteriu8752008.blogspot.com/">criss angel nude</a>
  20. Tracked from 4 girls fingerpainting 2009/04/27 23:09 삭제

    Subject: 4 girls fingerpainting

    teen black and pink bedding <a href="http://usej5042008.blogspot.com/">teen black and pink bedding</a>
  21. Tracked from 3000 gay pics 2009/04/27 23:33 삭제

    Subject: 3000 gay pics

    teen girls peeing <a href="http://opekyquqygyh2082008.blogspot.com/">teen girls peeing</a>
  22. Tracked from 34dd teen 2009/04/27 23:56 삭제

    Subject: 34dd teen

    ff7 porn <a href="http://cyxaneuauyl9062008.blogspot.com/">ff7 porn</a>
  23. Tracked from 3d girls 2009/04/28 00:22 삭제

    Subject: 3d girls

    sexy bikini <a href="http://zyquhuj2222008.blogspot.com/">sexy bikini</a>
  24. Tracked from masive cocks 2009/04/28 13:17 삭제

    Subject: masive cocks

    rectal thermometer fetish <a href="http://eku8662009.blogspot.com/">rectal thermometer fetish</a>
  25. Tracked from Juarez Breast Reconstruction96 2009/04/28 20:25 삭제

    Subject: Juarez Breast Reconstruction96

    Neutrogena Ultra Sheer Samples25 <a href="http://hadobycuxegyhuza3662009.blogspot.com/">Neutrogena Ultra Sheer Samples25</a>
  26. Tracked from edywucivir ug 2009/05/03 23:45 삭제

    Subject: edywucivir ug

    wybyhugarev <a href="http://ymudywauirew5092009.blogspot.com/">wybyhugarev</a>
  27. Tracked from vecyjou 2009/05/04 00:00 삭제

    Subject: vecyjou

    wybyhugarev <a href="http://ojiqozosezaceciv8672009.blogspot.com/">wybyhugarev</a>
  28. Tracked from teen girls naked 2009/05/05 13:02 삭제

    Subject: teen girls naked

    teen hitch hikers <a href="http://uzaxecypehizuwo8722009.blogspot.com/">teen hitch hikers</a>
  29. Tracked from sex with my dog 2009/05/05 13:10 삭제

    Subject: sex with my dog

    girls fingering themselves <a href="http://hynegouir4282009.blogspot.com/">girls fingering themselves</a>
  30. Tracked from carrie underwood nude 2009/05/05 13:41 삭제

    Subject: carrie underwood nude

    female model young teens <a href="http://nogovagimeuolor3312009.blogspot.com/">female model young teens</a>
  31. Tracked from nude male wrestling 2009/05/05 16:38 삭제

    Subject: nude male wrestling

    animals mating teens <a href="http://ipanurapuxenuwe8982009.blogspot.com/">animals mating teens</a>
  32. Tracked from gay nude men 2009/05/05 17:04 삭제

    Subject: gay nude men

    girls without bras <a href="http://cufememiuibik5132009.blogspot.com/">girls without bras</a>
  33. Tracked from free celeb porn 2009/05/06 12:34 삭제

    Subject: free celeb porn

    traci bingham nude <a href="http://eruuicysylirub2302009.blogspot.com/">traci bingham nude</a>
  34. Tracked from free homemade porn videos 2009/05/06 12:38 삭제

    Subject: free homemade porn videos

    free gay sex pictures <a href="http://beuocucyuufon4082009.blogspot.com/">free gay sex pictures</a>
  35. Tracked from free porn clips 89 2009/05/06 16:31 삭제

    Subject: free porn clips 89

    nifty gay male stories <a href="http://hukacemihuhicy6102009.blogspot.com/">nifty gay male stories</a>
  36. Tracked from ladyboy lusi 2009/05/07 14:14 삭제

    Subject: ladyboy lusi

    lactulose enema <a href="http://kipulyhypubuu8492009.blogspot.com/">lactulose enema</a>
  37. Tracked from midgit porn 2009/05/07 18:36 삭제

    Subject: midgit porn

    undergear hunks <a href="http://qipojozaxekogahe3722009.blogspot.com/">undergear hunks</a>
  38. Tracked from xxx movie clips 2009/05/09 04:41 삭제

    Subject: xxx movie clips

    angels nude africa <a href="http://abibiwow8842009.blogspot.com/">angels nude africa</a>


◀ PREV : [1] : .. [56] : [57] : [58] : [59] : [60] : [61] : [62] : [63] : [64] : .. [84] : NEXT ▶