FreeBSD に Dovecot 2.2.27 をインストールしてみたのでメモ。
(注:まだ書きかけです)
環境
方針
-
ports を使ってインストール
-
pkg
でインストールできるのはバージョン 2.2.25_5 でちょっと古い。% pkg search dovecot2 | grep -v plugin dovecot2-2.2.25_5 Secure, fast and powerful IMAP and POP3 server
-
dovecot
パッケージはバージョン 1.2.17 なのでdovecot2
を使用
-
-
-
ports を更新する
-
FreeBSD 11.0 に同梱されている ports では
dovecot2
のバージョンは 2.2.24 でちょっと古い% grep ^PORTVERSION /usr/ports/mail/dovecot2/Makefile PORTVERSION= 2.2.24
-
IMAP のみで POP3 は使わない
SSL 必須
PAM でパスワード認証
maildir 形式
ports を更新
-
/usr/ports
を更新% sudo portsnap fetch % sudo portsnap extract
-
dovecot2 のバージョンを確認
% grep ^PORTVERSION /usr/ports/mail/dovecot2/Makefile PORTVERSION= 2.2.27
Dovecot インストール
Dovecot 設定
-
/usr/local/etc/dovecot/dovecot.conf
を作成# only imap (no pop3) # lmtp is to be used by smtpd protocols = imap lmtp ssl = required ssl_cert = </etc/mail/certs/host.cert ssl_key = </etc/mail/certs/host.key # used in Message-Id and LMTP replies hostname = mail.mydomain.jp # use maildir rather than mbox mail_location = maildir:~/Maildir # don't let users log in as system users first_valid_uid = 1000 first_valid_gid = 1000 # PAM authentication passdb { driver = pam # use /etc/pam.d/imap args = %s } # Get uid, gid, home from /etc/passwd through nsswitch userdb { driver = passwd } #service auth { # smtp-auth # unix_listener /var/spool/smtpd/private/auth { # mode = 0666 # } #} # special mailboxes namespace inbox { inbox = yes mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Trash { special_use = \Trash } mailbox Sent { special_use = \Sent } mailbox virtual/All { special_use = \All } mailbox virtual/Flagged { special_use = \Flagged } }
-
/etc/pam.d/imap
は FreeBSD 11.0 にバンドルされているものをそのまま使うauth required pam_unix.so no_warn try_first_pass account required pam_unix.so
Dovecot 起動
-
サービスを有効にする
-
/etc/rc.conf
に追加dovecot_enable="YES"
-
-
起動
$ sudo service dovecot start