軟件列表:
checkpassword-0.90(pop3驗(yàn)證用戶程序)
cmd5checkpw-0.22.tar.gz
ucspi-tcp-0.88(tcpserver等服務(wù)程序)
qmail-smtpd-auth-0.30.tar.gz(smtp補(bǔ)丁程序)
qmail-1.03.tar.gz(Qmail基本系統(tǒng)包)
vpopmail-5.2.1.tar.gz(虛擬域用戶pop3支持)
ezmlm-0.53.tar.gz(郵件列表管理軟件)
autorespond.tar.gz(自動(dòng)回復(fù)程序)
qmailadmin-1.0.6.tar.gz(虛擬域web方式管理)
以上所有軟件可從以網(wǎng)址下載:
http://www.qmail.org
http://www.inter7.com/qmail
安裝前準(zhǔn)備工作:
新建qmail 安裝目錄
# mkdir /var/qmail:
添加qmail所必須的用戶和組
# groupadd nofiles
# useradd -g nofiles -d /var/qmail/alias alias
# useradd -g nofiles -d /var/qmail qmaild
# useradd -g nofiles -d /var/qmail qmaill
# useradd -g nofiles -d /var/qmail qmailp
# groupadd qmail
# useradd -g qmail -d /var/qmail qmailq
# useradd -g qmail -d /var/qmail qmailr
# useradd -g qmail -d /var/qmail qmails
安裝qmail基本系統(tǒng):
安裝checkpassword-0.90(/bin)
# cd /usr/local/src
# tar xzvf checkpassword-0.90.tar.gz
# cd checkpassword-0.90
# patch -p1 <../patch/checkpassword-0.90.errno.patch
# make
# make setup check
安裝cmd5checkpw-0.22.tar.gz
# tar zxvf cmd5checkpw-0.22.tar.gz
# mkdir /usr/man
# mkdir /usr/man/man8
# cd cmd5checkpw-0.22
# make
# make install
安裝ucspi-tcp-0.88(/usr/local/bin)
# cd /usr/local/src
# tar xzvf ucspi-tcp-0.88.tar.gz
# cd ucspi-tcp-0.88
# patch -p1 < ../patch/ucspi-tcp-0.88.a_record.patch
# patch -p1 < ../patch/ucspi-tcp-0.88.errno.patch
# patch -p1 < ../patch/ucspi-tcp-0.88.nodefaultrbl.patch
# make
# make setup check
安裝Qmail(qmail-1.03.tar.gz)
# tar xzvf qmail-1.03.tar.gz
SMTP補(bǔ)丁及其它補(bǔ)丁:
# tar zxvf qmail-smtpd-auth-0.30.tar.gz
# cd qmail-smtpd-auth-0.30
# cp base64.c base64.h README.auth ../qmail-1.03/
# patch -d ../qmail-1.03 < auth.patch
# cd qmail-1.03
# patch -p1 < ../patch/qmail-103.patch
# patch -p1 < ../patch/qmailqueue-patch
# patch -p1 < ../patch/qmail-maildir++.patch
# patch -p1 < ../patch/qmail-1.03.errno.patch
# patch -p1 < ../patch/qmail-1.03.qmail_local.patch
# vi qmail-smtpd.c //將函數(shù)straynewline中的451改為553
//將451改為553是為避免當(dāng)其它服務(wù)器給你發(fā)來無效格式的郵件時(shí),你的服務(wù)器陷入循環(huán)應(yīng)答。
# make setup check
#./config-fast test.com
建立系統(tǒng)別名:
# cd ~alias;touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
# echo test.com > /var/qmail/control/helohost \\主機(jī)名(解決新浪拒收郵件問題)
# chmod 644 ~alias/.qmail*
# echo "127.0.0.1:allow,RELAYCLIENT=""" > /etc/tcp.smtp
# chmod 4755 /bin/checkpassword
# sed 's/Mailbox/Maildir\//' /var/qmail/boot/home >/var/qmail/rc
(修改/var/qmail/rc把./Mailbox 改成./Maildir/ 使用Maildir的pop3收信方式)
# chmod 755 /var/qmail/rc
停止sendmail 服務(wù):
# /etc/rc.d/init.d/sendmail stop
# rpm –e –nodeps sendmail
Qmail Web管理系統(tǒng):
安裝虛擬域
# groupadd vchkpw
# useradd -g vchkpw vpopmail
# mkdir ~vpopmail/etc
# echo "127.0.0.:allow,RELAYCLIENT=\"\"" > ~vpopmail/etc/tcp.smtp
# echo ":allow" >/etc/tcp.smtp
# /usr/local/bin/tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
# cd /usr/local/src
# tar xzvf vpopmail-5.2.1.tar.gz
# cd vpopmail-5.2.1
#./configure --enable-roaming-users=y --enable-default-domain=test.com --enable-passwd=n
# make
# make install-strip
# crontab –e
40 * * * * /home/vpopmail/bin/clearopensmtp 2>&1 > /dev/null
# cd /home/vpopmail/bin
#./vadddomain test.com eitop
#./vadduser test@test.com test
# chmod 6755 /home/vpopmail/bin/vchkpw
安裝郵件列表
# tar xzvf ezmlm-0.53-idx-0.41.tar.gz
# cd ezmlm-0.53-idx-0.41
# make
# make man
# make setup
安裝自動(dòng)回復(fù)程序
# tar zxvf autorespond.tar.gz
# make(gcc -Wall -o autorespond autorespond.c)
# make install(cp autorespond /usr/local/bin/autorespond)
安裝虛擬域web方式管理
# tar xzvf qmailadmin-1.0.6.tar.gz
# cd qmailadmin-1.0.6
#./configure --enable-htmldir=/www/web1 --enable-cgibindir=/usr/local/apache2/cgi-bin
# make
# make install-strip
建Qmail啟動(dòng)文件
# vi /etc/rc.d/init.d/qmail
#! /bin/sh
case "$1" in
start)
echo -n "start qmail:"
/var/qmail/rc &
echo "."
echo -n "start smtp service:"
/usr/local/bin/tcpserver -H -R -l 0 -t 1 -c 100 -x /etc/tcp.smtp.cdb -u 512 -g 505 0 smtp /var/qmail/bin/qmail-smtpd test.com /home/vpopmail/bin/vchkpw /bin/true /bin/md5checkpw /bin/true &
echo "."
echo -n "start pop3 service:"
/usr/local/bin/tcpserver -l test.com -U -c 100 -H -R 0 pop3 /var/qmail/bin/qmail-popup test.com /home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir &
echo "."
;;
stop)
echo -n "stop qmail:"
echo "."
;;
*)
exit 1
;;
esac
exit 0
# chmod 755 /etc/rc.d/init.d/qmail
# /etc/rc.d/init.d/qmail start
啟動(dòng)文件中的用戶組為vpopmail用戶組
如果不能啟動(dòng)qmail,執(zhí)行touch /etc/dnsrewrite
測(cè)試:
SMTP認(rèn)證測(cè)試
su - qmaild -c "/var/qmail/bin/qmail-popup localhost /home/vpopmail/bin/vchkpw pwd"
su - qmaild -c "/var/qmail/bin/qmail-popup localhost /bin/checkpassword pwd"
user test
pass test
輸入用戶密碼后出現(xiàn)回應(yīng),若出現(xiàn)test用戶的home目錄,則SMTP成功;若提示:"-ERR authorization failed",則SMTP失敗
Web管理測(cè)試:
打開http://localhost/cgi-bin/qmailadmin,輸入域名test.com和密碼,進(jìn)入管理界面,新建郵箱用戶和郵件列表。
郵件測(cè)試:
主要測(cè)試內(nèi)網(wǎng)用戶互發(fā)郵件,內(nèi)多與外網(wǎng)互發(fā)郵件。 本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|