Linux系統(tǒng)Qmail郵件服務(wù)器安裝過程解析 |
發(fā)布時(shí)間: 2012/5/28 10:17:09 |
安裝前準(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)文件
如果不能啟動(dòng)qmail,執(zhí)行touch /etc/dnsrewrite 測試: SMTP認(rèn)證測試 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失敗 本文出自:億恩科技【mszdt.com】 服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM] |