全部博文(317)
分类:
2010-01-19 19:01:35
5. 安装vpopmail
[root@mail root]# groupadd vchkpw -g 89
[root@mail root]# useradd vpopmail -u 89 -g vchkpw
[root@mail root]# cd /app/src
[root@mail src]# tar -zxf vpopmail-
[root@mail src]# cd vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail etc]# tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
[root@mail etc]# echo "localhost|0|vpopmail|zlwt|vpopmail" > /home/vpopmail/etc/vpopmail.mysql
[root@mail etc]# chmod 640 /home/vpopmail/etc/vpopmail.mysql
[root@mail etc]# chown -R vpopmail.vchkpw /home/vpopmail/etc
[root@mail etc]# mysql -u root -pzlwt
mysql> CREATE DATABASE vpopmail;
Query OK, 1 row affected (0.04 sec)
mysql> GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmail@localhost IDENTIFIED BY 'zlwt';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> QUIT
[root@mail etc]# cd /app/src/vpopmail-
[root@mail vpopmail-
> --enable-libdir=/usr/lib/mysql --disable-roaming-users --enable-logging=p \
> --disable-passwd --enable-clear-passwd --disable-domain-quotas \
> --enable-auth-module=mysql --enable-auth-logging --enable-sql-logging \
> --disable-valias --disable-mysql-limits --enable-learn-passwords
vpopmail
Current settings
---------------------------------------
vpopmail directory = /home/vpopmail
uid = 89
gid = 89
roaming users = OFF --disable-roaming-users (default)
password learning = ON --enable-learn-passwords
md5 passwords = ON --enable-md5-passwords (default)
file locking = ON --enable-file-locking (default)
vdelivermail fsync = OFF --disable-file-sync (default)
make seekable = ON --enable-make-seekable (default)
clear passwd = ON --enable-clear-passwd (default)
user dir hashing = ON --enable-users-big-dir (default)
address extensions = OFF --disable-qmail-ext (default)
ip alias = OFF --disable-ip-alias-domains (default)
domain quotas = OFF --disable-domainquotas (default)
auth module = mysql --enable-auth-module=mysql
mysql replication = OFF --disable-mysql-replication (default)
sql logging = ON --enable-sql-logging
mysql limits = OFF --disable-mysql-limits (default)
MySQL valias = OFF --disable-valias (default)
auth inc = -I/usr/include/mysql
auth lib = -L/usr/lib/mysql -lmysqlclient -lz -lm
system passwords = OFF --disable-passwd (default)
pop syslog = show failed attempts with clear text password
--enable-logging=p
auth logging = ON --enable-auth-logging (default)
all domains in one SQL table = --enable-many-domains (default)
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
Reply-To: postmaster@domain.com
To: 邮箱用户
Subject: 邮箱空间警告
Mime-Version: 1.0
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: base64
您的邮箱空间已经达到90%.如果想继续使用,请删除一些信件.
如果需要帮助,请联系邮箱管理员:
Email : postmaster@domain.com
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail vpopmail-
[root@mail netqmail-1.05]# bunzip2 -c /app/src/qmail-toaster-
[root@mail netqmail-1.05]# make clean
rm -f `cat TARGETS`
[root@mail netqmail-1.05]# make
[root@mail netqmail-1.05]#
[root@mail netqmail-1.05]# qmailctl stop
Stopping qmail...
qmail-send
qmail-smtpd
[root@mail netqmail-1.05]# make setup check
[root@mail netqmail-1.05]# chown -R vpopmail:vchkpw /var/qmail/spam
[root@mail netqmail-1.05]# make cert
Country Name (2 letter code) [GB]:CN
[root@mail root]# cd /app/src/netqmail-1.05/netqmail-1.05
[root@mail netqmail-1.05]# make tmprsadh
[root@mail netqmail-1.05]# chown -R vpopmail:qmail /var/qmail/control/clientcert.pem /var/qmail/control/servercert.pem
# 用"crontab -e"在crontab里增加下面这条,每天晚上更新temp keys
01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1
[root@mail netqmail-1.05]# qmailctl start
Starting qmail
[root@mail netqmail-1.05]#
[root@mail netqmail-1.05]# ln -s /var/qmail/supervise/qmail-pop3d /service
[root@mail netqmail-1.05]# ln -s /var/qmail/supervise/qmail-pop3ds /service
[root@mail netqmail-1.05]#
[root@mail netqmail-1.05]# vpopmailctl start
Starting qmail-pop3d
Starting qmail-pop3ds
[root@mail netqmail-1.05]#
[root@mail root]# cd /app/src
[root@mail src]# tar -xjf courier-authlib-0.55.tar.bz2
[root@mail src]# cd courier-authlib-0.55
[root@mail courier-authlib-0.55]# ./configure --prefix=/usr/local --exec-prefix=/usr/local \
> --with-authvchkpw --without-authldap --without-authmysql --disable-root-check \
> --with-ssl --with-authchange pwdir=/usr/local/libexec/authlib --with-redhat
[root@mail courier-authlib-0.55]# make
[root@mail courier-authlib-0.55]# make install
[root@mail courier-authlib-0.55]# make install-configure
[root@mail courier-authlib-0.55]# vi /usr/local/etc/authlib/authdaemonrc
authmodulelist="authvchkpw"
[root@mail courier-authlib-0.55]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
[root@mail courier-authlib-0.55]# chmod 755 /etc/init.d/courier-authlib
[root@mail courier-authlib-0.55]# ln -s ../init.d/courier-authlib /etc/rc3.d/S80courier-authlib
[root@mail courier-authlib-0.55]# ln -s ../init.d/courier-authlib /etc/rc5.d/S80courier-authlib
[root@mail courier-authlib-0.55]# /etc/init.d/courier-authlib start
Starting Courier authentication services: authdaemond
[root@mail courier-authlib-0.55]#
[root@mail courier-authlib-0.55]# authtest 1234
Authentication succeeded.
Authenticated: (uid 89, gid 89)
Home Directory: /home/vpopmail/domains/u-happy.com/zhou
Maildir: (none)
Quota: (none)
Encrypted Password: $1$TcWL6BBO$QQGPpi7W3KaPJP6isq26T.
Cleartext Password: 1234
Options: disablewebmail=0,disablepop3=0,disableimap=0
[root@mail courier-authlib-0.55]#
[root@mail courier-authlib-0.55]# cd /app/src
[root@mail src]# tar -xjf courier-imap-
[root@mail src]# cd courier-imap-
[root@mail courier-imap-
[root@mail courier-imap-
[vpopmail@mail courier-imap-
[vpopmail@mail courier-imap-
[vpopmail@mail courier-imap-
exit
[root@mail courier-imap-
[root@mail courier-imap-
[root@mail courier-imap-
[root@mail courier-imap-
[root@mail courier-imap-
[root@mail courier-imap-
courier-imap 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@mail courier-imap-
[root@mail courier-imap-
IMAPDSTART=YES
[root@mail courier-imap-
IMAPDSSLSTART=YES
[root@mail courier-imap-
CN=happy.com
[root@mail courier-imap-
CN=happy.com
[root@mail courier-imap-
[root@mail courier-imap-
[root@mail src]# tar -xjf squirrelmail-
[root@mail src]# cd squirrelmail-
[root@mail squirrelmail-
[root@mail plugins]# tar -xzf ../../quota_usage-1.3-
[root@mail plugins]# cp quota_usage/config.php.sample quota_usage/config.php
[root@mail plugins]# cd ..
[root@mail squirrelmail-
#选择 “2. Server Settings”=>;“A. Update IMAP Settings”=>;“8. Server software”改成“courier”;回到主菜单,选择“4.General Options”=>;“1. Data Directoryand”改成“/var/www/data/”;再退回主菜单,选择“8. Plugins”=>;添加你希望用到的插件。回到主菜单,选择“10. Languages”,将“ Default Language”改成“zh_CN”,“Default Charset”改成“GB
[root@mail squirrelmail-
[root@mail squirrelmail-
[root@mail squirrelmail-
[root@mail src]# mv squirrelmail-
[root@mail src]#
[root@mail root]# cd /app/src
[root@mail src]# tar -xzf autorespond-
[root@mail src]# cd autorespond-
[root@mail autorespond-
gcc -O2 -Wall -g autorespond.c -o autorespond
[root@mail autorespond-
install -d /usr/bin /usr/share/man/man1
install autorespond /usr/bin
install autorespond.1 /usr/share/man/man1
[root@mail autorespond-
[root@mail autorespond-
[root@mail src]# tar -xzf ezmlm-0.53.tar.gz
[root@mail src]# tar -zxf ezmlm-idx-
[root@mail src]# cp -rf ezmlm-idx-
[root@mail src]# cd ezmlm-0.53
[root@mail ezmlm-0.53]# patch < idx.patch
[root@mail ezmlm-0.53]# vi conf-lang
ch_GB
The default language to use.
Valid choices are listed in the "text" directory.
[root@mail ezmlm-0.53]# make
[root@mail ezmlm-0.53]# make setup
[root@mail ezmlm-0.53]# cd /app/src
[root@mail src]# tar -zxf qmailadmin-
[root@mail src]# cd qmailadmin-
[root@mail qmailadmin-
[root@mail qmailadmin-
> --enable-vpopuser=vpopmail --enable-autoresponcder-bin=/usr/bin \
> --disable-ezmlm-mysql --enable-maxusersperpage=20 --enable-maxaliasesperpage=20 --enable-modify-quota \
> --enable-domain-autofill
qmailadmin
Current settings
---------------------------------------
cgi-bin dir = /var/www/cgi-bin
html dir = /var/www/html
image dir = /var/www/html/images/qmailadmin
image URL = /images/qmailadmin
template dir = /usr/local/share/qmailadmin
qmail dir = /var/qmail
vpopmail dir = /home/vpopmail
autorespond dir = /usr/bin
ezmlm dir = /usr/local/bin/ezmlm
ezmlm idx = yes
mysql for ezmlm = no
help = no
modify quota = yes
domain autofill = yes
modify spam check = no
[root@mail qmailadmin-
[root@mail qmailadmin-
[root@mail qmailadmin-
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 195 to server version:
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use vpopmail
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> drop table lastauth;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table vpopmail;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
[root@mail config]# vi /var/www/html/igenus/docs/iGENUS.sql
[root@mail config]# mysql -u root –pzlwt
mysql> source /var/www/html/igenus/docs/iGENUS.sql
[root@mail config]# vi /etc/php.ini
max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit =
post_max_size =
upload_max_filesize =
register_globals = On
session.bug_compat_42 = 0
session.bug_compat_warn = 0
sendmail_path = /var/qmail/bin/qmail-inject
[root@mail conf]# cd /etc/httpd/conf
[root@mail conf]# vi httpd.conf
User vpopmail
Group vchkpw
[root@mail src]# service httpd restart
[root@mail conf]# cd /app/src
[root@mail src]# tar -zxf igenus_admin_01.1.tgz -C /var/www/html/igenus/
[root@mail src]# vi /var/www/html/igenus/admin/includes/config_inc.php
$CFG_VPOPMAIL_HOST = "mail";
$CFG_VPOPMAIL_USER = "vpopmail";
$CFG_VPOPMAIL_PASS = "zlwt";
$CFG_VPOPMAIL_DB = "vpopmail";
$CFG_VPOPMAIL_TABLE = "vpopmail";
$CFG_ADMIN_TABLE = "admin";
$CFG_LAGESITE = true;
$CFG_NUMOFPAGE = 20;
$CFG_MAILBOX['inbox'] = ".";
$CFG_MAILBOX['outbox'] = ".Outbox";
$CFG_MAILBOX['draft'] = ".Draft";
$CFG_MAILBOX['trash'] = ".Trash";
$CFG_VPOPMAIL_PATH = "/home/vpopmail";
[root@mail src]# touch /etc/syspasswd.dat
http://
CBL、CDL与CDL+采用的都是DNS方式的实时黑名单技术,在Qmail中都使用rblsmptd来配置。
在老版本的ucspi-tcp里,你需要下载一下补丁程序来增加这个功能。
下载地址:
Qmail的rblsmtpd必须要和ucspi-tcp结合在一起使用。
rblsmtpd的安装方法很简单。在解开的源码目录中
make
make setup check
注:在新版的ucspi-tcp 0.88里,已经包含了rblsmtpd,直接安装ucspi-tcp 0.88就可以了。
安装完后修改你的SMTP启动脚本,加上红色的部分,如下:
vi /var/qmail/supervise/qmail-smtpd/run
#!/bin/sh
QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 8000000 \
/usr/local/bin/tcpserver -v -H -R -l 0 \
-x /home/vpopmail/etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/bin/rblsmtpd \
-r cblless.anti-spam.org.cn \
/var/qmail/bin/qmail-smtpd \
/home/vpopmail/bin/vchkpw /bin/true 2>&1
然后重启一下run进程,查看一下日志:
tail -f /var/log/qmail/smtpd/current
@4000000048dc3d951ad2052c rblsmtpd: 219.137.89.240 pid 7878: 451 Mail from 219.137.89.240 refused, see
这样整个世界就安静下来了,只要对方的IP在黑名单里都refused。
参考地址:
http://www.cnblogs.com/maple/archive/2006/11/03/549088.html