软件列表:
checkpassword-0.90(pop3验证用户程序) cmd5checkpw-0.22.tar.gz ucspi-tcp-0.88(tcpserver等服务程序) qmail-smtpd-auth-0.30.tar.gz(smtp补丁程序) qmail-1.03.tar.gz(Qmail基本系统包) vpopmail-5.2.1.tar.gz(虚拟域用户pop3支持) ezmlm-0.53.tar.gz(邮件列表管理软件) autorespond.tar.gz(自动回复程序) qmailadmin-1.0.6.tar.gz(虚拟域web方式管理) |
安装前准备工作:
新建qmail 安装目录 # mkdir /var/qmail: 添加qmail所必须的用户和组 # groupadd nofiles |
安装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.gzSMTP补丁及其它补丁:# 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 //将函数straynewline中的451改为553 //将451改为553是为避免当其它服务器给你发来无效格式的邮件时,你的服务器陷入循环应答。 # make setup check #./config-fast test.com |
# cd ~alias;touch .qmail-postmaster .qmail-mailer-daemon .qmail-root # echo test.com > /var/qmail/control/helohost \\主机名(解决新浪拒收邮件问题) # 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 |
# /etc/rc.d/init.d/sendmail stop# rpm –e –nodeps sendmail |
安装虚拟域 # groupadd vchkpw # cd vpopmail-5.2.1 # crontab –e 安装邮件列表 # tar xzvf ezmlm-0.53-idx-0.41.tar.gz 安装自动回复程序 # tar zxvf autorespond.tar.gz 安装虚拟域web方式管理 # tar xzvf qmailadmin-1.0.6.tar.gz 建Qmail启动文件 # 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 启动文件中的用户组为vpopmail用户组 如果不能启动qmail,执行touch /etc/dnsrewrite |
SMTP认证测试 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 testpass test输入用户密码后出现回应,若出现test用户的home目录,则SMTP成功;若提示:"-ERR authorization failed",则SMTP失败 |