- 1. vpopmail
- 2. courier-authlib-vchkpw
- 3. courier-imap
- 4. 設定
- 5. 起動
1. vpopmail
cd /usr/ports/mail/vpopmail
make config
下記が、デフォルトのオプションになります。



まだ、よくわかっていないのですが、デフォルトのオプションの他、以下にチェックをいれました。
・PASSWD
・QMAIL_EXT
・SPAMASSASSIN
今んとこ、「MD5」形式に対応していないので、以下のチェックを外しました。
・MD5_PASSWORDS
cd /usr/ports/mail/vpopmail
make
make install
2. courier-authlib-vchkpw
cd /usr/ports/mail/courier-authlib-vchkpw
make
make install
オプションはありません。
実は、これ、あるマシンでおおしくりしました。
「make」時に
checking for getspent... no
----------------------------------------------------
NOTE
All questions regarding ANY vpopmail-related problems,
such as compiling/building failures, or login errors
should be referred to the vpopmail mailing list.
Vpopmail questions sent to the Courier mailing lists
will be IGNORED.
----------------------------------------------------
configure: error: /etc/lib_deps does not exist - upgrade vpopmail to the current version or fix the permissions on this file
===> Script "configure" failed unexpectedly.
Please report the problem to madpilot@FreeBSD.org [maintainer] and attach the
"/usr/ports/mail/courier-authlib-vchkpw/work/courier-authlib-0.71.0/config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/mail/courier-authlib-vchkpw
*** Error code 1
Stop.
make: stopped in /usr/ports/mail/courier-authlib-vchkpw
というエラーになって一歩も進めなくなったのです。
これ、どうも、「vpopmail」のインストールでどこか誤りがあったようで、「vpopmail」インストール後に
$ ls -l /usr/local/vpopmail
合計 24K
drwxr-xr-x 2 vpopmail vchkpw 1536 7月 30 13:24 bin/
drwxr-xr-x 4 root vchkpw 1536 7月 30 13:29 doc/
drwx------ 2 vpopmail vchkpw 512 7月 30 13:24 domains/
drwxr-xr-x 2 vpopmail vchkpw 512 7月 30 13:29 etc/
drwxr-xr-x 2 vpopmail vchkpw 512 7月 30 13:24 include/
drwxr-xr-x 2 vpopmail vchkpw 512 7月 30 13:24 lib/
となって、更に「etc」の配下に、「vpopmail:vchkpw」のファイルがなければならんのですが。
「vpopmail:vchkpw」でなく「root:vchkpw」になっておりました。
これは、「vpopmail」をインストールし直す必要があります。
「make deinstall clean」後に、いったん
「/etc/group」から
vchkpw:*:89:
の行を削除して(「vi」で編集)
「/etc/passwd」から
vpopmail:*:89:89::0:0:VPop Mail User:/usr/local/vpopmail:/nonexistent
の行を削除して(「vipw」で編集)、「vpopmail」を「make」からインストールし直すことで、問題は解消します。
3. courier-imap
cd /usr/ports/mail/courier-imap
make config
下記が、デフォルトのオプションになります。

デフォルトのオプションの他、以下にチェックをいれました。
・AUTH_VCHKPW
・GNUTLS
どうも「GNUTLS」にチェックをいれておかないと
Jul 30 15:36:57 ns imapd-ssl: ip=[::ffff:192.168.10.36], couriertls: read: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
てなエラーになって接続できないようなのです。
cd /usr/ports/mail/courier-imap
make
make install
4. 設定
vi /usr/local/etc/authlib/authdaemonrc
authmodulelist="authuserdb authvchkpw authpam authldap authmysql authpgsql"
##NAME: authmodulelistorig:4
#
# This setting is used by Courier's webadmin module, and should be left
# alone
authmodulelistorig="authuserdb authvchkpw authpam authldap authmysql authpgsql"
下記へ変更します。
authmodulelist="authvchkpw authpam"
##NAME: authmodulelistorig:4
#
# This setting is used by Courier's webadmin module, and should be left
# alone
authmodulelistorig="authvchkpw authpam"
「FreeBSD - メンテナンス・トラブルシュート - メールサーバ」で作成した、証明書のパス/ファイルが
/etc/ssl/mail/cert.pem
であったとします。
なんだか「dhparams.pem」てぇものが必要みたいなので
openssl dhparam -out /etc/ssl/mail/dhparams.pem 2048
/usr/local/etc/courier-imap/imapd-ssl
の
TLS_CERTFILE=/usr/local/share/courier-imap/imapd.pem
TLS_DHPARAMS=/usr/local/share/courier-imap/dhparams.pem
へ、合わせて、シンボリックリンクを作成します(ついでに、「pop3d」用も)。
ln -s /etc/ssl/mail/cert.pem /usr/local/share/courier-imap/imapd.pem
ln -s /etc/ssl/mail/cert.pem /usr/local/share/courier-imap/pop3d.pem
ln -s /etc/ssl/mail/dhparams.pem /usr/local/share/courier-imap/dhparams.pem
後で気づいたことですが、このままであるとログに
Aug 4 14:56:08 ns imapd-ssl: /usr/local/etc/courier-imap/shared/index: No such file or directory
てなものが、表示されます。
「Fedora 9サーバの設定(メール篇:TLS) - Resilient Mind」を参考に
touch /usr/local/etc/courier-imap/shared/index
しておきます。
起動設定を行います。
cat << EOF >> /etc/rc.conf
courier_authdaemond_enable="YES"
courier_imap_imapd_enable="YES"
courier_imap_imapd_ssl_enable="YES"
EOF
5. 起動
service courier-authdaemond start
service courier-imap-imapd start
service courier-imap-imapd-ssl start
|