Exim4: 두 판 사이의 차이

Ubuntu Korea Community Wiki
둘러보기로 이동 검색으로 이동
imported>Drake
(새 문서: == 초보자를 위한 Exim4 설치하기 == * 작성자 coolseed@hotmail.com, http://koov.net * 이 문서는 http://debianusers.org/DebianWiki/wiki.php/exim4 의 문서가 원본입...)
 
imported>Darkcircle
 
(사용자 2명의 중간 판 21개는 보이지 않습니다)
1번째 줄: 1번째 줄:
== 초보자를 위한 Exim4 설치하기 ==
== 초보자를 위한 Exim4 설치하기 ==
* 작성자 coolseed@hotmail.com, http://koov.net
* 작성자 coolseed@hotmail.com, http://koov.net
* 이 문서는 http://debianusers.org/DebianWiki/wiki.php/exim4 의 문서가 원본입니다.
* <s>이 문서는 <nowiki>http://debianusers.org/DebianWiki/wiki.php/exim4</nowiki> 의 문서가 원본입니다.</s> 원본이 유실되어 원본 표시의 의미는 없음.
=== 초보자를 위한 Exim4 설치하기 ===
=== 초보자를 위한 Exim4 설치하기 ===
==== 목적  ====
==== 목적  ====
* 데비안 설치시 기본적으로 설치되는 Exim4 MTA를 초보자도 완벽하게 설치 할수 있도록 하는것이 이 문서의 목적이다.
데비안 설치시 기본적으로 설치되는 Exim4 MTA를 초보자도 완벽하게 설치 할수 있도록 하는것이 이 문서의 목적이다. 이 문서는 아래와 같은 조건을 기본으로 한다.
* 이 문서는 아래와 같은 조건을 기본으로 한다.
 
** 해당 서버가 메일서버로 동작한다.
* 해당 서버가 메일서버로 동작한다.
** 계정은 시스템 계정을 기본으로 한다.(가상유저 지원안함)
* 계정은 시스템 계정을 기본으로 한다.(가상유저 지원안함)
** ?POP3서비스를 제공한다.
* POP3서비스를 제공한다.
** 기본적으로 모든 릴레이는 막혀 있으며 SMTP인증을 통하여 메일을 발송한다.
* 기본적으로 모든 릴레이는 막혀 있으며 SMTP인증을 통하여 메일을 발송한다.
* 가정조
 
** 문서에 나와있는 호스트의 이름은 mail.foobar.com 이다.
가정조건은 다음과 같다
** 이 호스트는 domain.net의 메일도 수신하고 있다.
* 문서에 나와있는 호스트의 이름은 mail.foobar.com 이다.
* 이 호스트는 domain.net의 메일도 수신하고 있다.
 
==== 준비사항 ====
==== 준비사항 ====
* 우선 아래의 패키지들을 설치하도록 한다.
우선 아래의 패키지를 설치한다.
** exim4
* exim4
** qpopper
* qpopper
** sasl2-bin
* sasl2-bin
''$ apt-get install exim4 qpopper sasl2-bin''
{{TerminalWindow|{{TerminalLine|prompt=user|~|apt-get install exim4 qpopper sasl2-bin}}}}
 
==== 기본설정 ====
==== 기본설정 ====
* /etc/exim4 디렉토리에 들어가면 아래의 파일이 들어있다.
 
  ''$ ls
/etc/exim4 디렉토리에 들어가면 아래의 파일이 들어있다.
    exim4.conf.template passwd.client update-exim4.conf.conf''
 
* 우선 update-exim4.conf.conf 파일을 수정한다.
{{TerminalWindow|{{TerminalLine|prompt=user|cd /etc/exim4}}<br/>
<source lang="conf">
{{TerminalLine|prompt=user|/etc/exim4|ls}}<br/>
{{TerminalLine|prompt=msg|./&nbsp;&nbsp;&nbsp;&nbsp;../&nbsp;&nbsp;&nbsp;&nbsp;exim4.conf.template&nbsp;&nbsp;&nbsp;&nbsp;passwd.client&nbsp;&nbsp;&nbsp;&nbsp;update-exim4.conf.conf}}}}
 
우선 update-exim4.conf.conf 파일을 수정한다.
 
<source lang="bash">
# /etc/exim4/update-exim4.conf.conf
# /etc/exim4/update-exim4.conf.conf
#
#
43번째 줄: 51번째 줄:
# This is a Debian specific file
# This is a Debian specific file
dc_eximconfig_configtype='internet'
dc_eximconfig_configtype='internet'
dc_other_hostnames='foobar.com:domain.net' # FQDN 이부분에 메일도메인을 적어준다. 여러개의 도메인을 운영중이라면 : 로 구분한다.
dc_other_hostnames='foobar.com:domain.net' # FQDN 이부분에 메일도메인을 적어준다. 여러 개의 도메인을 운영한다면 : 로 구분한다.
dc_local_interfaces='' # 이부분은 접속허용가능호스트를 적어준다. 기본적으로 모든 메일을 받아야 하므로 비워둔다.
dc_local_interfaces='' # 이부분은 접속 가능 호스트를 적어준다. 기본적으로 모든 메일을 받아야 하므로 비워둔다.
dc_readhost=''
dc_readhost=''
dc_relay_domains='' # 다른곳으로 릴레이 시킬 도메인을 적는부분이다. 비워둔다.
dc_relay_domains='' # 다른곳으로 릴레이 할 도메인을 적는 부분이다. 비워둔다.
dc_minimaldns='false'
dc_minimaldns='false'
dc_relay_nets=''
dc_relay_nets=''
53번째 줄: 61번째 줄:
dc_use_split_config='false'
dc_use_split_config='false'
dc_hide_mailname=''
dc_hide_mailname=''
dc_mailname_in_oh='true' ''
dc_mailname_in_oh='true'
* 자 위와같이 수정한후 아래의 명령을 실행하면 exim config파일이 자동으로 생성된다.
</source>
''$ update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf''
 
''$ ls /etc/exim4
자 위와같이 수정한 후 아래의 명령을 실행하면 exim config파일이 자동으로 생성된다.
./ ../ conf.d/ exim4.conf exim4.conf.template passwd.client update-exim4.conf.conf''
 
* 여기까지가 기본적인 Exim4의 설정단계이다. 이렇게 하면 기본적으로 메일을 받는것은 문제 없이 될것이다.
{{TerminalWindow|{{TerminalLine|prompt=root|exim4|update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf}}<br/>
* 아울러 ?POP3또한 qpopper패키지를 설치하게 되면 별다른 설정없이 ?POP3서비스를 이용할수 있다.
{{TerminalLine|prompt=root|exim4|ls /etc/exim4}}<br/>
{{TerminalLine|prompt=msg|./&nbsp;&nbsp;&nbsp;&nbsp;../&nbsp;&nbsp;&nbsp;&nbsp;conf.d/&nbsp;&nbsp;&nbsp;&nbsp;exim4.conf&nbsp;&nbsp;&nbsp;&nbsp;exim4.conf.template&nbsp;&nbsp;&nbsp;&nbsp;passwd.client&nbsp;&nbsp;&nbsp;&nbsp;update-exim4.conf.conf}}}}
 
* 여기까지가 기본적인 Exim4의 설정단계이다. 이렇게 하면 기본적으로 메일 수신은 문제 없다.
* 아울러 POP3또한 qpopper패키지를 설치하면 별다른 설정없이 POP3서비스를 이용할수 있다.
 
==== SMTP인증 ====
==== SMTP인증 ====
* 이제 메일을 보내는 작업을 하게 될것이다.
이제 메일을 보낼 준비를 하겠다. 일반적으로 모든 메일서버는 무분별한 스팸을 막기 위해 릴레이를 제한해야 한다. 가끔 개념이 없는 관리자는 이런 기본을 무시하고 메일서버를 대충 설치하는데, 이럴 경우 스패머들이 해당 서버로 엄청난 양의 스팸 메일을 뿌려 네트워크 대역폭을 낭비한다. 따라서 서버의 릴레이를 제한하고 인증된 사용자만이 메일을 보낼수 있도록 설정한다.
* 일반적으로 모든 메일서버는 릴레이를 제한하여야 하는데 그 이유는 무분별한 스팸메일을 막기 위해서 이다.
맨 처음에 설치한 패키지중 sasl2-bin 패키지가 이러한 경우 SMTP인증을 처리해주는 데몬 패키지다. 그 첫번째 단계로 우선 Exim4의 설정을 SMTP인증으로 변경하는 작업을 해보도록 하자. /etc/exim4/exim4.conf.template 파일을 연다.
* 그러나 가끔 개념이 없는 관리자는 이런것을 무시하고 메일서버를 대충 설치하는 경우 해당 서버가 스패머들에의해
 
* 엄청난양의 스팸메일을 뿌리거나 네트워크 대역폭을 낭비하는 경우가 생긴다.
{{TerminalWindow|{{TerminalLine|prompt=root|~|vi /etc/exim4/exim4.conf.template}}}}
* 따라서 서버의 릴레이를 제한하고 인증된 사용자만이 메일을 보낼수 있도록 셋팅하도록 한다.
 
* 맨처음에 설치한 패키지중 sasl2-bin 패키지가 이러한 SMTP인증을 해주는 데몬 패키지 이다.
그 다음 아래와 같이 주석처리된 부분을 제거한다.
* 그 첫번째 단계로 우선 Exim4의 설정을 SMTP인증으로 변경하는 작업을 해보도록 하자
 
* /etc/exim4/exim4.conf.template 파일을 연다.
<source lang="bash">
''$ vi /etc/exim4/exim4.conf.template''
.......상단생략.......
* 위의 화일을 열어 아래와같이 주석처리된 부분을 제거한다.
''.......상단생략.......
# Authenticate against local passwords using sasl2-bin
# Authenticate against local passwords using sasl2-bin
# Requires exim_uid to be a member of sasl group, see README.SMTP-AUTH
# Requires exim_uid to be a member of sasl group, see README.SMTP-AUTH
96번째 줄: 107번째 줄:
#  .endif
#  .endif
#
#
## 이하 모든 아래내용은 주석처리 하도록 한다. ##''
## 이하 모든 아래 내용 주석처리
* 위와같이 exim4.conf.template화일을 수정한후
</source>
''$ update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf''
 
* 명령을 다시 해주어 exim4.conf화일을 재생성한다.
위와 같이 exim4.conf.template화일을 수정한 후
* 그리고 /etc/group 파일을 열어 Debian-exim유저를 sasl그룹에 포함시켜준다.
 
''root:x:0:
{{TerminalWindow|{{TerminalLine|prompt=root|~|update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf}}}}
 
명령을 다시 실행하여 exim4.conf화일을 다시 만든다. 그리고 /etc/group 파일을 열어 Debian-exim 사용자를 sasl그룹에 포함한다.
 
<source lang="bash">
root:x:0:
daemon:x:1:
daemon:x:1:
bin:x:2:
bin:x:2:
134번째 줄: 150번째 줄:
utmp:x:43:
utmp:x:43:
video:x:44:
video:x:44:
sasl:x:45:Debian-exim          # 여기에 추가시켜준다.
sasl:x:45:Debian-exim          # 여기에 추가
plugdev:x:46:
plugdev:x:46:
staff:x:50:
staff:x:50:
149번째 줄: 165번째 줄:
scanner:x:108:
scanner:x:108:
saned:x:109:
saned:x:109:
gdm:x:110: ''
gdm:x:110:
* sasl 데몬을 기동하기 위해 아래의 파일을 수정한다.
</source>
''$ vi /etc/default/saslauthd''
 
''# This needs to be uncommented before saslauthd will be run automatically
아래의 파일을 수정하여 sasl 데몬 기동을 준비한다.
 
{{TerminalWindow|{{TerminalLine|prompt=root|~|vi /etc/default/saslauthd}}}}
 
<source lang="bash">
# This needs to be uncommented before saslauthd will be run automatically
# START=yes
# START=yes
# You must specify the authentication mechanisms you wish to use.
# You must specify the authentication mechanisms you wish to use.
159번째 줄: 180번째 줄:
# MECHANISMS="pam shadow"
# MECHANISMS="pam shadow"
START="yes"  # 데몬을 가동하기 위해 추가한다.
START="yes"  # 데몬을 가동하기 위해 추가한다.
MECHANISMS="pam shadow" # 기본적인 password방식은 shadow이므로 shadow만 있어도 상관 없다.''
MECHANISMS="pam shadow"
* 이제 exim4와 sasl데몬을 재시작 하도록 한다.
# 기본적인 password방식은 shadow이므로 shadow만 설정해도 상관없다.
''$ /etc/init.d/saslauthd restart ''
</source>
''Stopping SASL Authentication Daemon: saslauthd.
 
Starting SASL Authentication Daemon: saslauthd.''
이제 exim4와 sasl데몬을 다시 시작한다.
''$ /etc/init.d/exim4 restart
{{TerminalWindow|{{TerminalLine|prompt=root|~|/etc/init.d/saslauthd restart}}<br/>
Restarting MTA: exim4.''
{{TerminalLine|prompt=msg|Stopping SASL Authentication Daemon: saslauthd.}}<br/>
* 마지막으로 모든 설정이 제대로 되었는지 확인하기 위해 메일이 잘 오가는지 테스트 해보도록 한다.
{{TerminalLine|prompt=msg|Starting SASL Authentication Daemon: saslauthd.}}<br/>
* 아울러 릴레이가 제대로 막혀 있는지 확인또한 철저히 하여 불필요한 스팸메일을 발송하지 못하도록 한다.
{{TerminalLine|prompt=root|~|/etc/init.d/exim4 restart}}<br/>
{{TerminalLine|prompt=msg|Restarting MTA: exim4.}}}}
 
마지막으로 모든 설정이 제대로 되었는지 확인하기 위해 메일이 잘 오가는지 테스트 해보도록 한다. 또한, 릴레이가 제대로 막혀 있는지 확인을 철저히 하여 불필요한 스팸메일을 보내지 못하도록 한다.
 
==== 릴레이 테스트 ====
==== 릴레이 테스트 ====
* 릴레이 테스트는 아래의 페이지에서 간단하게 할 수 있다.
릴레이 테스트는 아래 페이지에서 간단하게 할 수 있다.
 
http://people.kldp.org/~eunjea/relay-test.php
http://people.kldp.org/~eunjea/relay-test.php
=== 마무리 ===
=== 마무리 ===
* 이상으로 Exim4의 가장 기본적인 설정을 마무리하도록 한다.
이상으로 Exim4의 가장 기본적인 설정을 마무리하도록 한다. 기타 문서에 대한 교정이나 내용의 문의사항은 아래로 연락바란다.
* 기타 문서에 대한 교정이나 내용의 문의사항은 아래로 연락바랍니다.
 
* Email & MSN : [[coolseed@hotmail.com]]
* Email & MSN : [mailto:coolseed@hotmail.com coolseed@hotmail.com]
* 문체 수정/정리 : [mailto:darkcircle.0426@gmail.com darkcircle.0426@gmail.com]

2015년 7월 28일 (화) 15:05 기준 최신판

초보자를 위한 Exim4 설치하기[편집]

  • 작성자 coolseed@hotmail.com, http://koov.net
  • 이 문서는 http://debianusers.org/DebianWiki/wiki.php/exim4 의 문서가 원본입니다. 원본이 유실되어 원본 표시의 의미는 없음.

초보자를 위한 Exim4 설치하기[편집]

목적[편집]

데비안 설치시 기본적으로 설치되는 Exim4 MTA를 초보자도 완벽하게 설치 할수 있도록 하는것이 이 문서의 목적이다. 이 문서는 아래와 같은 조건을 기본으로 한다.

  • 해당 서버가 메일서버로 동작한다.
  • 계정은 시스템 계정을 기본으로 한다.(가상유저 지원안함)
  • POP3서비스를 제공한다.
  • 기본적으로 모든 릴레이는 막혀 있으며 SMTP인증을 통하여 메일을 발송한다.

가정조건은 다음과 같다

  • 문서에 나와있는 호스트의 이름은 mail.foobar.com 이다.
  • 이 호스트는 domain.net의 메일도 수신하고 있다.

준비사항[편집]

우선 아래의 패키지를 설치한다.

  • exim4
  • qpopper
  • sasl2-bin

{{#ifeq: msg|user|~|{{#ifeq: misc|user|~  apt-get install exim4 qpopper sasl2-bin|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  apt-get install exim4 qpopper sasl2-bin}}}}

기본설정[편집]

/etc/exim4 디렉토리에 들어가면 아래의 파일이 들어있다.

{{#ifeq: msg|user|cd /etc/exim4|{{#ifeq: misc|user|cd /etc/exim4  {{{2}}}|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} cd /etc/exim4 {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  {{{2}}}}}}}
{{#ifeq: msg|user|/etc/exim4|{{#ifeq: misc|user|/etc/exim4  ls|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} /etc/exim4 {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  ls}}}}
{{#ifeq: msg|msg|./    ../    exim4.conf.template    passwd.client    update-exim4.conf.conf|{{#ifeq: misc|msg|./    ../    exim4.conf.template    passwd.client    update-exim4.conf.conf  {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} ./    ../    exim4.conf.template    passwd.client    update-exim4.conf.conf {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}}  {{{2}}}}}}}

우선 update-exim4.conf.conf 파일을 수정한다.

<source lang="bash">

  1. /etc/exim4/update-exim4.conf.conf
  2. Edit this file and /etc/mailname by hand and execute update-exim4.conf
  3. yourself or use 'dpkg-reconfigure exim4-config'
  4. Please note that this is _not_ a dpkg-conffile and that automatic changes
  5. to this file might happen. The code handling this will honor your local
  6. changes, so this is usually fine, but will break local schemes that mess
  7. around with multiple versions of the file.
  8. update-exim4.conf uses this file to determine variable values to replace
  9. the DEBCONFsomethingDEBCONF strings in the configuration template files.
  10. Most settings found in here do have corresponding questions in the
  11. Debconf configuration, but not all of them.
  12. This is a Debian specific file

dc_eximconfig_configtype='internet' dc_other_hostnames='foobar.com:domain.net' # FQDN 이부분에 메일도메인을 적어준다. 여러 개의 도메인을 운영한다면 : 로 구분한다. dc_local_interfaces= # 이부분은 접속 가능 호스트를 적어준다. 기본적으로 모든 메일을 받아야 하므로 비워둔다. dc_readhost= dc_relay_domains= # 다른곳으로 릴레이 할 도메인을 적는 부분이다. 비워둔다. dc_minimaldns='false' dc_relay_nets= dc_smarthost= CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname= dc_mailname_in_oh='true' </source>

자 위와같이 수정한 후 아래의 명령을 실행하면 exim config파일이 자동으로 생성된다.

{{#ifeq: msg|root|exim4|{{#ifeq: misc|root|exim4  update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} exim4 {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf}}}}
{{#ifeq: msg|root|exim4|{{#ifeq: misc|root|exim4  ls /etc/exim4|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} exim4 {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  ls /etc/exim4}}}}
{{#ifeq: msg|msg|./    ../    conf.d/    exim4.conf    exim4.conf.template    passwd.client    update-exim4.conf.conf|{{#ifeq: misc|msg|./    ../    conf.d/    exim4.conf    exim4.conf.template    passwd.client    update-exim4.conf.conf  {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} ./    ../    conf.d/    exim4.conf    exim4.conf.template    passwd.client    update-exim4.conf.conf {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}}  {{{2}}}}}}}

  • 여기까지가 기본적인 Exim4의 설정단계이다. 이렇게 하면 기본적으로 메일 수신은 문제 없다.
  • 아울러 POP3또한 qpopper패키지를 설치하면 별다른 설정없이 POP3서비스를 이용할수 있다.

SMTP인증[편집]

이제 메일을 보낼 준비를 하겠다. 일반적으로 모든 메일서버는 무분별한 스팸을 막기 위해 릴레이를 제한해야 한다. 가끔 개념이 없는 관리자는 이런 기본을 무시하고 메일서버를 대충 설치하는데, 이럴 경우 스패머들이 해당 서버로 엄청난 양의 스팸 메일을 뿌려 네트워크 대역폭을 낭비한다. 따라서 서버의 릴레이를 제한하고 인증된 사용자만이 메일을 보낼수 있도록 설정한다.
맨 처음에 설치한 패키지중 sasl2-bin 패키지가 이러한 경우 SMTP인증을 처리해주는 데몬 패키지다. 그 첫번째 단계로 우선 Exim4의 설정을 SMTP인증으로 변경하는 작업을 해보도록 하자. /etc/exim4/exim4.conf.template 파일을 연다.

{{#ifeq: msg|root|~|{{#ifeq: misc|root|~  vi /etc/exim4/exim4.conf.template|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  vi /etc/exim4/exim4.conf.template}}}}

그 다음 아래와 같이 주석처리된 부분을 제거한다.

<source lang="bash"> .......상단생략.......

  1. Authenticate against local passwords using sasl2-bin
  2. Requires exim_uid to be a member of sasl group, see README.SMTP-AUTH

plain_saslauthd_server: driver = plaintext public_name = PLAIN server_condition = ${if saslauthd{{$2}{$3}}{1}{0}} server_set_id = $2 server_prompts = :

  1. .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  2. server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
  3. .endif

login_saslauthd_server: driver = plaintext public_name = LOGIN server_prompts = "Username:: : Password::"

  1. don't send system passwords over unencrypted connections
  2. server_advertise_condition = ${if eq{$tls_cipher}{}{0}{1}}

server_condition = ${if saslauthd{{$1}{$2}}{1}{0}} server_set_id = $1

  1. .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  2. server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
  3. .endif
    1. 이하 모든 아래 내용 주석처리

</source>

위와 같이 exim4.conf.template화일을 수정한 후

{{#ifeq: msg|root|~|{{#ifeq: misc|root|~  update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf}}}}

명령을 다시 실행하여 exim4.conf화일을 다시 만든다. 그리고 /etc/group 파일을 열어 Debian-exim 사용자를 sasl그룹에 포함한다.

<source lang="bash"> root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4: tty:x:5: disk:x:6: lp:x:7: mail:x:8: news:x:9: uucp:x:10: man:x:12: proxy:x:13: kmem:x:15: dialout:x:20: fax:x:21: voice:x:22: cdrom:x:24:hal floppy:x:25:hal tape:x:26: sudo:x:27: audio:x:29: dip:x:30: www-data:x:33: backup:x:34: operator:x:37: list:x:38: irc:x:39: src:x:40: gnats:x:41: shadow:x:42: utmp:x:43: video:x:44: sasl:x:45:Debian-exim # 여기에 추가 plugdev:x:46: staff:x:50: games:x:60: users:x:100: nogroup:x:65534: crontab:x:101: Debian-exim:x:102: ssh:x:103: messagebus:x:104: dirmngr:x:105: hal:x:106: camera:x:107: scanner:x:108: saned:x:109: gdm:x:110: </source>

아래의 파일을 수정하여 sasl 데몬 기동을 준비한다.

{{#ifeq: msg|root|~|{{#ifeq: misc|root|~  vi /etc/default/saslauthd|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  vi /etc/default/saslauthd}}}}

<source lang="bash">

  1. This needs to be uncommented before saslauthd will be run automatically
  2. START=yes
  3. You must specify the authentication mechanisms you wish to use.
  4. This defaults to "pam" for PAM support, but may also include
  5. "shadow" or "sasldb", like this:
  6. MECHANISMS="pam shadow"

START="yes" # 데몬을 가동하기 위해 추가한다. MECHANISMS="pam shadow"

  1. 기본적인 password방식은 shadow이므로 shadow만 설정해도 상관없다.

</source>

이제 exim4와 sasl데몬을 다시 시작한다.

{{#ifeq: msg|root|~|{{#ifeq: misc|root|~  /etc/init.d/saslauthd restart|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  /etc/init.d/saslauthd restart}}}}
{{#ifeq: msg|msg|Stopping SASL Authentication Daemon: saslauthd.|{{#ifeq: misc|msg|Stopping SASL Authentication Daemon: saslauthd.  {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} Stopping SASL Authentication Daemon: saslauthd. {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}}  {{{2}}}}}}}
{{#ifeq: msg|msg|Starting SASL Authentication Daemon: saslauthd.|{{#ifeq: misc|msg|Starting SASL Authentication Daemon: saslauthd.  {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} Starting SASL Authentication Daemon: saslauthd. {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}}  {{{2}}}}}}}
{{#ifeq: msg|root|~|{{#ifeq: misc|root|~  /etc/init.d/exim4 restart|{{#ifeq: root|root|ubuntu-korea|{{#ifeq: user|root|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|root|#|{{#ifeq: user|root|$|$}}}}  /etc/init.d/exim4 restart}}}}
{{#ifeq: msg|msg|Restarting MTA: exim4.|{{#ifeq: misc|msg|Restarting MTA: exim4.  {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} Restarting MTA: exim4. {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}}  {{{2}}}}}}}

마지막으로 모든 설정이 제대로 되었는지 확인하기 위해 메일이 잘 오가는지 테스트 해보도록 한다. 또한, 릴레이가 제대로 막혀 있는지 확인을 철저히 하여 불필요한 스팸메일을 보내지 못하도록 한다.

릴레이 테스트[편집]

릴레이 테스트는 아래 페이지에서 간단하게 할 수 있다.

http://people.kldp.org/~eunjea/relay-test.php

마무리[편집]

이상으로 Exim4의 가장 기본적인 설정을 마무리하도록 한다. 기타 문서에 대한 교정이나 내용의 문의사항은 아래로 연락바란다.