一:安装环境 FreeBSD 5.4-RELEASE
二:安装所需软件qmail-1.03.tar.gz ezmlm-0.53.tar.gz
ezmlm-idx-0.40.tar.gz vpopmail-5.4.0.tar.gz
三:安装步骤
1.添加相关用户以及用户所属的组
pw groupadd nofiles -g 7001
pw groupadd qmail -g 7002
pw groupadd vchkpw -g 7003
pw groupadd logadmin -g 9001
pw useradd alias -u 7001 -g nofiles -d /var/qmail/alias -s /bin/true
pw useradd qmaild -u 7002 -g nofiles -d /var/qmail -s /bin/true
pw useradd qmaill -u 7003 -g nofiles -d /var/qmail -s /bin/true
pw useradd qmailp -u 7004 -g nofiles -d /var/qmail -s /bin/true
pw useradd qmailq -u 7005 -g qmail -d /var/qmail -s /bin/true
pw useradd qmailr -u 7006 -g qmail -d /var/qmail -s /bin/true
pw useradd qmails -u 7007 -g qmail -d /var/qmail -s /bin/true
pw useradd vpopmail -u 7008 -g vchkpw -d /home/vpopmail -m -s /bin/true
pw useradd logadmin -u 9001 -g logadmin -d /home/logadmin -s /bin/true
2.安装 qmail
tar zxf qmail-1.03.tar.gz
patch -p0 < big-todo.103.patch #为qmail打布丁
(cd qmail-1.03 && patch < ../qmail-date-localtime.patch && \
patch -p0 < ../qmail-smtpd-relay-reject && \
echo "/usr/local/qmail" > conf-qmail && \
mkdir /usr/local/qmail && \
ln -s /usr/local/qmail /var/qmail && \
make setup check && \
./config && \
cp dnscname dnsfq dnsip dnsmxip dnsptr hostname ipmeprint /var/qmail/bin/.)
(rm /usr/sbin/sendmail && ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail)
(cd /var/qmail/alias && \
echo "&postmaster@data-hotel.net" > .qmail-postmaster && \
echo "&postmaster" > .qmail-root && \
echo "&postmaster" > .qmail-mailer-daemon && \
chown alias .qmail-*)
3.安装邮件列表
tar zxf ezmlm-0.53.tar.gz
tar zxf ezmlm-idx-0.40.tar.gz
mv ezmlm-idx-0.40/* ezmlm-0.53/. && rmdir ezmlm-idx-0.40 && \
(cd ezmlm-0.53 && \
patch < idx.patch && \
make clean && \
echo "/var/qmail/bin/ezmlm" > conf-bin && \
make && make man && make jp && make setup)
4.安装用户管理工具
tar zxf vpopmail-5.4.0.tar.gz
(cd vpopmail-5.4.0 && \
mkdir /home/vpopmail/etc && \
cp /dev/null /home/vpopmail/etc/tcp.smtp && \
(for x in `/var/qmail/bin/ipmeprint`; \
do echo "$x:allow,RELAYCLIENT=\"\"" >> /home/vpopmail/etc/tcp.smtp; done) && \
tcprules /home/vpopmail/etc/tcp.smtp.cdb /home/vpopmail/etc/tcp.smtp.tmp < \
/home/vpopmail/etc/tcp.smtp && \
chown -R vpopmail:vchkpw /home/vpopmail && \
./configure --enable-admin-email=postmaster@data-hotel.net \
--enable-passwd=y --disable-clear-passwd --enable-roaming-users=y && \
make && make install-strip)
(mkdir -p /usr/local/qmail/supervise && \
cd /usr/local/qmail/supervise && \
(for x in qmail-send qmail-smtpd qmail-pop3d
do
(mkdir $x && \
chmod +t $x && \
mkdir $x/log && \
mkdir $x/log/main && \
touch $x/log/status && \
chown logadmin:logadmin $x/log/main $x/log/status)
done))
for x in qmail-send qmail-smtpd qmail-pop3d
do
cp ./$x.run /usr/local/qmail/supervise/$x/run
chmod 755 /usr/local/qmail/supervise/$x/run
cp ./$x.logrun /usr/local/qmail/supervise/$x/log/run
chmod 755 /usr/local/qmail/supervise/$x/log/run
ln -s /usr/local/qmail/supervise/$x /service/.$x
done
mv /service/.qmail-send /service/qmail-send
5.起动qmail服务
svc -u /service/qmail-send
6.测试是否正常
#mail lianggui@livedoor.cn
Subject: test
this is a test mail!
阅读(1001) | 评论(0) | 转发(0) |