sendmail 설치
[email protected]:/etc# apt-get install sendmail

sendmail 설정
[email protected]:/etc/mail# vi /etc/mail/sendmail.mc

수정전
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dn

수정후
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=0.0.0.0')dn

90 번째 줄에 추가 (적당한 위치에 추가하면 됨)
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

변경된 사항을 적용하기 계속 Y 해주면 됨.
[email protected]:/etc/mail# sendmailconfig
Configure sendmail with the existing /etc/mail/sendmail.conf? [Y] Y
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Configure sendmail with the existing /etc/mail/sendmail.mc? [Y] Y
Updating sendmail environment ...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Could not open /etc/mail/databases(No such file or directory), creating it.
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases...

Checking filesystem, this may take some time - it will not hang!
  ...  Done.

Checking for installed MDAs...
Creating /etc/mail/sasl/sasl.m4...

Ah, you're setup with SASL2 !

Unfortunately, there is no automagic way to migrate to /etc/sasldb2 :(

You'll want to make sure /etc/default/saslauthd is setup to start,
and has at least MECHANISMS="pam" !

If you find out what more is needed, please let me know!

Creating/Updating SSL(for TLS) information
Creating /etc/mail/tls/starttls.m4...
You already have sendmail certificates


*** *** *** WARNING *** WARNING *** WARNING *** WARNING *** *** ***

Everything you need to support STARTTLS (encrypted mail transmission
and user authentication via certificates) is installed and configured
but is *NOT* being used.

To enable sendmail to use STARTTLS, you need to:
1) Add this line to /etc/mail/sendmail.mc and optionally
  to /etc/mail/submit.mc:
  include(`/etc/mail/tls/starttls.m4')dnl
2) Run sendmailconfig
3) Restart sendmail

Checking {sendmail,submit}.mc and related databases...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/Makefile...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Disabling HOST statistics file(/var/lib/sendmail/host_status).
Creating /etc/mail/sendmail.cf...
Creating /etc/mail/submit.cf...
Informational: confCR_FILE file empty: /etc/mail/relay-domains
Informational: confCT_FILE file empty: /etc/mail/trusted-users
Updating /etc/mail/access...
Updating /etc/mail/aliases...
/etc/mail/aliases: 4 aliases, longest 10 bytes, 66 bytes total
Reload the running sendmail now with the new configuration? [Y] Y
Reloading sendmail ...

AUTH LOGIN PLAIN을 확인한다.
[email protected]:/etc/mail# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 test-server.cafe24.com ESMTP Sendmail 8.14.3/8.14.3/Debian-9.1ubuntu1; Mon, 21 May 2012 21:14:18 +0900; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
ehlo test-server.cafe24.com
250-test-server.cafe24.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250-DELIVERBY
250 HEL

※ AUTH LOGIN을 하기 위해서는 pwcheck등과 같은 패스워드 인증 모듈을
사용해야 된다. postfix에서는 saslauthd를 많이 사용하므로 본 매뉴얼에서는
saslauthd 기준으로 설치를 한다.
※ 기존에 SMTP-AUTH check 프로그램을 쓰는 메일 서버의 경우 각 프로
그램에 맞는 설정을 해야 한다.
“dpkg -l | grep sasl" 명령어로 Cyrus sasl이 설치되어 있는지 확인한다.

[email protected]:/etc/mail# dpkg -l | grep sasl
ii  libsasl2-2                      2.1.23.dfsg1-5ubuntu1                          Cyrus SASL - authentication abstraction libr
ii  libsasl2-modules                2.1.23.dfsg1-5ubuntu1                          Cyrus SASL - pluggable authentication module

ssl2-bin 패키지 설치
[email protected]:/etc/mail# apt-get install sasl2-bin

saslauthd 데몬 실행
[email protected]:/etc/mail# saslauthd -a pam

sasl 관련 설정을 변경
[email protected]:/etc/mail# vi /etc/default/saslauthd
#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
수정전
START=no

수정후
START=yes


변경된 사항을 적용하기 계속 Y 해주면 됨.
[email protected]:/etc/mail# sendmailconfig

추가적으로 모든 IP에 대하여 relay 허용을 하고 싶다면 /etc/mail/sendmail.cf 파일에서 5.7.1 이 들어가 있는 부분 모두를 주석처리하면 됨.

특정 IP에서만 relay 허용을 해주고 싶다면,  아래와 같이 access 파일에 IP 추가 후 설정 적용해주면 됨.

vi /etc/mail/access
Connect:IP               RELAY  

설정 적용
makemap hash /etc/mail/access < /etc/mail/access  

여기 까지가 sendmail(smtp 인증) 설정 완료.

dovecot 설치
[email protected]:/etc# apt-get dovecot-pop3d

dovecot 설정
[email protected]:/etc/dovecot# vi /etc/dovecot/dovecot.conf

수정전
protocols = imap imaps

수정후
protocols = pop3 pop3s


아래 부분 주석 해제
listen = *
login_user = dovecot
mail_location = mbox:~/mail:INBOX=/var/mail/%u

login_executable = /usr/lib/dovecot/pop3-login
mail_executable = /usr/lib/dovecot/pop3
auth_executable = /usr/lib/dovecot/dovecot-auth

dovecot 재시작
[email protected]:/etc/dovecot# /etc/init.d/dovecot restart 
2012/05/21 21:33 2012/05/21 21:33

트랙백 주소 :: 이 글에는 트랙백을 보낼 수 없습니다