우분투에서 sendmail과 dovecot, saslauthd를 설치하기는 쉽다.
설치는 전부 root권한으로 진행하였다.
 
#apt-get install sendmail
#apt-get install libsasl2-2 libsasl2-modules sasl2-bin
#apt-get install dovecot-pop3d
 
위와같이 하면 설치는 완료다.
 
문제는 설정!!!
일단 smtp인증을 받기 위해서 sendmail.cf 과 sendmail.mc 를 수정한다.
먼저 sendmail.mc 수정
dnl # These are the allowed auth mechanisms. To allow relaying for a user
dnl # that uses one of them, you must set TRUST_AUTH_MECH.
define(`confAUTH_MECHANISMS', `LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl
dnl # These are the SMTP auth mechanisms which, if used,
dnl # Sendmail will allow relaying for. 
TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl
 
위 문장을 없으면 추가하고 있으면 위 문장과 같이 만든다.
그리고 Addr=127.0.0.1 이라고 나와있는 부분이 있을 텐데 이걸 전부 지워주거나 0.0.0.0으로 변경해준다.
그래야지만 다른 곳에서 아웃룩 등을 이용하여 메일 사용이 가능해진다.
저장 후 콘솔에서 m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf 입력
그 다음은 sendmail.cf 확인
O AuthMechanisms=LOGIN PLAIN DIGEST-MD5 CRAM-MD5  <-주석 되어 있는지 확인 후 주석있으면 제거
그 다음은 local-host-names 수정
/etc/mail/local-host-names 파일을 메일을 받을 도메인으로 수정해준다.
xxxx.co.kr처럼
마지막으로 Sendmail.conf 수정(없으면 생성)
/usr/lib/sasl2/Sendmail.conf 파일을 수정 및 생성하여 아래 내용을 기입한다.
pwcheck_method: saslauthd
 
이상으로 설정이 끝났다.
센드메일과 sasl을 재시작(시작)한다.
/etc/init.d/sendmail start(또는 restart)
/etc/init.d/saslauthd start(또는 restart)
2018/07/30 16:24 2018/07/30 16:24

Trackback Address :: https://youngsam.net/trackback/1914