系统环境:rhel6 x86_64 selinux and iptables disabled
主机:192.168.0.178 server78.example.com mail.extmail.org
1. 配置mysql
yum install -y mysql mysql--server
server mysqld start
mkdir /var/www/extsuite
tar zxf extmail-1.2.tar.gz -C /var/www/extsuite
tar zxf extman-1.1.tar.gz -C /var/www/extsuite
cd /var/www/extsuite
mv extmail-1.2 extmail
mv extman-1.1 extman
cd extman/docs
mysql < extmail.sql (导入extmail自带数据库) 导入前可以到文件中修改默认密码
mysql < init.sql (导入extmail的测试账户)
2. 配置postfix
cp mysql_virtual_alias_maps.cf mysql_virtual_domains_maps.cf
mysql_virtual_mailbox_maps.cf /etc/postfix
useradd -u 600 vmail
postconf -e inet_interfaces=all
postconf -e virtual_mailbox_base=/home/vmail
postconf -e virtual_uid_maps=static:600
postconf -e virtual_gid_maps=static:600
postconf -e virtual_alias_maps=mysql:/etc/postfix/mysql_virtual_alias_maps.cf
postconf -e virtual_mailbox_domains=mysql:/etc/postfix/
mysql_virtual_domains_maps.cf
postconf -e virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
server postfix restart
echo “hello world” | mail -s test support@extmail.org (测试发信)
如果成功将会在/home/vmail下自动建立postmaster的收件箱。
3. 配置MUA收信服务
yum install -y dovecot dovecot-mysql
cd /etc/dovecot/conf.d
vi 10-mail.conf
mail_location = maildir:/home/vmail/%d/%n/Maildir
first_valid_uid = 600
vi 10-auth.conf
!include auth-sql.conf.ext (去掉注释)
cp /usr/share/doc/dovecot-2.0/example-config/dovecot-sql.conf.ext /etc/dovecot/
cd ..
vi dovecot-sql.conf.ext
driver = mysql
connect = host=localhost dbname=extmail user=extmail password=extmail
default_pass_scheme = PLAIN
password_query = SELECT username, domain, password FROM mailbox WHERE
username = '%u'
user_query = SELECT maildir, 800 AS uid, 800 AS gid FROM mailbox WHERE
username = '%u'
service dovecot start
# telnet localhost 110(测试收信)
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
<16c1.3.4fe5692a.8RE75w2wbTUnY4cIq0gM5w==@server78.example.com>
user postmaster@extmail.org #带上@后面的域名时,pass 提示认证失败
+OK
pass extmail
+OK Logged in.
4. 配置WEB收信服务
vi /etc/httpd/conf/httpd.conf(使用虚拟主机发布EXTMAIL)
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName server78.example.com
</VirtualHost>
<VirtualHost *:80>
ServerName mail.extmail.org (此域名需要解析到当前的邮件服务器)
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
SuexecUserGroup vmail vmail
</VirtualHost>
cd /var/www/extsuite/extmail
chown -R vmail.vmail cgi
chown -R vmail.vmail ../extman/cgi
cp webmail.cf.default webmail.cf
vi webmail.cf
SYS_MAILDIR_BASE = /home/vmail
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
cd ../extman
cp webman.cf.default webman.cf
vi webman.cf
SYS_MAILDIR_BASE = /home/vmail
SYS_SESS_DIR = /tmp/
SYS_CAPTCHA_LEN = 4
service httpd start
出现“Can't locate CGI.pm in @INC”错误, 解决方法如下:
yum install perl-CGI
在访问extman后台管理界面,出现无法显示验证码错误, 解决方法如下:
yum install -y perl-GD
管理界面“system页的信息无法显示”,解决方法如下:
/var/www/extsuite/extman/daemon/cmdserver -d
如果登录extman 后台System 信息显示不全,则执行 /var/www/extsuite/extmandaemon/cmdserver -d ,或将此命令写到/etc/rc.d/rc.local 中。
将extmail 邮件的日志信息写到/var/log/maillog 中
在extmail目录下的webman.cf配置文件
SYS_LOG_ON = 1
SYS_LOG_TYPE = syslog
然后刷新浏览器,则需要Unix-Syslog 这个包,下载并安装 Unix-Syslog-1.1.tar.gz
所有的模块软件可以到 www.cpan.org 网站下载
tar zxf Unix-Syslog-1.1.tar.gz
cd Unix-Syslog
进去看文档 less README
perl Makefile.PL 安装3步骤
make test
make install
perl Makefile.PL 提示需要 ExtUtils/MakeMaker包,
yum install perl-ExtUtils-MakeMaker -y #perl-ExtUtils-MakeMaker是ExtUtils/MakeMaker这个包的安装方法,用perl语言编写的。
make test
make install
然后再重新登录,tail /var/log/maillog 显示下面登录信息
Aug 30 01:44:39 desktop88 extmail[3053]: user=<postmaster@extmail.org>, client=192.168.0.82, module=login, status=loginok
下面安装图形显示
登录extman 点击Graph Log ,图形无法显示,提示需要RRD
yum install perl-rrdtool -y
cd /var/www/extsuite/extman/addon/
cp -r mailgraph_ext/ /usr/local/ 可以到mailgraph_ext 目录查看mailgraph-init 文件,它的BASEDIR 是/usr/local/mailgraph_ext,所以需要拷贝
cd /usr/local/mailgraph_ext/
./mailgraph-init start 提示需要File-Tail,下载并安装,File-Tail-0.99.3.tar.gz
tar zxf File-Tail-0.99.3.tar.gz
cd File-Tail
less README
perl Makefile.PL 安装4步骤
make
make test
make install
perl Makefile.PL 提示需要Time::HiRes 包,这个包也是用perl写的
yum install perl-Time-HiRes -y
perl Makefile.PL
make
make test
make install
cd /usr/local/mailgraph_ext/
./mailgraph-init start
ps aux 可以看到运行进程
刷新浏览器可以看到图形