qmail+mysql+vpopmail+sqwebmail+qmailadmin
自己写的(部分,仅供参考)
INST_PATH=`pwd`/package
SRC_PATH=/usr/local/src
SHELL_PATH=`pwd`/shell
安装前必需软件:
gcc g++ make mysql apache
本次安装中使用文件
autorespond-2.0.5.tar.gz netqmail-1.05.tar.gz
checkpassword-0.90.tar.gz qmailadmin-1.2.9.tar.gz
courier-authlib-0.59.2.tar.bz2 sqwebmail-5.1.5.tar.bz2
daemontools-0.76.tar.gz ucspi-tcp-0.88.tar.gz
ezmlm-0.53-idx-0.41.tar.gz vpopmail-5.4.17.tar.gz
第一步 安装基本qmail系统(主要参照)
# Prepare for the install
echo "Prepare the install..."
umask 022
mkdir -p $SRC_PATH
cp $INST_PATH/netqmail* $INST_PATH/ucsp* $INST_PATH/checkpassword* $SRC_PATH
mkdir /package
cp ./qmail/daem* /package
chmod 1755 /package
echo "All files is ready!"
# Unpacked the packages
echo Unpacked the packages for qmail
cd $SRC_PATH
tar -xzf netqmail*
cd netqmail-1.05
./collate.sh
cd ..
tar -xzf ucspi*
cd /package
tar -xzf daem*
# Make the directorys
mkdir /var/qmail
cd $SHELL_PATH
./create_user
# Compiling the files
cd $SRC_PATH/netqmail-1.05/netqmail-1.05
make setup check
echo "Please input the email-server DNS name:"
echo "Such as mail.simen.com"
read email_server
./config-fast $email_server
# Install the ucspi and daemontools
echo "Install the ucspi and daemon"
cd $SRC_PATH/ucspi-tcp-0.88
patch < $SRC_PATH/netqmail-1.05/other-patches/ucspi-tcp-0.88.errno.patch
make
make setup check
echo "The ucspi is installed!!!"
cd /package/admin/daemontools-0.76
cd src
patch < $SRC_PATH/netqmail-1.05/other-patches/daemontools-0.76.errno.patch
cd ..
package/install
echo "The daemon is installed!....."
echo
安装基本启动脚本
# Install the rc for booting the qmail
echo "Install the rc..."
cp $SHELL_PATH/rc /var/qmail/
chmod 755 /var/qmail/rc
mkdir /var/log/qmail
echo "./Maildir" > /var/qmail/control/defaultdelivery
cp $SHELL_PATH/qmailctl /var/qmail/bin/qmailctl
chmod 755 /var/qmail/bin/qmailctl
ln -s /var/qmail/bin/qmailctl /usr/bin
# Make supervise directory
mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpd/log
# Creating /var/qmail/supervise/qmail-send/run
touch /var/qmail/supervise/qmail-send/run
echo '#!/bin/sh' >/var/qmail/supervise/qmail-send/run
echo 'exec /var/qmail/rc' >>/var/qmail/supervise/qmail-send/run
# Creating /var/qmail/supervise/qmail-send/log/run
touch /var/qmail/supervise/qmail-send/log/run
echo '#!/bin/sh' >/var/qmail/supervise/qmail-send/log/run
echo 'exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail' >> /var/qmail/supervise/qmail-send/log/run
# Creating /var/qmail/supervise/qmail-smtpd/run
cp $SHELL_PATH/qmail-send-run /var/qmail/supervise/qmail-smtpd/run
# concurrencyincoming
echo 20 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming
# Creating /var/qmail/supervise/qmail-smtpd/log/run
echo '#!/bin/sh' > /var/qmail/supervise/qmail-smtpd/log/run
echo 'exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/smtpd' >> /var/qmail/supervise/qmail-smtpd/log/run
# Set the file as runable
chmod 755 /var/qmail/supervise/qmail-send/run
chmod 755 /var/qmail/supervise/qmail-send/log/run
chmod 755 /var/qmail/supervise/qmail-smtpd/run
chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
# Creating log directory
mkdir -p /var/log/qmail/smtpd
chown qmaill /var/log/qmail /var/log/qmail/smtpd
# Line the /service directory
ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
# Waiting for the qmail start
echo "Now remove/bak send mail..."
if [ -e /usr/lib/sendmail ];
then
mv /usr/lib/sendmail /usr/lib/sendmail.old # ignore errors
mv /usr/sbin/sendmail /usr/sbin/sendmail.old # ignore errors
chmod 0 /usr/lib/sendmail.old /usr/sbin/sendmail.old # ignore errors
else
echo "Everything of sendmail seems oK!"
fi
ln -s /var/qmail/bin/sendmail /usr/lib
ln -s /var/qmail/bin/sendmail /usr/sbin
echo "---The sendmail is replaced ! ------OK!"
# Create the Alias for qmail
echo "create the Alias for qmail..."
cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
chmod 644 ~alias/.qmail*
echo "-----create the Alias for qmail-----OK!"
# Some details
echo "To do some small but vip things now..."
echo '127.:allow,RELAYCLIENT=""' >>/etc/tcp.smtp
/var/qmail/bin/qmailctl cdb
echo me >/var/qmail/alias/.qmail-root
echo me >/var/qmail/alias/.qmail-postmaster
echo me >/var/qmail/alias/.qmail-mailer-daemon
echo "-----do some smalls for qmail-----OK!"
检查基本系统吧,呵呵,防止以后出问题。
echo "Waiting for the Checking......"
$SHELL_PATH/inst_check
qmailctl stat
echo
echo "The basic Qmail is setup! Congratulations!"
阅读(2234) | 评论(0) | 转发(0) |