주 메뉴 열기

wwiki β

바뀜

Dovecot

1,545 바이트 추가됨, 2021년 10월 28일 (목) 06:23
편집 요약 없음
===설치===
$ 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"><nowiki>#</nowiki>주석처리(PAM인증을 사용하지 않음) #!include auth-system.conf.ext
<nowiki>#</nowiki>주석해제!include auth-systemldap.conf.ext </syntaxhighlight>
<nowiki>#</nowiki>주석해제 !include auth-ldap.conf.ext  ====인증 디버깅 로그 활성화====파일위치: /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}
args = /etc/dovecot/dovecot-ldap.conf.extuserdb {
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>
 
====썬더버드 한글판의 경우 보낸 편지함 충돌을 위한 설정====
버전에 따라서 충돌이 없을 수 있을 듯.
userdb {파일명: /etc/dovecot/conf.d/10-mail.conf
driver namespace inbox { 내부에 추가해줄 내용<syntaxhighlight lang= ldap"nginx">mailbox Sent {
args auto = /etc/dovecot/dovecot-ldap.conf.extsubscribe # autocreate and autosubscribe the Sent mailbox special_use = \Sent}
<nowiki>#</nowiki> default_fields = home=/home/mail/%d/%umailbox "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
user_attrs # uidNumber= cn=useruid,mailDirectorygidNumber=homeDirectorygid 부분은 /etc/dovecot/conf.d/10-mail.conf에서 설정한 vmail계정으로 실행되도록 삭제
user_filter user_attrs = (cnhomeDirectory=%n)home
pass_attrs #비밀번호 필터를 ldap의 메일주소로 설정(%u:user@domain, %n: user)pass_filter = cn(&(objectClass=user,userPasswordposixAccount)(mail=Password%u))</syntaxhighlight>
pass_filter = (cn=%==설정확인==== $ dovecot -n)
====설정확인테스트====$ 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