====== Exim ====== ===== 개요 ===== Exim 은 Debian Linux 에 기본으로 설치되는 SMTP 서버이다. 타 OS 에 기본설치되는 sendmail 에 비해서 설정하기가 용이하다. ===== 설치방법 (1) ===== 가장 간단한 메일시스템을 구현해보자. SMTP(인증:시스템사용자), POP3, IMAP, 시스템계정 ==== 패키지 설치 ==== 다음과 같이 패키지를 설치한다. # apt-get install exim4 exim4-daemon-heavy qpopper uw-imapd sasl2-bin /etc/exim4 에 있는 update-exim4.conf.conf 을 수정한다. dc_eximconfig_configtype='internet' dc_other_hostnames='winesoft.co.kr' # FQDN 이부분에 메일도메인을 적어준다. 여러개의 도메인을 운영중이라면 : 로 구분한다. dc_local_interfaces='' # 이부분은 접속허용가능호스트를 적어준다. 기본적으로 모든 메일을 받아야 하므로 비워둔다. dc_readhost='' dc_relay_domains='' # 다른곳으로 릴레이 시킬 도메인을 적는부분이다. 비워둔다. dc_minimaldns='true' dc_relay_nets='' # 모든 host의 릴레이를 허용하지 않는다. dc_smarthost='' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' 설정을 적용하기 위해 다음과 같이 한다. # update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf ==== SMTP 인증 ==== 지금까지는 모은 host 의 릴레이를 허용했기 때문에, 스팸 경우지로 사용될 우려가 있다. 이를 방지 하기 위해서 인증을 하도록 설정한다. 설치한 패키지중 sasl2-bin 패키지가 이러한 SMTP인증을 해주는 데몬 패키지 이다. /etc/exim4/exim4.conf.template 파일을 열어서 다음과 같이 수정한다. .......상단생략....... # Authenticate against local passwords using sasl2-bin # 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 = : # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS # server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}} # .endif # login_saslauthd_server: driver = plaintext public_name = LOGIN server_prompts = "Username:: : Password::" # don't send system passwords over unencrypted connections # server_advertise_condition = ${if eq{$tls_cipher}{}{0}{1}} server_condition = ${if saslauthd{{$1}{$2}}{1}{0}} server_set_id = $1 # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS # server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}} # .endif # ## 이하 모든 아래내용은 주석처리 하도록 한다. ## 위와같이 exim4.conf.template화일을 수정한후 # update-exim4.conf -d /etc/exim4 -o /etc/exim4/exim4.conf 명령을 다시 해주어 exim4.conf화일을 재생성한다. 그리고 /etc/group 파일을 열어 Debian-exim유저를 sasl그룹에 포함시켜준다. ... shadow:x:42: utmp:x:43: video:x:44: sasl:x:45:Debian-exim # 여기에 추가시켜준다. plugdev:x:46: staff:x:50: games:x:60: ... sasl 데몬을 기동하기 위해 아래의 파일을 수정한다. # vi /etc/default/saslauthd # This needs to be uncommented before saslauthd will be run automatically # START=yes # You must specify the authentication mechanisms you wish to use. # This defaults to "pam" for PAM support, but may also include # "shadow" or "sasldb", like this: # MECHANISMS="pam shadow" START="yes" # 데몬을 가동하기 위해 추가한다. MECHANISMS="pam shadow" # 기본적인 password방식은 shadow이므로 shadow만 있어도 상관 없다. 이제 exim4와 sasl데몬을 재시작 하도록 한다. # /etc/init.d/saslauthd restart Stopping SASL Authentication Daemon: saslauthd. Starting SASL Authentication Daemon: saslauthd. # /etc/init.d/exim4 restart Restarting MTA: exim4. 마지막으로 모든 설정이 제대로 되었는지 확인하기 위해 메일이 잘 오가는지 테스트 해보도록 한다. ===== Link ===== * http://netj.org/2006/03/Maildir * http://exim.org/ * http://marc.merlins.org/ * http://www.timj.co.uk/linux/exim.php