Qmail Setup

2009-05-13 03:52:21来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


吼,我的一个哥们发给我的,顺便贴出来

1.安装mysql
cd /usr/ports/database/mysql40-server
make WITH_XCHARSET=all DB_DIR=/home/mysqldb BUILD_OPTIMIZED=yes install clean

修改mysql的绑定地址及最大连接数
修改/usr/local/etc/rc.d/mysql-server.sh中
/usr/local/bin/mysqld_safe --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null &

/usr/local/bin/mysqld_safe --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} --bind-address=127.0.0.1 -O max_connections=512 > /dev/null &

修改mysql的密码
use mysql;
set  password for 'root'@'localhost' = password ('1198205255');

--------------------------------------

2.安装qmail
cd /usr/ports/mail/qmail
make patch
cd work/qmail-1.03
tar xjvf spamcontrol.tar.bz2
./spamcontrol.sh
cd ../..
make install clean

cd /var/qmail/configure
./config-fast nxl.3322.org

cp /var/qmail/boot/maildir /var/qmail/rc   (后面还会修改)

mv /usr/sbin/sendmail /usr/sbin/sendmail.old
ln -s /var/qmail/bin/sendmail /usr/sbin

-------------------------------------

3.安装vpopmail
make WITH_MYSQL=yes WITH_MYSQL_SERVER=localhost WITH_MYSQL_USER=root WITH_MYSQL_PASSWD=computer WITH_MYSQL_DB=vpopmail WITH_MYSQL_LIMITS=yes install clean

chmod 6755 /usr/local/vpopmail/bin/vchkpw

修改/usr/local/vpopmail/etc/tcp.smtp为
127.0.0.1:allow,RELAYCLIENT="",REQUIREAUTH=""
如果不加127.0.0.1会不能收其他域的邮件
但是这样,对本域的验证就失效了

生成tcp.smtp.cdb
cd /usr/local/vpopmail/etc
tcprules tcp.smtp.cdb tcp.smtp.tmp

---------------------------------------

4.安装daemontools
cd /usr/ports/sysutils/daemontools
make install clean

daemontools目录结构如下:


建立daemontools目录结构
mkdir -p /var/log/qmail/smtpd
mkdir -p /var/log/qmail/pop3d
mkdir -p /var/log/qmail/send
mkdir /var/service
mkdir -p /var/qmail/supervise/smtpd/log
mkdir -p /var/qmail/supervise/pop3d/log
mkdir -p /var/qmail/supervise/send/log
ln -s /var/qmail/supervise/* /var/service

改变权限
chmod -R 755 /var/log/qmail
chown -R qmaill /var/log/qmail
chmod 755 /var/service
chmod 755 /var/qmail/supervise
chmod +t /var/qmail/supervise/smtpd
chmod +t /var/qmail/supervise/pop3d
chmod +t /var/qmail/supervise/send

修改/var/qmail/rc
#!/bin/sh
#
#
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/

建立supervise脚本
touch /var/qmail/supervise/send/run
#!/bin/sh
exec /var/qmail/rc

touch /var/qmail/supervise/send/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/send

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:在线生成iptables脚本的网站

下一篇:Dns 服务器安装日志