Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2161734
  • 博文数量: 317
  • 博客积分: 5670
  • 博客等级: 大校
  • 技术积分: 3677
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-10 17:51
文章分类

全部博文(317)

文章存档

2016年(2)

2015年(44)

2014年(68)

2013年(42)

2012年(23)

2011年(51)

2010年(67)

2009年(17)

2008年(3)

分类:

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-5.4.10.tar.gz

[root@mail src]# cd vpopmail-5.4.10

[root@mail vpopmail-5.4.10]#

[root@mail vpopmail-5.4.10]# mkdir -p /home/vpopmail/etc

[root@mail vpopmail-5.4.10]# echo "happy.com" > /home/vpopmail/etc/defaultdomain

[root@mail vpopmail-5.4.10]# echo '127.0.0.1:allow,RELAYCLIENT=""' > /home/vpopmail/etc/tcp.smtp

[root@mail vpopmail-5.4.10]# cd /home/vpopmail/etc

[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-5.4.10

[root@mail vpopmail-5.4.10]# ./configure --enable-incdir=/usr/include/mysql \

> --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 5.4.10          

            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-5.4.10]# make

[root@mail vpopmail-5.4.10]# make install-strip

[root@mail vpopmail-5.4.10]# echo 'export PATH=$PATH:/home/vpopmail/bin' >> /etc/profile

[root@mail vpopmail-5.4.10]# source /etc/profile

[root@mail vpopmail-5.4.10]# vadddomain happy.com zlwt

[root@mail vpopmail-5.4.10]# vadduser -q 10485760s chenwenming@happy.com 1234

[root@mail vpopmail-5.4.10]#

[root@mail vpopmail-5.4.10]# vmoduser -c chenwenming

[root@mail vpopmail-5.4.10]# vi /home/vpopmail/domains/.quotawarn.msg

[root@mail vpopmail-5.4.10]# echo "~{SJ<~1;>\>x~},~{SC;'5DSJOd?U; /home/vpopmail/domains/.over-quota.msgFrom: 邮箱管理员 

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-5.4.10]# echo "~{SJ<~1;>\>x~},~{SC;'5DSJOd?U /home/vpopmail/domains/.over-quota.msg

 

[root@mail vpopmail-5.4.10]# cp /app/src/toaster-scripts-0.8/vpopmailctl /var/qmail/bin

[root@mail vpopmail-5.4.10]# ln -s /var/qmail/bin/vpopmailctl  /usr/bin

[root@mail vpopmail-5.4.10]# chmod 755 /var/qmail/bin/vpopmailctl

 

[root@mail vpopmail-5.4.10]# cd /app/src/netqmail-1.05/netqmail-1.05

[root@mail netqmail-1.05]# bunzip2 -c /app/src/qmail-toaster-0.7.2.patch.bz2  | patch -p0

[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-4.0.2.tar.bz2

[root@mail src]# cd courier-imap-4.0.2

[root@mail courier-imap-4.0.2]# chown -R vpopmail:vchkpw ../courier-imap-4.0.2

[root@mail courier-imap-4.0.2]# su vpopmail

[vpopmail@mail courier-imap-4.0.2]$ ./configure --with-redhat

[vpopmail@mail courier-imap-4.0.2]$ make

[vpopmail@mail courier-imap-4.0.2]$ exit

exit

[root@mail courier-imap-4.0.2]# make install-strip

[root@mail courier-imap-4.0.2]# make install-configure

[root@mail courier-imap-4.0.2]# cp courier-imap.sysvinit /etc/init.d/courier-imap

[root@mail courier-imap-4.0.2]# chmod 755 /etc/rc.d/init.d/courier-imap

[root@mail courier-imap-4.0.2]# chkconfig --add courier-imap

[root@mail courier-imap-4.0.2]# chkconfig --list courier-imap

courier-imap    0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

[root@mail courier-imap-4.0.2]#

 

[root@mail courier-imap-4.0.2]# vi /usr/lib/courier-imap/etc/imapd

IMAPDSTART=YES

[root@mail courier-imap-4.0.2]# vi /usr/lib/courier-imap/etc/imapd-ssl

IMAPDSSLSTART=YES

[root@mail courier-imap-4.0.2]# vi /usr/lib/courier-imap/etc/imapd.cnf

CN=happy.com

[root@mail courier-imap-4.0.2]# vi /usr/lib/courier-imap/etc/pop3d.cnf

CN=happy.com

[root@mail courier-imap-4.0.2]# /etc/rc.d/init.d/courier-imap start

 

[root@mail courier-imap-4.0.2]# cd /app/src

[root@mail src]# tar -xjf squirrelmail-1.4.5.tar.bz2

[root@mail src]# cd squirrelmail-1.4.5

[root@mail squirrelmail-1.4.5]# cd plugins/

[root@mail plugins]# tar -xzf ../../quota_usage-1.3-1.2.7.tar.gz

[root@mail plugins]# cp quota_usage/config.php.sample quota_usage/config.php

[root@mail plugins]# cd ..

[root@mail squirrelmail-1.4.5]# ./configure

#选择 “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”改成“GB2312”。保存退出。

[root@mail squirrelmail-1.4.5]# mv data /var/www/

[root@mail squirrelmail-1.4.5]# chown -R apache:apache /var/www/data

[root@mail squirrelmail-1.4.5]# cd ..

[root@mail src]# mv squirrelmail-1.4.5 /var/www/html/squirrelmail

[root@mail src]#

[root@mail root]# cd /app/src

[root@mail src]# tar -xzf autorespond-2.0.5.tar.gz

[root@mail src]# cd autorespond-2.0.5

[root@mail autorespond-2.0.5]# make

gcc -O2 -Wall -g  autorespond.c -o autorespond

[root@mail autorespond-2.0.5]# make install

install -d /usr/bin /usr/share/man/man1

install autorespond /usr/bin

install autorespond.1 /usr/share/man/man1

[root@mail autorespond-2.0.5]#

[root@mail autorespond-2.0.5]# cd /app/src

[root@mail src]# tar -xzf ezmlm-0.53.tar.gz

 [root@mail src]# tar -zxf ezmlm-idx-5.0.2.tar.gz

 [root@mail src]# cp -rf ezmlm-idx-5.0.2/* ezmlm-0.53/

[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-1.2.3.tar.gz

[root@mail src]# cd qmailadmin-1.2.3

[root@mail qmailadmin-1.2.3]#

[root@mail qmailadmin-1.2.3]# ./configure --enable-htmldir=/var/www/html --enable-cgibindir=/var/www/cgi-bin \

> --enable-vpopuser=vpopmail --enable-autoresponcder-bin=/usr/bin \

> --disable-ezmlm-mysql --enable-maxusersperpage=20 --enable-maxaliasesperpage=20 --enable-modify-quota \

> --enable-domain-autofill

 

            qmailadmin 1.2.3

            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-1.2.3]#

[root@mail qmailadmin-1.2.3]# make

[root@mail qmailadmin-1.2.3]# make install-strip

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 195 to server version: 3.23.58

 

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 = 20M      ; Maximum amount of memory a script may consume (8MB)

post_max_size = 20M

upload_max_filesize = 10M

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://

 Qmail本身不支持很多反垃圾邮件功能,按照Qmail的惯例,通常需要安装一些补丁来提供这些功能。以下针对这些服务简单阐述其配置使用方法:

 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

阅读(5573) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~