CentOS Linux安装配置Extmail Web邮件收发系统

  Extmail是一个以perl语言编写,面向大容量/ISP级应用,免费的高性能Webmail软件,主要包括ExtMail、Extman两个部分的程序套件。ExtMail套件用于提供从浏览器中登录、使用邮件系统的Web操作界面,而Extman套件用于提供从浏览器中管理邮件系统的Web操作界面。它以GPL版权释出,设计初衷是希望设计一个适应当前高速发展的IT应用环境,满足用户多变的需求,能快速进行开发、改进和升级,适应能力强的webmail系统。

下面是在CentOS Linux 32位系统安装配置Extmail Web邮件收发系统:

制作 yum 仓库

编译CentOS-Base.repo文件

# vi /etc/yum.repos.d/CentOS-Base.repo

加入如下内容:

# EMOS-Base.repo
#
# Created by ExtMail Dev Team:
#
# $Id$
[EMOS-base]
name=EMOS-Base
baseurl=http://mirror.extmail.org/yum/emos/1.5/os/$basearch/
gpgcheck=0
priority=0
protect=0
[EMOS-update]
name=EMOS-Updates
baseurl=http://mirror.extmail.org/yum/emos/1.5/updates/$basearch/
gpgcheck=0
priority=0
protect=0

保存后,然后尝试执行一下yum list 等操作,看看是否已经成功;

配置mta-postfix

1、安装postfix

# yum -y install postfix
# yum remove sendmail

2、配置postfix

# postconf -n > /etc/postfix/main2.cf
# mv /etc/postfix/main.cf /etc/postfix/main.cf.old
# mv /etc/postfix/main2.cf /etc/postfix/main.cf

编辑main.cf:

# vi /etc/postfix/main.cf

增加如下内容:

# hostname
mynetworks = 127.0.0.1
myhostname = mail.linuxde.net
mydestination = $mynetworks $myhostname
# banner
mail_name = Postfix - by extmail.org
smtpd_banner = $myhostname ESMTP $mail_name
# response immediately
smtpd_error_sleep_time = 0s
# Message and return coolcode control
message_size_limit = 5242880
mailbox_size_limit = 5242880
show_user_unknown_table_name = no
# Queue lifetime control
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d

注:myhostname改为自己的。

设置postfix开机自启:

# chkconfig postfix on配置courier-authlib

1、安装Courier-Authlib

安装以下软件包:

# yum -y install courier-authlib
# yum -y install courier-authlib-mysql

删除并编辑/etc/authlib/authmysqlrc文件:

# cat /dev/null >/etc/authlib/authmysqlrc
# vi /etc/authlib/authmysqlrc

增加如下内容:

MYSQL_SERVER localhost
MYSQL_USERNAME extmail
MYSQL_PASSWORD extmail
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_PORT 3306
MYSQL_OPT 0
MYSQL_DATABASE extmail
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD uidnumber
MYSQL_GID_FIELD gidnumber
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD homedir
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD quota
MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\
CONCAT('/home/domains/',homedir), \
CONCAT('/home/domains/',maildir), \
quota,\
name \
FROM mailbox \
WHERE username = '$(local_part)@$(domain)'

修改authdaemonrc文件

# vi /etc/authlib/authdaemonrc

修改如下内容:

authmodulelist="authmysql"
authmodulelistorig="authmysql"

或者使用如下命令直接修改:

# sed -i 's/authmodulelist=.*/authmodulelist="authmysql"/g'/etc/authlib/authdaemonrc
# sed -i 's/authmodulelistorig=.*/authmodulelistorig="authmysql"/g'/etc/authlib/authdaemonrc

2、启动courier-authlib:

# service courier-authlib start

修改authdaemon socket目录权限

# chmod 755 /var/spool/authdaemon/配置maildrop

1、安装maildrop

# yum -y install maildrop

配置master.cf 为了使Postfix支持Maildrop,必须修改/etc/postfix/master.cf文件,注释掉原来的maildrop的配置内容,并改为:

maildrop unix - n n - - pipe
flags=DRhu user=vuser argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}

注意:flags前面有"两个空格"

配置main.cf 由于maildrop不支持一次接收多个收件人,因此必须在main.cf里增加如下参数:

# vi /etc/postfix/main.cf
maildrop_destination_recipient_limit = 1

2、测试maildrop对authlib支持

# maildrop -v

看是否出现以下内容:

maildrop 2.1.0 Copyright 1998-2005 Double Precision, Inc.
GDBM/DB extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.配置apache

1、安装httpd

# yum -y install httpd

2、虚拟主机设置

编辑httpd.conf文件:

# vi /etc/httpd/conf/httpd.conf

在最后一行加上:

NameVirtualHost *:80
Include conf/vhost_*.conf

编辑 vhost_extmail.conf

# vi /etc/httpd/conf/vhost_extmail.conf

里面定义虚拟主机的相关内容:

# VirtualHost for ExtMail Solution
ServerName mail.linuxde.net
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/
# Suexec config
SuexecUserGroup vuser vgroup

注意:把ServerName修改成自己的。

设置apache开机启动并重启apache

# chkconfig httpd on
# service httpd restart配置webmail-extmail

1、安装ExtMail

# yum -y install extsuite-webmail

2、编辑webmail.cf

# cd /var/www/extsuite/extmail
# cp webmail.cf.default webmail.cf
# vi webmail.cf

主要变动的内容见下:

SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail

更新cgi目录权限 由于SuEXEC的需要,必须将extmail的cgi目录修改成vuser:vgroup权限:

# chown -R vuser:vgroup /var/www/extsuite/extmail/cgi/配置管理后台-extman

1、yum安装ExtMan

# yum -y install extsuite-webman

更新cgi目录权限 由于SuEXEC的需要,必须将extman的cgi目录修改成vuser:vgroup权限:

# chown -R vuser:vgroup /var/www/extsuite/extman/cgi/

链接基本库到Extmail

# mkdir /tmp/extman
# chown -R vuser:vgroup /tmp/extman

注意事项:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/10954.html