部分软件简介
1、AMP ---apache(web服务) 、mysql(数据库)、php(非必需) 的简称
2、postfix --mta 邮件系统核心
3、courier-authlib--一个为courier-imap,maildrop,sasl2 提供用户信息的后台进程序
4、courier-imap --提供pop3,pop3s,imap,imaps 服务的程序
5、amavisd-new --提供内容过滤
6、clamav -- 著名的杀毒软件
7、extmail --一个著名的webmail程序
8、extman --与extmail集成的后台管理程序
安装环境
centos 5.4
域名机器名:mail.linuxsee.com
域名:linuxsee.com
安装AMP
[root@localhost ~]# yum -y install httpd httpd-devel mysql mysql-devel mysql-server php php-xml php-cli php-pdo php-mbstring php-mcrypt php-gd php-common php-devel php-mysql
修改启动配置并启动
[root@localhost ~]# chkconfig –level 345 mysqld on
[root@localhost ~]# chkconfig –level 345 httpd on
[root@localhost ~]# service mysqld start
[root@localhost ~]# service httpd start
导入extman 后台数据库
[root@localhost ~]# tar zxf extman-0.2.5b1.tar.gz
[root@localhost ~]# cd extman-0.2.5b1/docs/
[root@localhost docs]# mysql -uroot -p <extmail.sql
Enter password:
[root@localhost docs]# mysql -uroot -p <init.sql
Enter password:
如何使用了phpmyadmin改了root 密码,记得输入密码,如果密码为空,请按回车。
安装authlib
安装依懒的包
[root@localhost ~]# yum -y install postgresql-devel expect libtool-ltdl-devel
安装生成的rpm
[root@localhost i386]# rpm -ivh courier-authlib-0.62.0-1.i386.rpm
[root@localhost i386]# rpm -ivh courier-authlib-devel-0.62.0-1.i386.rpm
[root@localhost i386]# rpm -ivh courier-authlib-mysql-0.62.0-1.i386.rpm
配置authlibdaemon
[root@localhost i386]# cd /etc/authlib/
[root@localhost authlib]# mv authdaemonrc authdaemonrc.bak
[root@localhost authlib]# vim authdaemonrc
输入下面的内容:
|
|
配置authmysqlrc
[root@localhost authlib]# mv authmysqlrc authmysqlrc.bak
[root@localhost authlib]# vim authmysqlrc
输入下面的内容:
|
|
启动authlib
[root@localhost ~]# service courier-authlib start
Starting Courier authentication services: authdaemond
[root@localhost ~]# chmod 777 /var/spool/authdaemon/
安装courier-imap
[root@localhost ~]# rpm -ivh courier-imap-4.1.2-1.i386.rpm
[root@localhost ~]# service courier-imap start
安装cyrus-sasl
安装SRPM
[root@localhost i386]# rpm -e –nodeps cyrus-sasl-devel cyrus-sasl-plain cyrus-sasl cyrus-sasl-lib (如果这些包存在)
[root@localhost i386]# rpm -ihv cyrus-sasl-lib-2.1.22-5.el5.i386.rpm
[root@localhost i386]# rpm -ihv cyrus-sasl-2.1.22-5.el5.i386.rpm
[root@localhost i386]# rpm -ihv cyrus-sasl-plain-2.1.22-5.el5.i386.rpm
配置sasl2
创建/usr/lib/sasl2/smtpd.conf 文件,输入下面的内容:
|
|
安装postfix
安装软件包
[root@localhost i386]# rpm -ivh postfix-2.5.4-2.rhel4.i386.rpm
切换mta
[root@localhost i386]# alternatives –config mta (选择2,postfix)
[root@localhost i386]# rpm -e sendmail
[root@localhost i386]# cd /usr/sbin/
[root@localhost sbin]# mv sendmail sendmail.bak
[root@localhost sbin]# newaliases
[root@localhost sbin]# ln -s sendmail.postfix sendmail
配置postfix
[root@localhost ~]# cd /etc/postfix/
[root@localhost postfix]# mv main.cf main.cf.bak
[root@localhost postfix]# vim main.cf
输入下面的内容:
|
|
复制extman/docs 目录的cf 文件到/etc/postfix
[root@localhost postfix]# cp /root/extman-0.2.5b1/docs/mysql_virtual_* .
并修改这些配置文件的用户名为root,密码为uusql#2010
[root@localhost postfix]# service postfix start
安装maildrop
创建安装maildrop rpm
[root@localhost SPECS]# yum -y install pcre-devel
[root@localhost i386]# rpm -ivh maildrop-2.0.4-1.i386.rpm
添加虚似用户及创建目录
[root@localhost i386]# cd
[root@localhost ~]# groupadd -g 1000 vgroup
[root@localhost ~]# useradd -g 1000 -u 1000 -s /sbin/nologin -d /dev/null vuser
编辑/etc/postfix/master.cf ,加入下面的内容:
|
|
创建邮件存储目录
[root@localhost ~]# mkdir -p /home/data/domains/extmail.org/postmaster
[root@localhost ~]# maildirmake /home/data/domains/extmail.org/postmaster/Maildir
[root@localhost ~]# chown -R vuser:vgroup /home/data/domains/
测试maildrop
[root@localhost ~]# echo “test” | maildrop -V 10 -d postmaster@extmail.org
maildrop: authlib: groupid=1000
maildrop: authlib: userid=1000
maildrop: authlib: logname=postmaster@extmail.org, home=/home/data/domains/extmail.org/postmaster, mail=/home/data/domains/extmail.org/postmaster/Maildir/
maildrop: Changing to /home/data/domains/extmail.org/postmaster
Message start at 0 bytes, envelope sender=postmaster@extmail.org
maildrop: Attempting .mailfilter
maildrop: Delivery complete.
出现上以信息说明authlib,maildrop 工作正常
测试pop3
[root@localhost ~]# telnet localhost 110
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
+OK Hello there.
user postmaster@extmail.org
+OK Password required.
pass extmail
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
1 6
.
retr 1
+OK 6 octets follow.
test
.
quit
+OK Bye-bye.
Connection closed by foreign host.
测试postfix
[root@localhost ~]# perl -MMIME::Base64 -e ‘print encode_base64(“postmaster\@extmail.org”);’
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
[root@localhost ~]# perl -MMIME::Base64 -e ‘print encode_base64(“extmail”);’
ZXh0bWFpbA==
[root@localhost ~]# service postfix restart (重启一下)
[root@localhost ~]# telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 linuxsee.com ESMTP Mail System
ehlo test.com
250-mail.uucun.lan
250-PIPELINING
250-SIZE 14680064
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
334 UGFzc3dvcmQ6
ZXh0bWFpbA==
235 2.7.0 Authentication successful
quit
221 2.0.0 Bye
Connection closed by foreign host
安装amavisd-new杀毒软件
编辑/etc/yum.repos.d/CentOS-Base.repo 加入下面的内容:
|
|
[root@localhost ~]# yum -y install clamav clamav-db clamd clamav-devel amavisd-new
编辑/etc/amavisd.conf,修改下面的内容
|
|
注意修改主机名与$mydomain相同
|
|
把下面内容去掉注释,并修改为下面
|
|
[root@localhost ~]# service amavisd start
[root@localhost ~]# usermod -G amavis clamav
[root@localhost ~]# freshclam (升级病毒库)
[root@localhost ~]# service clamd start
在/etc/postfix/master.cf 增加下面的内容:
|
|
在/etc/postfix/main.cf 加入下面的内容
|
|
[root@localhost ~]# service postfix reload
安装extman/extmail
配置apache
修改/etc/httpd/conf/httpd.conf,将下面的选项改为:
|
|
[root@localhost ~]# cd /etc/httpd/conf.d/
[root@localhost conf.d]# vim extmail.conf
输入下面的内容:
|
|
[root@localhost ~]# mkdir /var/www/extsuite
[root@localhost ~]# tar zxf extmail-1.0.5b1.tar.gz
[root@localhost ~]# cp -r extmail-1.0.5b1 /var/www/extsuite/extmail
[root@localhost ~]# cp -r extman-0.2.5b1 /var/www/extsuite/extman
配置extmail参数
[root@localhost ~]# cd /var/www/extsuite/extmail/
[root@localhost extmail]# cp webmail.cf.default webmail.cf
修改webmail.cf 下面的选项
|
|
C、配置extman参数
[root@localhost extmail]# cd /var/www/extsuite/extman/
修改webman.cf 下面的选项:
|
|
创建session 目录
[root@localhost extman]# mkdir /tmp/{extman,extmail}
[root@localhost extman]# chown vuser:vgroup /tmp/ext*
E、配置后台日志分析工具
[root@localhost addon]# cd /var/www/extsuite/extman/addon/
[root@localhost addon]# cp -r mailgraph_ext /usr/local/
将下面的内容加入/etc/rc.local
|
|
安装所依懒的软件包
[root@localhost mailgraph_ext]# yum -y install rrdtool perl-rrdtool perl-GD perl-File-Tail
启动后台进程
[root@localhost mailgraph_ext]# /usr/local/mailgraph_ext/qmonitor-init start
Starting queue statistics grapher: qmonitor
[root@localhost mailgraph_ext]# /usr/local/mailgraph_ext/mailgraph-init start
Starting mail statistics grapher: mailgraph_ext
访问extmail/extman
打开浏览器,输入http://your_ip_address/extmail 注意:your_ip_address 为你实际的ip
第一个测试用户为:postmaster 密码:extmail 域:extmail
打开浏览器,输入http://your_ip_address/extman
extman root 用户为:root@extmail.org 密码为:extmail123