分类:
2007-03-01 14:34:16
第五节:安装vpopmail TOP
#创建目录:
mkdir -p /home/vpopmail/etc
# 设置默认域,红色部份改成你要设置的域。
echo "domain.com" >; /home/vpopmail/etc/defaultdomain
[root@sys-server log]# mkdir -p /home/vpopmail/etc
[root@sys-server log]# echo
[root@sys-server log]# echo "uland.com.cn" > /home/vpopmail/etc/defaultdomain
# 设置smtp规则,关闭open relays
[root@sys-server log]# echo '127.0.0.1:allow,RELAYCLIENT=""' > /home/vpopmail/et
c/tcp.smtp
[root@sys-server log]# cd /home/vpopmail/etc
[root@sys-server etc]# tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
# 设置MySQL信息,第一个vpopmail是帐号,xukixu为密码,第二个vpopmail是数据库
[root@sys-server etc]# echo "localhost|0|vpopmail|xukixu|vpopmail" > /home/vpopmail/etc/vpopmail.mysql
[root@sys-server etc]# chmod 640 /home/vpopmail/etc/vpopmail.mysql
[root@sys-server etc]# chown -R vpopmail.vchkpw /home/vpopmail
# 在MySQL里添加vpopmail的帐号
[root@sys-server etc]# mysql -u root –p(c2sptmjf)
CREATE DATABASE vpopmail;
GRANT select,insert,update,delete,create,drop ON vpopmail.*
TO vpopmail@localhost IDENTIFIED BY 'xukixu';
FLUSH PRIVILEGES;
QUIT
mysql> CREATE DATABASE vpopmail ;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT select,insert,update,delete,create,drop ON vpopmail.* TO 'vpopmail'@'localhost' IDENTIFIED BY
-> 'xukixu';
Query OK, 0 rows affected (0.01 sec)
#安装:
cd /home/pkg/
tar zxvf vpopmail-
cd 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
v
make
make install-strip
#管理:
echo 'export PATH=$PATH:/home/vpopmail/bin' >;>; /etc/profile
source /etc/profile
# 添加域,红色部份前面是域名,后面是管理员(postmaster)密码
vadddomain domain.com xukixu
[root@sys-server vpopmail-5.4.10]# vadddomain uland.com.cn xukixu
# 添加用户,红色部份为注解,不用输入
vadduser -q 10485760S(邮箱大小) xukixu@domain.com(邮箱帐号) 1234(密码)
vmoduser -c 许靖(邮箱描述) xukixu@domain.com
[root@sys-server vpopmail-
[root@sys-server vpopmail-
# 设置邮箱容量达到90%的警告信息
vi /home/vpopmail/domains/.quotawarn.msg
From: 邮箱管理员
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@sys-server vpopmail-5.4.10]# vi /home/vpopmail/domains/.quotawarn.msg
From: postmaster
Reply-To: postmaster@uland.com.cn
To: mailusers
Subject: space warnning
Mime-Version: 1.0
Content-Type: text/html;charset=gb2312
Content-Transfer-Encoding: base64
Your mail space is already use 90%,if you want to use it go on ,please delete so
me mail .
If you need support,please content postmaster.
Email: postmaster@uland.com.cn
# 设置邮箱已满的警告信息
echo "邮件被拒绝,用户的邮箱空间已满." >; /home/vpopmail/domains/.over-quota.msg
[root@sys-server vpopmail-
#启动脚本:
cp /home/pkg/toaster-scripts-0.7/vpopmailctl /var/qmail/bin
ln -s /var/qmail/bin/vpopmailctl /usr/bin
chmod 755 /var/qmail/bin/vpopmailctl
CN
#现在打上qmail的补丁:
cd /home/pkg/netqmail-1.05/netqmail-1.05
bunzip2 -c /home/pkg/qmail-toaster-
make clean
make
qmailctl stop
make setup check
chown -R vpopmail:vchkpw /var/qmail/spam
#创建SSL Key
make cert
#按提示输入公司信息
[root@mail netqmail-1.05]# make cert
Generating a 1024 bit RSA private key
.............++++++
...............++++++
writing new private key to '/var/qmail/control/servercert.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:GD
Locality Name (eg, city) [Newbury]:SZ
Organization Name (eg, company) [My Company Ltd]:Domain
Organizational Unit Name (eg, section) []:Domain
Common Name (eg, your name or your server's hostname) []:domain.com
Email Address []:xukixu@domain.com
make tmprsadh
#注:这里可能要多等一会
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
#起动qmail
qmailctl start
# 用daemontools来启动qmail-pop3d和qmail-pop3ds
ln -s /var/qmail/supervise/qmail-pop3d /service
ln -s /var/qmail/supervise/qmail-pop3ds /service
#命令:
# 启动,停止,重启,查看队列等
vpopmailctl start|stop|restart|stat|pause|cont|help
# 检查服务
netstat -an | grep 110
ps -ef | grep qmail
安装选项参考:
vpopmail
Current settings
---------------------------------------
vpopmail directory = /home/vpopmail
uid = 89
gid = 89
roaming users = OFF --disable-roaming-users (default)
password learning = ON --disable-learn-passwords (default)
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)
#POP3和SMTP测试
用outlook测试qmail的smtp和pop3是否正常,注意由于vpopmail支持虚拟域名,所以在outlook中设置邮件帐号时,用户名后要加上域名,如demo@demo.com。smtp是带认证的,在outlook中也要作相应设置。建议先测试正常后再进行下一步安装。如果qmail出现问题,可查看mysql中的vpopmail数据库,/var/log下的mysqld和maillog日志记录,这样容易很快找出问题。
第六节:安装iGenus(可选) TOP
#安装:
cd /home/pkg
tar zxvf igenus_
cd /var/www/
rm -rf html/
mv igenus html
#建temp文件夹
mkdir /tmp/temp
chmod -R 0755 /tmp/temp
chown -R vpopmail:vchkpw /tmp/temp
mkdir /home/netdisk
chmod -R 0755 /home/netdisk
chown -R vpopmail:vchkpw /home/netdisk
chmod -R 0755 /var/www/html/
chown -R vpopmail:vchkpw /var/www/html/
#修改httpd.conf
vi /etc/httpd/conf/httpd.conf
User vpopmail
Group vchkpw
DocumentRoot "/var/www/html/"
AddDefaultCharset GB2312 //使默认页面为中文
/etc/rc.d/init.d/httpd restart //重启apache,使修改生效
#修改config_inc.php文件
cd /var/www/html/config
vi config_inc.php
$CFG_BASEPATH = "/var/www/html/"; \\改成你安装的目录
$CFG_MYSQL_HOST = 'localhost';
$CFG_MYSQL_USER = 'vpopmail'; \\vpopmail访问mysql的帐号
$CFG_MYSQL_PASS = 'xukixu'; \\vpopmail访问mysql的密码
$CFG_MYSQL_DB = 'vpopmail'; \\数据库
$CFG_TEMP = "/tmp/temp"; \\删除$CFG_BASEPATH,并修改路径
#重新编制Mysql数据库表格
#删除之前创建的域名
vdeldomain domain.com
#编辑数据库:
mysql -uroot -pxukixu
use vpopmail;
drop table lastauth;
drop table vpopmail;
quit;
#编辑/var/www/html/docs/iGENUS.sql
vi /var/www/html/docs/iGENUS.sql
# phpMyAdmin SQL Dump
# version
#
#
# Host: localhost
# Generation Time: Jun 04, 2004 at 11:26 AM
# Server version: 3.23.55
# PHP Version: 4.3.0
#
# Database : `vpopmail`
#
# --------------------------------------------------------
#
# Table structure for table `address`
#
use vpopmail; //加入这一行
CREATE TABLE `address` (
`id` int(11) unsigned NOT NULL auto_increment,
`pw_id` int(5) NOT NULL default '0',
`name` varchar(64) NOT NULL default '',
`email` varchar(128) NOT NULL default '',
UNIQUE KEY `id` (`id`),
KEY `pw_id` (`pw_id`)
) TYPE=MyISAM PACK_KEYS=1 ;
# --------------------------------------------------------
。。。。。。。。。
。。。。。。。。。。
CREATE TABLE `vpopmail` (
`pw_id` int(5) unsigned NOT NULL auto_increment,
`pw_name` varchar(32) NOT NULL default '',
`pw_domain` varchar(64) NOT NULL default '',
`pw_passwd` varchar(40) NOT NULL default '',
`pw_uid` int(11) default NULL,
`pw_gid` int(11) default NULL,
`pw_gecos` varchar(48) default NULL,
`pw_dir` varchar(255) default NULL,
`pw_shell` varchar(20) default NULL,
`pw_clear_passwd` varchar(16) default NULL, \\加入这一行
`createtime` timestamp(14) NOT NULL,
PRIMARY KEY (`pw_id`),
KEY `pw_name` (`pw_name`,`pw_domain`)
) TYPE=MyISAM PACK_KEYS=1 ;
#运行如下命令导入数据表
mysql -uroot -pxukixu
#设置igenus 定义允许上传下载的邮件的大小
#编辑/etc/php.ini
vi /etc/php.ini
max_execution_time=60
memory_limit=
post_max_size =
file_uploads=on
upload_max_filesize=
register_globals=On
session.bug_compat_42=0
session.bug_compat_warn=0
sendmail_path = /var/qmail/bin/qmail-inject
#编辑/etc/http/conf/httpd.conf
vi /etc/httpd/conf/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php index.html
NameVirtualHost *:80
ServerName mail.domain.com
DocumentRoot /var/www/html
chmod 777 /var/lib/php/session/ -R
#重启apache:
service httpd restart
#如果需要,用vadddomain和vadduser添加新域名和新用户。
最后打开浏览器,输入,就可以访问网站了
[MS1]写你想写的。