목차
DOVECOT 2.3 설치
cd /usr/ports/mail/dovecot make config make all install clean
Dovecot 설치 목적
Dovecot은 인터넷상에서 전자우편을 주고 받을 수 있게 해 주는 소프트웨어인데, 이를 통해서 https://webmail.jikji.org에서 보여주는 바와 같이 userid@jikji.org(여기 보인 설정 예에서는 userid@my.domain)를 가진 사용자가 인터넷 상에서 전자우편을 주고 받을 수 있는 환경을 구축한다. 아래 환경 설정은 이 목적을 달성하기 위해 webmail 무른로로 Roundcube를 염두에 두고 만든 것이다.
/etc/rc.conf 성정
sysrc dovecot_enable="YES"
/usr/local/etc/dovecot 생성 및 각 문서 설정 값 변경
cp -R /usr/local/etc/dovecot/example-config/* /usr/local/etc/dovecot
/usr/local/etc/dovecot.conf
다음 내용을 확인한다.
protocols = imap pop3 lmtp
/usr/local/etc/conf.d/10-logging.conf
다음 내용을 확인한다.
log_path = /var/log/dovecot.log
/usr/local/etc/conf.d/10-auth.conf
다음 내용을 확인한다.
auth_mechanisms = plain login !include auth-passwdfile.conf.ext
/usr/local/etc/conf.d/auth-passwdfile.conf.ext
다음 내용을 확인한다.
passdb {
driver = passwd-file
args = scheme=CRYPT username_format=%u /usr/local/etc/dovecot/users
}
userdb {
driver = passwd-file
args = username_format=%u /usr/local/etc/dovecot/users
}
이제 /usr/local/etc/dovecot/users 문서를 만들어 준다. 이 문서에 들어있는 사용자 정보를 바탕으로 Roundcube를 통해 웹에서 전자우편을 주고 받는 것을 가능하게 할 수 있다.
여러 사람이 쓸 거 아니고 나만 쓸 거기 때문에 간단하게 다음과 같이 했다.
fgrep -v '*' /etc/master.passwd | cut -d : -f 1-4,8-10 > /usr/local/etc/dovecot/users chmod 640 /usr/local/etc/dovecot/users chown postfix:dovecot /usr/local/etc/dovecot/users
이렇게 하고 나서 /usr/local/etc/dovecot/users 를 열어서 필요 없는 사용자는 지우고, 내 계정(예를 들어 userid 라고 하자)만 남긴다. 그런 다음에 userid 뒤에 내 도메인을 더해준다, 즉 userid@my.domain. 이렇게 변경을 하였으면 문서를 저장하고 빠져 나온다.
/usr/local/etc/conf.d/10-mail.conf
다음 내용을 확인한다. uid/gid 설정은 사용자에 맞춰서 정해준다.
mail_location = maildir:~/Maildir
namespace inbox {
inbox = yes
}
mail_privileged_group = mail
first_valid_uid = 1001
first_valid_gid = 0
/usr/local/etc/conf.d/10-mater.conf
다음 내용을 확인한다.
service imap-login {
inet_listener imap {
#port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0666
user = postfix
group = postfix
}
}
service auth {
unix_listener auth-userdb {
mode = 0666
user = postfix
group = postfix
}
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
# Auth process is run as this user.
user = dovecot
}
service auth-worker {
user = postfix
}
/usr/local/etc/dovecot/conf.d/10-ssl.conf
다음 내용을 확인한다.
ssl = yes ssl_cert = < /usr/local/etc/letsencrypt/live/my.domain/fullchain.pem ssl_key = < /usr/local/etc/letsencrypt/live/my.domain/privkey.pem
/usr/local/etc/dovecot/conf.d/15-mailbox.conf
다음 내용을 확인한다.
# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf.
namespace inbox {
# These mailboxes are widely used and could perhaps be created automatically:
mailbox Drafts {
auto=create
special_use = \Drafts
}
mailbox Junk {
auto=create
special_use = \Junk
}
mailbox Trash {
auto=create
special_use = \Trash
}
# For \Sent mailboxes there are two widely used names. We'll mark both of
# them as \Sent. User typically deletes one of them if duplicates are created.
mailbox Sent {
auto=create
special_use = \Sent
}
#mailbox "Sent Messages" {
# special_use = \Sent
#}
}
이 밖에 나머지 문서들과 설정값들은 기본값으로 남겨 두었다. 계속해서 다음 장에 있는 postfix 관련 설정 변경을 한다.
