주 메뉴 열기

wwiki β

바뀜

Dovecot

2,913 바이트 추가됨, 2021년 10월 28일 (목) 06:23
편집 요약 없음
== 개요 ==
Dovecot은 Linux/Unix 계열 시스템 용 IMAP과 POP3 전자메일 서버
 
===설치===
$ apt-get install -y dovecot-core
 
==[[LDAP]] 연동==
보내는 메일의 인증방식이 dovecot의 SASL을 사용하는 경우 메일을 보내기 위하여 SMTP서버에 접속할 때 다음 방법으로 LDAP와 연동할 수 있다.
 
===패키지 설치===
$ sudo apt install dovecot-ldap
 
===설정 수정===
 
====LDAP인증을 사용하도록 설정====
파일위치: /etc/dovecot/conf.d/10-auth.conf<syntaxhighlight lang="bash">
#주석처리(PAM인증을 사용하지 않음)
#!include auth-system.conf.ext
 
#주석해제
!include auth-ldap.conf.ext
</syntaxhighlight>
 
====인증 디버깅 로그 활성화====
파일위치: /etc/dovecot/conf.d/10-logging.conf<syntaxhighlight lang="ini">
auth_verbose = yes
auth_verbose_passwords = yes
auth_debug = yes
auth_debug_passwords = yes
mail_debug = yes
</syntaxhighlight>로그 파일 위치 보기
doveadm log find
로그 보기
doveadm log errors
 
====비밀번호와 사용자계정을 LDAP에서 불러오도록 설정되었는지 확인(기본값)====
파일위치: /etc/dovecot/conf.d/auth-ldap.conf.ext<syntaxhighlight lang="nginx">
passdb {
 
driver = ldap
args = /etc/dovecot/dovecot-ldap.conf.ext
}
 
userdb {
 
driver = ldap
args = /etc/dovecot/dovecot-ldap.conf.ext
# default_fields = home=/home/mail/%d/%u
}
</syntaxhighlight>
 
====Maildir에 대한 설정====
파일명: /etc/dovecot/conf.d/10-mail.conf<syntaxhighlight lang="ini">
mail_location = maildir:~/Maildir
 
# postfix설정에서 추가한 계정 vmail에 맞춰 추가
mail_uid = 5000
mail_gid = 5000
mail_privileged_group = vmail
</syntaxhighlight>
 
====썬더버드 한글판의 경우 보낸 편지함 충돌을 위한 설정====
버전에 따라서 충돌이 없을 수 있을 듯.
 
파일명: /etc/dovecot/conf.d/10-mail.conf
 
namespace inbox { 내부에 추가해줄 내용<syntaxhighlight lang="nginx">
mailbox Sent {
 
auto = subscribe # autocreate and autosubscribe the Sent mailbox
special_use = \Sent
}
 
mailbox "Sent Messages" {
 
auto = no
special_use = \Sent
}
</syntaxhighlight>
 
====매핑파일 생성====
파일명: /etc/dovecot/dovecot-ldap.conf.ext (/etc/dovecot/conf.d/10-auth.conf에서 설정한 파일)<syntaxhighlight lang="ini">
hosts = localhost
dn = cn=[로그인계정],dc=example,dc=com
dnpass = [password]
ldap_version = 3
base = ou=users,dc=example,dc=com
deref = never
scope = onelevel
default_pass_scheme = plain
 
# uidNumber=uid,gidNumber=gid 부분은 /etc/dovecot/conf.d/10-mail.conf에서 설정한 vmail계정으로 실행되도록 삭제
 
user_attrs = homeDirectory=home
 
#비밀번호 필터를 ldap의 메일주소로 설정(%u:user@domain, %n: user)
pass_filter = (&(objectClass=posixAccount)(mail=%u))
</syntaxhighlight>
 
====설정확인====
$ dovecot -n
 
====테스트====
[[IMAP#telnet.EC.9C.BC.EB.A1.9C .ED.85.8C.EC.8A.A4.ED.8A.B8|IMAP telnet으로 테스트]]
 
== 외부링크 ==
https://www.dovecot.org/
[[분류:Email]]
편집
2,431