一、原理及其应用:
在使用postadmin来管理邮件虚拟域、虚拟用户,是更多的域名相互联系,合理的规划每一个域名的发信情况,让服务器达到最优化
本文只介绍Postfix是怎么安装部署的,是怎么管理虚拟域,是怎么建虚拟帐号的,在后台发送邮件的时候使用虚拟域名能提高知名度和投递成功率;
二、软件包及其安装环境
CentOS 5.8
postfixadmin-2.3.5.tar.gz
三、安装说明与解释(附:问题处理)
1.安装基本组件
2. 启动mysql数据库,并给mysql的root用户设置密码:
#service mysqld start
#chkconfig mysqld on
#mysqladmin -uroot password '123456'
#mysql -uroot -p
enter--> 123456
mysql>create database postfix;
mysql>grant all privileges on postfix.* to postfix#localhost identified by '123456'; (将#换为@)
mysql>flush privileges;
4. 安装postfixadmin-2.3.
#tar -zxvf postfixadmin-2.3.5.tar.gz
#mv postfixadmin-2.3.5 /var/www/postfixadmin
#cd /var/www/postfixadmin
#mv config.inc.php.sample config.inc.php
#vi config.inc.php
只修改关键参数:
$CONF['default_language'] =
'cn'; //
postfixadmin界面语言:"cn" 中文,"en"英文
$CONF['database_type'] =
'mysql'; //
数据库类型
$CONF['database_host'] = 'localhost';
// 数据库地址,如果在其它服务器,改为IP地址即可
$CONF['database_user'] =
'postfix'; //
postadmin连接数据库的用户
$CONF['database_password'] = '123456'; //
以上用户连接数据库的密码
$CONF['database_name'] =
'postfix'; //
postfixadmin存放到mysql中的那个库中
$CONF['database_prefix'] = '';
$CONF['admin_email'] = 'hanfeng#test.com'; //
postfixadmin有问题联系人邮箱、将#换成@
$CONF['smtp_server'] =
'localhost'; //
SMTP(MTA)部署在那台服务器上
$CONF['smtp_port'] =
'25';
// MTA 端口号
$CONF['encrypt'] =
'md5crypt';
// 通信加密方式
$CONF['generate_password'] =
'NO';
// 注意:此处一会要改setup安装生成的“加密密码”
// 剩余参数此处先不设置,以上即可满足基本需要
6.配置apache ,启动http服务器
#vi /etc/httpd/conf/httpd.conf
#ServerName mail.test.com:80 //
只需要将此行修改后启用即可(如有其他主机,按虚拟主机设置即可)
#service httpd restart
2.IE打开安装检查组件配置信息:
http://mail.test.com/postfixadmin/setup.php
// 如果次页面能显示,但是有显示红色错误之处,修改config.inc.php对应的参数即可
------------------------------------------------------------------------------
Postfix Admin Setup Checker 1.0.0
Running software:
- PHP version 5.1.6
- Apache/2.2.3 (CentOS)
Checking for dependencies:
- Magic Quotes: ON
- Depends on: presence config.inc.php - OK
- Depends on: MySQL 3.23, 4.0 - OK
- Depends on: MySQL 4.1 - OK (change the database_type in config.inc.php!!)
- Depends on: session - OK
- Depends on: pcre - OK
Everything seems fine... you are ready to rock & roll!
Make sure you delete this setup.php file!
//系统提示在点击 admin section后删除setup.php文件(备份一下哦)
Also check the config.inc.php file for any settings that you might need to change!
Click here to go to the admin section (make sure that your .htaccess is setup properly)
------------------------------------------------------------------------------
3. 删除 setup.php 文件,按F5刷新页面
#mv /var/www/postfixadmin/setup.php var/www/postfixadmin/setup.php.bak
4. 删除其他TXT文件(原文:To remove this text, delete the motd-admin.txt file.)
#mkdir /opt/postfixadmin-motd
#mv /var/www/postfixadmin/motd* /opt/postfixadmin-motd
5.进入postfixadmin界面,
以下图片仅供参考!
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
6.查看mysql数据库中信息
#mysql -uroot
-p
//密码123456
mysql> show databases;
+--------------------+
|
Database
|
+--------------------+
| information_schema |
|
mysql
|
|
postfix
|
|
test
|
+--------------------+
4 rows in set (0.01 sec)
mysql> use postfix;
mysql> show tables;
+-------------------+
| Tables_in_postfix |
+-------------------+
|
admin
|
|
alias
|
|
domain
|
| domain_admins |
|
log
|
|
mailbox
|
| vacation
|
+-------------------+
7 rows in set (0.00 sec)
// 导的DATABASE_MYSQL.TXT 文件就是创建以上表,可手动建;
+------------------+------------------------------------+---------------------+---------------------+--------+
| username | password | created | modified | active |
+------------------+------------------------------------+---------------------+---------------------+--------+
| admin@test.com | $1$91831983$ktf2QZiRkw61Qx/fr7bX.0 | 2011-09-19 07:47:31 | 2011-09-19 07:47:31 | 1 |
| hanfeng@test.com | $1$1fa52653$4/Q0vpftJwdwhsI96VoVq1 | 2011-09-19 07:47:49 | 2011-09-19 07:47:49 | 1 |
+------------------+------------------------------------+---------------------+---------------------+--------+
2 rows in set (0.01 sec)
---------------------------------------------------------------------------------------------------
附图:
---------------------------------------------------------------------------------------------------
说明:本文到此结束,以下无重点
1. 以上配置可以与dovecot等组件相结合,搭建成postfix+dovecot+postfixadmin+mysql
一台postfix邮件管理系统,并做好virtual_alias_maps认证;
2.以上文章仅为自己观点,如有其他问题,请邮件联系linuxhzg#qq.com (将#换成@)