EMOS部署详细步骤


第一步:安装EMOS操作系统

在安装操作系统时需要注意的是划分的分区,因为在默认的情况下extmail的邮箱,用户等信息是存放在/home/domains目录下,/home也是EMOS服务器上需要空间最大的目录,因为/home/domains跟随用户的增加而增加。Swap是交换分区。

Disk Druid分区界面


在系统安装完成并重新引导后,进入的是EMOS的默认配置界面。


在这个欢迎界面中用户可以配置,默认域、默认主机名、最大邮件大小、使用的数据库类型、webmail的登录密码和数据库的登录密码。其中需要默认选择的是:数据库类型(MYSQL)、spam类型(垃圾邮件类型)、导出dspam数据(过滤系统数据)和TLS支持(安全传输层协议)。需要用户修改的内容有:最大邮件大小(默认是10M)、webmail登录密码(默认是extmail)、mysql数据库密码(默认是extmail)、服务器类型(默认是企业模式)。备注:因为extmail没有默认域的概念所以默认域不是必须要修改的,服务器的工作类型有企业和ISP模式,他们的区别是ISP支持10万以上的用户,到后期会做集群服务的模式,且两种工作类型的目录结构不同。

确认EMOS配置后并自动安装配置


到此EMOS的整个系统已经安装完成,剩下需要操作的地方可以根据个人不同的需要而设置了。




第二步:修改核心配置文件

  主要修改的两个文件,一个存放在/var/www/extsuite/extmail/webmail.cf 

另一个在/var/www/extsuite/extman/webman.cf中,webmail.cf文件是extmail的配置文件,webman.cf是extman的配置文件。

Webmail.cf文件参数介绍: 

SYS_IP_SECURITY_ON = 1

# 首页登陆时ip安全,设置为1时不打开,便于管理员设置全局,而不需要改模板;

SYS_PERMIT_NOQUOTA = 0

# 设置为0时,系统将不限制邮箱容量,默认设置为1;

SYS_SPAM_REPORT_ON =  1

# 系统spam报告开关;1为开,0为关;

SYS_USER_LANG =  zh_CN

# 用户默认语言,中文可以设置为zh_CN;

SYS_USER_CHARSET = GBK

# 指定用户默认字符集,中文可以设置为gb2312;

SYS_USER_TIMEZONE = +0800

# 指定用户默认时区,默认为东八区:+0800;

SYS_MFILTER_ON =  1

# 过滤器开关;1为开,0为关;

SYS_NETDISK_ON =  0

# 网络磁盘开关;1为开,0为关;若设置了0,则即使在extman内打开用户网络磁盘功能

# 用户都不能使用该功能;

SYS_SHOW_SIGNUP =  0

# 首页"注册免费邮箱"的按钮显示开关;1为显示,0为关闭;


Webman.cf文件参数说明:

SYS_CAPTCHA_ON =  0

# 设置为1需要认证码登录extman,0不需认证码;

SYS_CAPTCHA_KEY =

# 认证码的key随便输入一个字符串就行;

SYS_CAPTCHA_LEN =  5

# 认证码的长度,默认为6;

SYS_PURGE_DATA =  0

# 该设置控制删除用户时默认是否完全删除用户数据,0为否,1为是;

SYS_DEFAULT_EXPIRE = 100y

# 默认过期时间,格式:?y ?m ?d;

SYS_DEFAULT_SERVICES =  smtps,smtp.webmail,imap.pop3

# 设置系统开放的功能,包括: smtpd, smtp, webmail, netdisk, imap, pop3

# (多参数以 "," 为分割符);

SYS_ISP_MODE =  yes

# 是否采用ISP模式,格式:yes|no - 如果yes,系统将采用 HashDir 模式来存放数据目录;

SYS_DEFAULT_MAXQUOTA = 5000M 

# 添加域时,默认最大限额大小,单位MB;

SYS_DEFAULT_MAXALIAS = 1000

# 添加域时,默认最大别名数;

SYS_DEFAULT_MAXUSERS =     1000

# 添加域时,默认最大用户数;

SYS_DEFAULT_MAXNDQUOTA =    0

# 添加域时,默认最大网络磁盘限额,单位MB;

SYS_USER_DEFAULT_QUOTA =    20

# 添加用户时,默认磁盘限额,单位MB;

SYS_USER_DEFAULT_NDQUOTA =   0

# 添加用户时,默认网络磁盘大小,单位MB;

SYS_USER_DEFAULT_EXPIRE =  100y

# 添加用户时,默认过期时间, 格式:?y ?m ?d;

备注:本处的文档只写出需要修改的地方,两个文件内容的详细信息在后文中有介绍。


第四步:登录webmail

使用root用户登录webmail,进入页面方式的管理界面,在这个界面中你可以添加域、别名、用户、管理员和查看系统图形日志。

  

备注:在网页中创建出的新域在/home/domains下产生文件,但是如果新创建的域内没有用户,则新域的文件夹不再/home/domains下产生。(新创建的用户初次使用时登录一次webmail可以防止以后的邮件丢失) 







第五步:导出导入mysql数据库文件

操作此项的目的是将旧服务器上的域和用户通过最快捷的方式存放在新的服务器上,extmail的数据主要分为两部分,第一部分是mysql的数据库文件通过sql命令可以导出,另一部分是/home/domains目录下的域目录,里面存放着整个域的所有信息。在导出时要两项全部导出,缺一不可。

大概的思路是:

1.备份/home/domains目录下的邮件域,通过tar压缩的方式打包。

命令是: # tar cvzf /root/extmail.tgz extmail.org

命令说明:tar是命令 cvzf是命令的可选参数 /root/extmail/tgz是目的地址 extmail.org是目标文件。

2.备份mysql数据库文件,使用sql命令进行数据库的备份。        命令是:#mysqldump -u root -p123456 extmail > /root/extmail.sql     命令说明:ysqldump是命令 -u root 是 user -p123456 是password extmail是数据库名称 > 是导出符号 /root/extmail.sql 是目的地址。

3.将刚刚备份的所有数据上传到要导入的服务器上。

4.导出域目录文件,通过tar命令解压。            命令是:# tar zxvf /root/extmail.tgz             命令说明:tar是命令 zxvf是命令的可选参数 /root/extmail/tgz是目标文件。

5.删除extmail数据库                                        命令是:mysql> drop database extmail            命令说明:drop是删除命令 database是数据库 extmail是数据库名。

6.重新创建新的extmail数据库            

命令是:create database extmail

命令说明:create是新建命令 database是数据库 extmail是要创建的数据库名。

8. 将旧服务器上的数据库文件导入到新建的数据库中

命令是:# mysql -u root -p123 extmail < /root/extmail.sql 

命令说明:mysql 导入命令 -u root -p123 是用户信息 extmail是库名 < 导入符号 /root/extmail.sql 是目标文件。


第六步:同步

待测试和实践,相同与异地存储的概念





第七歩:其他文档

Webmail.cf文件

# sys_config, the config file and webmail programe root

SYS_CONFIG = /var/www/extsuite/extmail/

# sys_langdir, the i18n dir

SYS_LANGDIR = /var/www/extsuite/extmail/lang

# sys_templdir, the template dir

SYS_TEMPLDIR = /var/www/extsuite/extmail/html

# sys_warn, show system warning or not, default to yes

SYS_SHOW_WARN = 0

# sys_permit_noquota, permit an account without qouta?

SYS_PERMIT_NOQUOTA = 1

# sys_sess_dir, the session dir

SYS_SESS_DIR = /tmp/

# sys_log_on = 1 | 0 - enable logging or not

SYS_LOG_ON = 1

# sys_log_type = file|syslog|nsyslog, syslog will save login

# or error info into mail.*, nsyslog is a replacement to syslog

# that will send log message to network syslogd

SYS_LOG_TYPE = syslog

# sys_log_file - path to log file, if sys_log_type = file

SYS_LOG_FILE = /var/log/extmail.log

# sys_captcha_on 1|0 - to enable captcha feature or not

SYS_CAPTCHA_ON = 1

# sys_captcha_key

SYS_CAPTCHA_KEY = 07b4f6

# sys_captcha_len

SYS_CAPTCHA_LEN = 6

# sys_sess_timeout, session timeout, default 3 hours (3h) format:

# number+(s|m|h|d|M|y); or only number, the 0 means that the

# session will last for 0 seconds, but if you specify the

# sys_sess_cookie_only = 1 then it means the session will expire

# after you close your browser 


SYS_SESS_TIMEOUT = 0

# sys_sess_cookie_only = 0|1 use cookie only or include cgi "sid"

# parameter ? if set to true(1), the session will be expired after

# sys_sess_timeout if there is no any active request from browser

SYS_SESS_COOKIE_ONLY = 1

# sys_user_psize, user default page_size

SYS_USER_PSIZE = 10

# sys_user_tsize, user mail subject truncate size, valid type:

# auto    => full text

# screen1 => 800x600

# screen2 => 1024x768

# screen3 => 1280x1024

SYS_USER_SCREEN = auto

# sys_user_lang, user default language

SYS_USER_LANG = zh_CN

# sys_app_type, the app type: WebMail or ExtMan? It must be the same

# as prefix part of language package name, eg: WebMail::en_US

SYS_APP_TYPE = WebMail

# sys_user_template, user default template

SYS_USER_TEMPLATE = default

# sys_user_charset, user default charset

SYS_USER_CHARSET = utf-8

# sys_user_trylocal, user default outgoing encoding mechanism

SYS_USER_TRYLOCAL = 1

# sys_user_timezone, user default timezone

SYS_USER_TIMEZONE = +0800

# sys_user_* default parameters

SYS_USER_CCSENT = 1

SYS_USER_SHOW_HTML = 1

SYS_USER_COMPOSE_HTML = 1

SYS_USER_CONV_LINK =1

SYS_USER_ADDR2ABOOK = 1

# sys_message_size_limit, default message size limit per user

# count as byte(s), eg: 5242880 means 5MB

SYS_MESSAGE_SIZE_LIMIT = 1073741824

# sys_min_pass_len, minimal password length, default 2

SYS_MIN_PASS_LEN = 2

# sys_mfilter_on, default is off

SYS_MFILTER_ON = 1

# sys_netdisk_on, default is off

SYS_NETDISK_ON = 1

# sys_debug_on, default is off

SYS_DEBUG_ON = 1

# sys_show_signup, default is on, this feature need extman

# 0.2.2 or higher version, built with signup serivce

SYS_SHOW_SIGNUP = 1

# sys auth type, mysql/ldap/authlib

SYS_AUTH_TYPE = mysql

# maildir_base, the base dir of user maildir, use absolute path

# if not set.

SYS_MAILDIR_BASE = /home/domains

# sys_auth_schema, vpopmail1/vpopmail2/virtual

# vpopmail1 => all user accounts in one table

# vpopmail2 => accounts in per domain table

SYS_AUTH_SCHEMA = virtual

# crypt_type, the default encrypt type of password, possible type

# currently is crypt|cleartext|plain|md5|md5crypt|plain-md5|ldap-md5|sha|sha1

SYS_CRYPT_TYPE = md5crypt

# if mysql, all relate parameters should prefix as SYS_MYSQL

SYS_MYSQL_USER = extmail

SYS_MYSQL_PASS = extmail

SYS_MYSQL_DB = extmail

SYS_MYSQL_HOST = localhost

SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock

# table name

SYS_MYSQL_TABLE = mailbox

SYS_MYSQL_ATTR_USERNAME = username

SYS_MYSQL_ATTR_DOMAIN = domain

SYS_MYSQL_ATTR_PASSWD = password

# sys_mysql_attr_clearpw - attribute to save clear password, useful for

# postmaster withdraw the original passwd if the end user forgot, but

# we highly recommend that you don't enable it for security reason

# SYS_MYSQL_ATTR_CLEARPW = clearpwd

SYS_MYSQL_ATTR_QUOTA = quota

SYS_MYSQL_ATTR_NDQUOTA = netdiskquota

SYS_MYSQL_ATTR_HOME = homedir

SYS_MYSQL_ATTR_MAILDIR = maildir

# service enable/disable attributes

# comment them out if you don't want their function

SYS_MYSQL_ATTR_DISABLEWEBMAIL = disablewebmail

SYS_MYSQL_ATTR_DISABLENETDISK = disablenetdisk

SYS_MYSQL_ATTR_DISABLEPWDCHANGE = disablepwdchange

SYS_MYSQL_ATTR_ACTIVE = active

# if ldap, all relate parameters should prefix as SYS_LDAP

SYS_LDAP_BASE = o=extmailAccount,dc=extmail.org

SYS_LDAP_RDN = cn=Manager,dc=extmail.org

SYS_LDAP_PASS = secret

SYS_LDAP_HOST = localhost

# ldif attributes

SYS_LDAP_ATTR_USERNAME = mail

SYS_LDAP_ATTR_DOMAIN = virtualDomain

SYS_LDAP_ATTR_PASSWD = userPassword

# sys_ldap_attr_clearpw - attribute to save clear password, useful for

# postmaster withdraw the original passwd if the end user forgot, but

# we highly recommend that you don't enable it for security reason

# SYS_LDAP_ATTR_CLEARPW = clearPassword

SYS_LDAP_ATTR_QUOTA = mailQuota

SYS_LDAP_ATTR_NDQUOTA = netdiskQuota

SYS_LDAP_ATTR_HOME = homeDirectory

SYS_LDAP_ATTR_MAILDIR = mailMessageStore

# service enable/disable attributes

# comment them out if you don't want their function

SYS_LDAP_ATTR_DISABLEWEBMAIL = disablewebmail

SYS_LDAP_ATTR_DISABLENETDISK = disablenetdisk

SYS_LDAP_ATTR_DISABLEPWDCHANGE = disablePasswdChange

SYS_LDAP_ATTR_ACTIVE = active

# if authlib, all relate parameters should prefix as AUTHLIB

SYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socket

# Global Abook support

# sys_g_abook_type, global abook type, valid is ldap|file, currently

# only support ldap, file module is under development :-)

SYS_G_ABOOK_TYPE = file

# if ldap, all relate parameters should prefix as SYS_G_ABOOK_LDAP

SYS_G_ABOOK_LDAP_HOST = localhost

SYS_G_ABOOK_LDAP_BASE = ou=AddressBook,dc=extmail.org

SYS_G_ABOOK_LDAP_ROOTDN = cn=Manager,dc=extmail.org

SYS_G_ABOOK_LDAP_ROOTPW = secret

SYS_G_ABOOK_LDAP_FILTER = objectClass=OfficePerson

# if file, all relate parameters should prefix as SYS_G_ABOOK_FILE

SYS_G_ABOOK_FILE_PATH = /var/www/extsuite/extmail/globabook.cf

SYS_G_ABOOK_FILE_LOCK = 1

SYS_G_ABOOK_FILE_CONVERT = 0

SYS_G_ABOOK_FILE_CHARSET = UTF-8


Webman.cf文件

# sys_config, the config file and webman programe root

SYS_CONFIG = /var/www/extsuite/extman/

# sys_langdir, the i18n dir

SYS_LANGDIR = /var/www/extsuite/extman/lang

# sys_templdir, the template dir

SYS_TEMPLDIR = /var/www/extsuite/extman/html

# maildir_base, the base dir of user maildir, use absolute path

# if not set.

SYS_MAILDIR_BASE = /home/domains

# sys_warn, show system warning or not, default to yes

SYS_SHOW_WARN = 0

# sys_sess_dir, the session dir

SYS_SESS_DIR = /var/www/extsuite/extman/tmp

# sys_captcha_on 1|0 - to enable captcha feature or not

SYS_CAPTCHA_ON = 0

# sys_captcha_key

SYS_CAPTCHA_KEY = 07b4f6

# sys_captcha_len

SYS_CAPTCHA_LEN = 6

# sys_sess_timeout, session timeout in seccond, default 6 hours

# SYS_SESS_TIMEOUT = 21600

# sys_user_psize, user default page_size

SYS_PSIZE = 10

# sys_user_lang, user default language

# SYS_LANG = en_US

# sys_purge_data - to completely destroy user mailbox or not?

SYS_PURGE_DATA = 0

# sys_app_type, the app type: WebMail or ExtMan? It must be the same

# as prefix part of language package name, eg: WebMail::en_US

SYS_APP_TYPE = ExtMan

# sys_template_name, the template name

SYS_TEMPLATE_NAME = default

# web management related restritions

# sys_default_expire, valid value: ?y ?m ?d

SYS_DEFAULT_EXPIRE = 1y

# sys_groupmail_sender - sender for groupmail, this account must

# exist or postfix or other mta will complain error

SYS_GROUPMAIL_SENDER = postmaster@babycare.com.cn# sys_default_services, valid value: smtpd, smtp, webmail, netdisk,

# imap and pop3, concatenate with "," as multiple values, eg: webmail,smtpauth

SYS_DEFAULT_SERVICES = webmail,smtpd,smtp,pop3,netdisk

# sys_isp_mode, yes|no - if yes, use our HashDir to spread

# storage to multiple directories

SYS_ISP_MODE = yes

# sys_domain_hashdir = yes|no, if yes we will enable domain hashdir

# depend on sys_isp_mode = yes

SYS_DOMAIN_HASHDIR = yes

# sys_domain_hashdir_depth, the hash length and depth, format:

# length x depth, eg: 2x1 => length =2, depth =1

# depend on sys_isp_mode = yes

SYS_DOMAIN_HASHDIR_DEPTH = 2x2

# sys_user_hashdir = yes|no, if yes we will enable user hashdir

# depend on sys_isp_mode = yes

SYS_USER_HASHDIR = yes

# sys_user_hashdir_depth, similar to sys_hashdir_domain_depth

SYS_USER_HASHDIR_DEPTH = 2x2

# XXX FIXME

# experimental feature, per domain tranport/routing capability

# same config style as SYS_USER_ROUTING_LIST

# SYS_DOMAIN_ROUTING_LIST = lmtp:mx1.extmail.org,lmtp:mx2.extmail.org

# XXX FIXME

# experimental feature, per user routing capability

# please specify routing info, concatenate with "," as multiple list

# members, eg: smtp:mx1.abc.com,smtp:mx2.abc.com

# SYS_USER_ROUTING_LIST = smtp:[192.168.2.130],smtp:[192.168.2.128]

# sys_min_uid, the minimal uid

SYS_MIN_UID = 500

# sys_min_gid, the minimal gid

SYS_MIN_GID = 100

# sys_default_uid, if not set, webman will ignore it

SYS_DEFAULT_UID = 1000

# sys_default_gid, if not set, webman will ignore it

SYS_DEFAULT_GID = 1000

# sys_quota_multiplier, in bytes, default to 1 MB

SYS_QUOTA_MULTIPLIER = 1048576

# sys_quota_type, valid type: vda|courier

SYS_QUOTA_TYPE = courier

# maxquota, alias, users and netdisk quota for domain

SYS_DEFAULT_MAXQUOTA = 500

SYS_DEFAULT_MAXALIAS = 100

SYS_DEFAULT_MAXUSERS = 100

SYS_DEFAULT_MAXNDQUOTA = 500

# per user default quota, netdisk quota and expire

SYS_USER_DEFAULT_QUOTA = 5

SYS_USER_DEFAULT_NDQUOTA = 5

SYS_USER_DEFAULT_EXPIRE = 5m

# sys_backend_type mysql|ldap

SYS_BACKEND_TYPE = mysql

# sys_crypt_type: crypt|cleartext|plain|md5|md5crypt|plain-md5|ldap-md5|sha|sha1

SYS_CRYPT_TYPE = md5crypt

# if mysql, all relate paramters should prefix as SYS_MYSQL

SYS_MYSQL_USER = webman

SYS_MYSQL_PASS = webman

SYS_MYSQL_DB = extmail

SYS_MYSQL_HOST = localhost

SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock

# table name

SYS_MYSQL_TABLE = manager

SYS_MYSQL_ATTR_USERNAME = username

SYS_MYSQL_ATTR_PASSWD = password

# comment it if you only want to save crypted password

# we highly recommend that you disable the following line 


# SYS_MYSQL_ATTR_CLEARPW = clearpwd

# if ldap, all relate paramters should prefix as SYS_LDAP

SYS_LDAP_BASE = dc=extmail.org

SYS_LDAP_RDN = cn=Manager,dc=extmail.org

SYS_LDAP_PASS = secret

SYS_LDAP_HOST = localhost

# ldif attributes

SYS_LDAP_ATTR_USERNAME = mail

SYS_LDAP_ATTR_PASSWD = userPassword

# comment it if you only want to save crypted password

# we highly recommend that you disable the following line 


# SYS_LDAP_ATTR_CLEARPW = clearPassword

# sys_rrd_datadir, the full path of rrd data

SYS_RRD_DATADIR = /var/lib

# sys_rrd_tmpdir, the temp dir for graph

SYS_RRD_TMPDIR = /tmp/viewlog

# sys_rrd_queue_on, yes|no, show queue or not

SYS_RRD_QUEUE_ON = yes