sideprj--diglog開発日誌

本サイトは、diglogの開発日誌兼気になったニュースを、できるだけ毎日投稿していきます。 あと、diglogっていうサービスは、ユーザー間の音楽CDトレードをメインに、新しい音楽を知るきっかけをサポートします。 アドレスはこちら http://dig-log.jp/

<$BlogDateHeaderDate$>

突然ですがqmailとvpopmailのインストールメモ

qmailとvpopmailをインストールしなければならなくなった。

このサイトを参考にしながらインストールしてみます。
それ行けLinux~qmail/vpopmail~

インストール先のサーバ:RedHat EL3 AS

必要物をwgetでダウンロードしてくる
wget ftp://ftp.jp.qmail.org/qmail/qmail-1.03.tar.gz
wget ftp://ftp.jp.qmail.org/qmail/ucspi-tcp-0.88.tar.gz
wget http://downloads.sourceforge.net/vpopmail/vpopmail-5.4.17.tar.gz?modtime=1152720482&big_mirror=0
wget http://www.qmail.org/qmail-smtpd-relay-reject

しかし、どうやらqmailを日本時間で動作させるためのパッチがおちてこない。
tp://ftp.nlc.net.au/pub/unix/mail/qmail/qmail-date-localtime.patch
こまった。
・・・まぁいいや、とりあえず飛ばそう。

mkdir /var/qmail
groupadd -g 710 nofiles
useradd -M -u 710 -g nofiles -s /bin/false -d /var/qmail/alias alias
useradd -M -u 711 -g nofiles -s /bin/false -d /var/qmail qmaild
useradd -M -u 712 -g nofiles -s /bin/false -d /var/qmail qmaill
useradd -M -u 713 -g nofiles -s /bin/false -d /var/qmail qmailp
groupadd -g 711 qmail
useradd -M -u 714 -g qmail -s /bin/false -d /var/qmail qmailq
useradd -M -u 715 -g qmail -s /bin/false -d /var/qmail qmailr
useradd -M -u 716 -g qmail -s /bin/false -d /var/qmail qmails

tar zxvf qmail-1.03.tar.gzcd qmail-1.03
cd qmail-1.03
patch -p1 < ../qmail-smtpd-relay-reject

make setup check
: undefined reference to `errno'collect2: ld returned 1 exit statusmake: *** [auto-str] Error 1
なんかエラーでてとまってるっぽい。

はて、パッチがうまくあたってなかったのかな。
やり直し。
cd ..
rm -rfR qmail-1.03

tar zxvf qmail-1.03.tar.gzcd qmail-1.03
cd qmail-1.03


make setup
相変わらずしっかりとエラーが出た。
原因は・・・あった。これだ。
RedHat9でのqmailのコンパイルエラー
かかれてあるとおりに、変更。
「error.h の三行目 extern int errno; を #includeに変更」

make clean
make setup check

./config-fast ドメイン名
こんどはいけたっぽい。

指示に従ってlocalhostを追加。
vi /var/qmail/control/locals
vi /var/qmail/control/rcpthosts

cd ..
tar zxvf ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
make setup check
あああ、オマエモカー。
「error.h の三行目 extern int errno; を #includeに変更」

make setup check

cd ../
tar zxvf vpopmail-5.4.17.tar.gz cd vpopmail-5.4.17

./configure --enable-roaming-users=y --enable-relay-clear-minutes=10 --enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp --enable-default-domain=ドメイン名 --enable-logging=y
またもやエラー
checking whether we can locate the tcp.smtp file... configure: error: Unable to find your tcp.smtp file, specify --enable-tcpserver-path=/full/path/to/tcp.smtp

オプションかえてやりなおし。
./configure --enable-roaming-users=y --enable-relay-clear-minutes=10 --enable-default-domain=ドメイン名 --enable-logging=y

別のエラーでた。
configure: error: --enable-default-domain has been superceded. The default domain should be put into the file ~vpopmail/etc/defaultdomain instead

./configure --enable-roaming-users=y --enable-relay-clear-minutes=10 --enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp --enable-logging=y
これでいけた。

make
make install-strip

tcprules /home/vpopmail/etc/tcp.smtp.cdb /home/vpopmail/etc/tcp.smtp.tmp < /home/vpopmail/etc/tcp.smtp

crontab -e 
0,10,20,30,40,50 * * * * /home/vpopmail/bin/clearopensmtp 2>&1 > /dev/null

cd /home/vpopmail/bin
./vadddomain ドメイン名

./vadduser test@ドメイン名
cd /var/qmailcp
vi /var/qmail/boot/home /var/qmail/rc
rcqmail-start ./Maildir/ splogger qmail

http://www.jw7.org/wiki/index.php?qmailの起動スクリプトを参考に作成vi /etc/rc.d/init.d/qmail
chkconfig qmail on
rm /usr/lib/sendmail
rm /usr/sbin/sendmail
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
service xinetd stop
chmod 755 /etc/rc.d/init.d/qmail

ねむくなってきたので続きはあした。