up_l dmy up_r
dmy home dmy dmy dmy

●postfix + Maildir + qpopper + dracでPOP before SMTP(Vine4.0)●
(2006/12/17)

[インストール環境]
» vine linux 4.0
» xinetd-2.3.14-0vl1
» portmap-4.0-63vl2
» postfix-2.2.10-0vl6
» qpopper-4.0.9
» dracd-1.12-0vl4

※今回はすべてapt-get、RPMを構築してインストールすることを前提に説明していきます。
ソースからインストールしてしまうとメンテナンスが面倒なので・・・(;´Д`)
※qpopperはxinetdから起動します。
※Vineで用意されているqpopperはMaildir方式ではないのでRPMを構築しなおします。
※ここに記載されているインストール方法、設定等を行う場合は”自己の責任”において行ってください。

[1] xinetdのインストール
> apt-get install xinetd

[2] postfixのインストール(当方はVineインストール時に導入済み)
> apt-get install postfix
※main.cfの細かい設定は端折ります

[3] dracのインストール
> apt-get install dracd

[4] rc.dracdの編集
> vi /usr/sbin/rc.dracd

---------------------------------------------------------
/usr/sbin/rpc.dracd -i -e 10 &
---------------------------------------------------------
※「-i」は起動時にdracd.dbを初期化するオプション
 「-e m」は最後に認証してからの有効期限(m分)

[5] main.cfに下記を追加
> vi /etc/postfix/main.cf

---------------------------------------------------------
smtpd_recipient_restrictions =
        permit_mynetworks
        check_client_access btree:/etc/mail/dracd
        reject_unauth_destination
---------------------------------------------------------

[6] RPMを構築するためのqpopperを入手
> cd ~hoge/
> wget http://ftp.kddilabs.jp/pub/Linux/packages/Vine/apt/4.0/SRPMS.main/qpopper-4.0.9-0vl3.src.rpm
※SRPM(Vine用のSPECファイルを使用するため)
> wget http://www.ring.gr.jp/pub/net/mail/qpopper/qpopper4.0.9.tar.gz
※ソース(SRPMと同じバージョンのもの、SRPMインストール時にSOURCESに同じものがあるので要らないかも?)
> wget http://www.asteroid-b612.org/software/qpopper-mysql/qpopper-mysql-0.15-test.patch
※パッチ(Maildir方式に対応させるためのqpopper4.0.9用パッチ)

[7] SRPMのインストール
> rpm -ivh qpopper-4.0.9-0vl3.src.rpm

[8] SPECファイルの編集
> vi /usr/src/vine/SPEC/qpopper.spec

---------------------------------------------------------
%define USE_DRACD 1
.
.
.
%if %{USE_DRACD}
CFLAGS="$RPM_OPT_FLAGS" ./configure \
    --prefix=/usr \
    --enable-bulletins=/var/spool/mail/bulletins \
    --enable-specialauth \
    --with-pam=qpopper \
    --with-popuid=pop \
    --enable-maildrop-type=maildir \
    --enable-home-dir-mail=Maildir \
    --enable-drac \
    --enable-apop=/etc/pop.auth \
    --enable-shy \
    --disable-mysql
---------------------------------------------------------
※1行目のUSE_DRACDを1に
※configureにMaildir、dracオプションを追加
※その他はお好みで

[9] qpopper4.0.9.tar.gzを解凍してSPECファイルをコピー
> tar zxvf qpopper4.0.9.tar.gz
> cd qpopper4.0.9
> cp /usr/src/vine/SPEC/qpopper.spec ./

[10] Maildir対応パッチ(qpopper-mysql-0.15-test.patch)の適用
> patch -p1 < ../qpopper-mysql-0.15-test.patch

[11] SPECファイルのコピー、パッチの適用が済んだらqpopper4.0.9を圧縮
> cd ..
> mv qpopper4.0.9.tar.gz qpopper4.0.9.tar.gz.org
> tar zcvf qpopper4.0.9.tar.gz qpopper4.0.9

[12] qpopper用のPAMを作成
> vi qpopper.pam

---------------------------------------------------------
auth    required    /lib/security/pam_pwdb.so shadow
account required    /lib/security/pam_pwdb.so
---------------------------------------------------------

[13] qpopperのRPMをビルド
> rpmbuild -tb qpopper4.0.9.tar.gz

[14] qpopperのRPMをインストール
> cd /usr/src/vine/RPMS
> rpm -ivh qpopper-4.0.9-0vl3.i386.rpm

[15] qpopper.configのコピー
> cd ~hoge/qpopper4.0.9/samples/
> cp qpopper.config /etc/qpopper.conf

[16] コピーしたqpopper.confの編集
> vi /etc/qpopper.conf

---------------------------------------------------------
set shy = true
set log-facility = local1
---------------------------------------------------------

[17] xinetd起動用ファイルの編集
> vi /etc/xinetd.d/qpopper

---------------------------------------------------------
service pop3
{
    flags       = REUSE NAMEINARGS
    socket_type = stream
    wait        = no
    user        = root
    server      = /usr/sbin/in.qpopper
    server_args = popper -f /etc/qpopper.conf -s -R
    instances   = 50
    disable     = no
    port        = 110
    per_source  = 10
}
---------------------------------------------------------

[18] portmap、drac、postfix、xinetdの起動
> /etc/rc.d/init.d/portmap start
> /etc/rc.d/init.d/dracd start
> /usr/bin/postfix reload
> /etc/rc.d/init.d/xinetd restart

[19] hosts.allow、hosts.denyの編集
> vi /etc/hosts.deny

---------------------------------------------------------
ALL: ALL
---------------------------------------------------------
> vi /etc/hosts.allow
---------------------------------------------------------
popper: ALL
---------------------------------------------------------

[20] 動作テスト
> /usr/sbin/testdrac 127.0.0.1 192.168.1.1
> ll /etc/mail/dracd.db
※dracd.dbが更新されていれば成功!

[21] xinetd、portmap、drac、postfixをランレベルに追加(追加されていなければ)
> /sbin/chkconfig xinetd on
> /sbin/chkconfig portmap on
> /sbin/chkconfig dracd on
> /sbin/chkconfig postfix on

▲TOP

seo | ホームページ素材 | 結婚式 | 海外ウエディング | 看護師 求人
dmy
low_l dmy low_r