携帯・ビジネスブログ・CGIスクリプト-バーチャルドメインに対応したIMAP4とPOP3を構築しましょう。

トップオープンソース> qmailでバーチャルドメイン構築(その4 courier-imap authlib編)

qmailでバーチャルドメイン構築(その4 courier-imap authlib編)

バーチャルドメインに対応したIMAP4とPOP3を構築しましょう。

はじめに

バーチャルドメインに対応したIMAP4とPOP3まできました。
courier-imapのバージョン3では、一つのパッケージでよかったのですが、バージョン4になってからauthlibが独立?したようです。

1.ダウンロードしましょ

http://www.courier-mta.org/?download.php

2.前段階

特に、ないかな?インストールの順序がauthlib => imapの順番じゃないとコンパイルがとおりません。また、一般ユーザでコンパイルしないといけないので、とりあえず、vpopmailユーザで行うこととし、解凍したフォルダーは、vpopmailにCHOWNしましょう。

courier-authlib編

(1)解凍

tar jxf courier-authlib-0.52.tar.bz2
chown -R vpopmail:vchkpw courier-authlib-0.52

(2)make

cd courier-authlib-0.52
su vpopmail
./configure --with-redhat --with-db=gdbm --with-db=db --with-mailuser=vpopmail --with-mailgroup=vchkpw
make
su
make install
make install-migrate
make install-configure

(3)コンフィグの設定

/usr/local/etc/authlib/authdaemonrc

を開いて

authmodulelist="authvchkpw authuserdb authpam"
authmodulelistorig="authvchkpw authuserdb authpam"

のような感じに変更します。authvchkpw を先頭に。

(4)自動起動

cp /usr/local/sbin/authdaemond /etc/rc.d/init.d/authdaemond
cd /etc/rc.d/rc3.d ; ln -s ../init.d/authdaemond ./S99authdaemond ; ln -s ../init.d/authdaemond ./K99authdaemond
cd /etc/rc.d/rc4.d ; ln -s ../init.d/authdaemond ./S99authdaemond ; ln -s ../init.d/authdaemond ./K99authdaemond
cd /etc/rc.d/rc5.d ; ln -s ../init.d/authdaemond ./S99authdaemond ; ln -s ../init.d/authdaemond ./K99authdaemond

ps -ax|grep authdaemond
1907 ? S 0:00 /usr/local/libexec/courier-authlib/authdaemond

=>authdaemondが起動していること。

courier-imap編

(1)解凍

tar jxf courier-imap-4.0.1.tar.bz2
chown -R vpopmail:vchkpw courier-imap-4.0.1

(2)make

cd courier-imap-4.0.1
su vpopmail
./configure --without-authdaemon --with-redhat --with-db=gdbm --with-db=db --enable-unicode=iso-2022-jp
make
make check
su
make install
make install-configure

(3)自動起動

cp /usr/lib/courier-imap/libexec/imapd.rc /etc/rc.d/init.d/imapd
cp /usr/lib/courier-imap/libexec/pop3d.rc /etc/rc.d/init.d/pop3d
cd /etc/rc.d/rc3.d ; ln -s ../init.d/imapd ./S99imapd ; ln -s ../init.d/imapd ./K99imapd
cd /etc/rc.d/rc4.d ; ln -s ../init.d/imapd ./S99imapd ; ln -s ../init.d/imapd ./K99imapd
cd /etc/rc.d/rc5.d ; ln -s ../init.d/imapd ./S99imapd ; ln -s ../init.d/imapd ./K99imapd
cd /etc/rc.d/rc3.d ; ln -s ../init.d/pop3d ./S99pop3d ; ln -s ../init.d/pop3d ./K99pop3d
cd /etc/rc.d/rc4.d ; ln -s ../init.d/pop3d ./S99pop3d ; ln -s ../init.d/pop3d ./K99pop3d
cd /etc/rc.d/rc5.d ; ln -s ../init.d/pop3d ./S99pop3d ; ln -s ../init.d/pop3d ./K99pop3d

ps -ax|grep imapd
1920 ? S 0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -stderrlogger=/usr/local/sbin/courierlogger
-stderrloggername=imapd -maxprocs=40 -maxperip=4 -pid=/var/run/imapd.pid -nodnslookup -noidentlookup 143 /usr/lib/courier-im
ap/sbin/imaplogin /usr/lib/courier-imap/bin/imapd Maildir

ps -ax|grep pop3d
1932 ? S 0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -stderrlogger=/usr/local/sbin/courierlogger
-stderrloggername=pop3d -maxprocs=40 -maxperip=4 -pid=/var/run/pop3d.pid -nodnslookup -noidentlookup 110 /usr/lib/courier-im
ap/sbin/pop3login /usr/lib/courier-imap/bin/pop3d Maildir

(4)imap4試験

telnet localhost 143
1 login info@hoge1.co.jp PASSWD1
1 logout

(5)pop3試験

telnet localhost 110
user info@hoge1.co.jp
pass PASSWD1
quit


related articles