Dovecot

wwiki
이동: 둘러보기, 검색

개요[편집 | 원본 편집]

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

#주석처리(PAM인증을 사용하지 않음)
#!include auth-system.conf.ext

#주석해제
!include auth-ldap.conf.ext

인증 디버깅 로그 활성화[편집 | 원본 편집]

파일위치: /etc/dovecot/conf.d/10-logging.conf

auth_verbose = yes
auth_verbose_passwords = yes
auth_debug = yes
auth_debug_passwords = yes
mail_debug = yes

로그 파일 위치 보기

doveadm log find

로그 보기

doveadm log errors

비밀번호와 사용자계정을 LDAP에서 불러오도록 설정되었는지 확인(기본값)[편집 | 원본 편집]

파일위치: /etc/dovecot/conf.d/auth-ldap.conf.ext

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
}

Maildir에 대한 설정[편집 | 원본 편집]

파일명: /etc/dovecot/conf.d/10-mail.conf

mail_location = maildir:~/Maildir

# postfix설정에서 추가한 계정 vmail에 맞춰 추가
mail_uid = 5000
mail_gid = 5000
mail_privileged_group = vmail

썬더버드 한글판의 경우 보낸 편지함 충돌을 위한 설정[편집 | 원본 편집]

버전에 따라서 충돌이 없을 수 있을 듯.

파일명: /etc/dovecot/conf.d/10-mail.conf

namespace inbox { 내부에 추가해줄 내용

mailbox Sent {

  auto = subscribe # autocreate and autosubscribe the Sent mailbox
  special_use = \Sent
}

mailbox "Sent Messages" {

  auto = no
  special_use = \Sent
}

매핑파일 생성[편집 | 원본 편집]

파일명: /etc/dovecot/dovecot-ldap.conf.ext (/etc/dovecot/conf.d/10-auth.conf에서 설정한 파일)

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))

설정확인[편집 | 원본 편집]

$ dovecot -n

테스트[편집 | 원본 편집]

IMAP telnet으로 테스트

외부링크[편집 | 원본 편집]

https://www.dovecot.org/