今天成功配置EMOS服务器,这是网上教程……
前言:
1、EMOS是一个基于CentOS,集成了ExtMail Server全部组件的小型Linux系统,10分钟即可完成安装及配置,成为完备的企业邮局系统。它的诞生将彻底改变
邮件系统复杂的安装和配置局面,使只具备基本linux知识的用户就可轻松架设邮局。
2、EMOS 1.6 基于RHEL 6定制的操作系统,支持ext4文件系统格式,对于SSD磁盘的优化,安装系统支持远端存储,更智能的Tickless Kernel控制CPU节省耗电,tuned、diskdevstat、netdevstat 让你更加了解系统状态,更多网络硬件支持包括wireless,更强大的核心,更强大GCC编译功能,Samba支持windows 7和windows 2008 (R2) 当然完成支持IPv6,虚拟化支持 virt-v2v 让你轻松由ESX、KVM 转换到安装有Xen服务器上。更强大的LMAP 看看Apache 、MySQL 、PHP版本你就能感受到。
emos系统下载 ==============================>>> ftp://www6.extmail.org/emos/
一、EMOS安装
1、开始安装界面
15、安装完成之后,登陆效果![EMOS <wbr>配置及优化 EMOS 配置及优化_windows_15](http://s10.sinaimg.cn/mw690/66a1a5d5gd5d5bf34b1f9&690)
二、系统加固及
1、更新系统
[root@localhost ~]# yum update -y
2、升级EXTMAIL 1.2
2.1、备份原有版本
[root@localhost ~]# mv /var/www/extsuite/extmail /var/www/extsuite/extmail-v1.0.1.bak
2.2、安装新版本
[root@localhost ~]# tar -zxvf extmail-1.2.tar.gz
[root@localhost ~]# mv extmail-1.2 /var/www/extsuite/extmail
[root@localhost ~]# cp -a /var/www/extsuite/extmail/webmail.cf.default /var/www/extsuite/extmail/webmail.cf
2.3、修改数据库连接配置
[root@localhost ~]# vi /var/www/extsuite/extmail/webmail.cf
--------------------------------------------------------------------------------------------------
139 SYS_MYSQL_USER = extmail#修改成现有mysql数据库的用户名
140 SYS_MYSQL_PASS = 123456#修改成现有mysql数据库的密码
--------------------------------------------------------------------------------------------------
2.4、更改用户及组
[root@localhost ~]# chown -R vuser:vgroup /var/www/extsuite/extmail/cgi/
3、简单web登陆修改
[root@localhost ~]# vi /var/www/extsuite/extman/webman.cf
--------------------------------------------------------------------------------------------------
20 # sys_captcha_on 1|0 - to enable captcha feature or not
21 #SYS_CAPTCHA_ON = 1#注释登陆校验码
23 # sys_captcha_key
26 # sys_captcha_len
27 #SYS_CAPTCHA_LEN = 6#注释登陆校验码
38 # sys_user_lang, user default language
39 SYS_LANG = zh_CN#修改登陆后台默认的语言
--------------------------------------------------------------------------------------------------
4、修改附件大小
[root@localhost ~]# vi /etc/postfix/main.cf
--------------------------------------------------------------------------------------------------
75 message_size_limit = 104857600 #100M
76 mailbox_size_limit = 104857600 #100M
--------------------------------------------------------------------------------------------------
[root@localhost ~]# vi /var/www/extsuite/extmail/webmail.cf
------------------------------------------------------------------------------------------------101 SYS_MESSAGE_SIZE_LIMIT = 104857600#100M
--------------------------------------------------------------------------------------------------
三、HTTPS配置
1、安装配置
[root@localhost ~]# yum install mod_ssl -y
2、生成证书
[root@localhost ~]# openssl genrsa -out ca.key 1024
[root@localhost ~]# openssl req -new -key ca.key -out ca.csr
[root@localhost ~]# openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
3、移动证书
[root@localhost ~]# mv ca.crt /etc/pki/tls/certs
[root@localhost ~]# mv ca.key /etc/pki/tls/private/ca.key
[root@localhost ~]# mv ca.csr /etc/pki/tls/private/ca.csr
4、配置ssl.conf
[root@localhost ~]# cp -a /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak
[root@localhost ~]# vi /etc/httpd/conf.d/ssl.conf
--------------------------------------------------------------------------------------------------
86 DocumentRoot "/var/www/extsuite/extmail/html/" #修改默认目录
87 ServerNameserver.mail.com:443 #修改主机名
112 #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
113 SSLCertificateFile /etc/pki/tls/certs/ca.crt #修改成相应的CRT位置
119 #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
120 SSLCertificateKeyFile /etc/pki/tls/private/ca.key #修改成相应KEY位置
230 ScriptAlias /extmail/cgi "/var/www/extsuite/extmail/cgi" #修改成相应位置
231 Alias /extmail "/var/www/extsuite/extmail/html/ #修改成相应位置
232 ScriptAlias /extman/cgi "/var/www/extsuite/extman/cgi/" #修改成相应位置
233 Alias /extman "/var/www/extsuite/extman/html/" #修改成相应位置
234 Alias /monitor "/var/www/extsuite/monitor/" #修改成相应位置
235 <Directory "/var/www/extsuite/monitor/"> #235行到243行:WEB登陆访问控制,可以不要
236 AllowOverride AuthConfig
237 Order allow,deny
238 Allow from all
239 AuthType basic
240 AuthName "Mail Server !!"
241 AuthUserFile "/usr/share/dspam/webui/cgi-bin/.htpasswd"
242 require valid-user
243 </Directory> #235行到243行:WEB登陆访问控制,可以不要
244 Alias /phpmyadmin "/var/www/extsuite/phpmyadmin/"#可以不要、不安全
245 Alias /phpldapadmin "/var/www/extsuite/phpldapadmin/htdocs/"#可以不要、不安全
246 SuexecUserGroup vuser vgroup #增加指定执行程序的用户和组
--------------------------------------------------------------------------------------------------
5、配置跳转
[root@localhost ~]# cp -a /etc/httpd/conf/vhost_extmail.conf /etc/httpd/conf/vhost_extmail.conf.bak
[root@localhost ~]# vi /etc/httpd/conf/vhost_extmail.conf
--------------------------------------------------------------------------------------------------
26 #Suexec config #增加27到30行,就是利用REWIRTE模块
27 RewriteEngine on
28 RewriteCond %{SERVER_PORT} !^443$
29 RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]
30 SuexecUserGroup vuser vgroup #增加27到30行,就是利用REWIRTE模块
31 </VirtualHost>
--------------------------------------------------------------------------------------------------
[root@localhost ~]# service httpd restart
四、EMOS安全
1、黑名单
[root@localhost ~]# vi /usr/local/slockd/config/plugin.cf
--------------------------------------------------------------------------------------------------
64 spf_plugin = no#取消SLOCKD的SPF功能
72 dnsbl_plugin = no #关闭DNS查找
78 dnsbl_server_list =
79 zen.spamhaus.org,
80 # bl.spamcop.net,
81 cblplus.anti-spam.org.cn,
82 # dnsbl.sorbs.net,
83 # b.barracudacentral.org,
84 # dul.dnsbl.sorbs.net,
85 # hostkarma.junkemailfilter.com,
88 greylist_plugin = no #关闭黑名单
-------------------------------------------------------------------------------------------------
2、发送白名单
[root@localhost ~]# cp -a /usr/local/slockd/config/sender_whitelist /usr/local/slockd/config/sender_whitelist.bak
[root@localhost ~]# vi /usr/local/slockd/config/sender_whitelist
--------------------------------------------------------------------------------------------------
12 @qq.com#添加发送白名单、立即生效
--------------------------------------------------------------------------------------------------
3、白名单
[root@localhost ~]# cp -a /usr/local/slockd/config/whitelist /usr/local/slockd/config/whitelist.bak
[root@localhost ~]# vi /usr/local/slockd/config/whitelist
--------------------------------------------------------------------------------------------------
166 qq.com#添加白名单
--------------------------------------------------------------------------------------------------
五、反垃圾系统配置
1、AMAVISD查看
[root@localhost ~]# cp -a /usr/local/slockd/config/plugin.cf /usr/local/slockd/config/plugin.cf.bak
[root@localhost ~]# vi /etc/amavisd.conf
--------------------------------------------------------------------------------------------------
4 $max_servers = 10; #设置最大可使用的进程数
33 $remove_existing_x_scanned_headers= 1; #凡是经过Amavisd过滤的邮件,都会在邮件头中被加入一行邮件头信息
38 $policy_bank{'MYNETS'} = { #38-45行对本地发出的邮件不进行内容过滤
39 originating => 1,
40 os_fingerprint_method => undef,
41 allow_disclaimers => 1,
42 bypass_spam_checks_maps => [1],
43 bypass_banned_checks_maps => [1],
44 bypass_header_checks_maps => [1],
45 }; #38-45行对本地发出的邮件不进行内容过滤
70 $sa_tag2_level_deflt = 5.0; #超过这个分数,允许在邮件标题加入[SPAM]标记
71 $sa_kill_level_deflt = 5.0; #超过这个分数,直接將信件备份后删除
99 $sa_spam_subject_tag = '[SPAM] '; #加[SPAM]标记
100 $sa_spam_modifies_subj = 0; #当邮件被认为是垃圾邮件时,是否修改邮件的主题
111 $final_virus_destiny = D_PASS; #检测到病毒时的动作
112 $final_banned_destiny = D_PASS; #检测到受禁止的内容时的动作
113 $final_spam_destiny = D_PASS; #检测到垃圾邮件、广告邮件(spam)时的动作
114 $final_bad_header_destiny = D_PASS; #检测到不良信件时的动作
#默认有以下几种动作:
#D_PASS: 无论信件是否有问题,都会将信件发给收件人
#D_DISCARD: 信件将被丢弃,并且不会告知收件人及发件人
#D_BOUNCE: 信件不会发送给收件人,但会通知发件人邮件没有被投递
#D_REJECT: 邮件不会被投递给收件人,但会通知发件人邮件被拒绝
--------------------------------------------------------------------------------------------------
[root@localhost ~]# service clamd restart
备:EMOS1.6是最后一个不收费的版本;之后陆续将商业化版本。不管怎么样都应该感谢这群前辈!如遇到不能解决的问题:请查看官网说明文档 http://wiki.extmail.org/doku.php
前言:
1、EMOS是一个基于CentOS,集成了ExtMail Server全部组件的小型Linux系统,10分钟即可完成安装及配置,成为完备的企业邮局系统。它的诞生将彻底改变
邮件系统复杂的安装和配置局面,使只具备基本linux知识的用户就可轻松架设邮局。
2、EMOS 1.6 基于RHEL 6定制的操作系统,支持ext4文件系统格式,对于SSD磁盘的优化,安装系统支持远端存储,更智能的Tickless Kernel控制CPU节省耗电,tuned、diskdevstat、netdevstat 让你更加了解系统状态,更多网络硬件支持包括wireless,更强大的核心,更强大GCC编译功能,Samba支持windows 7和windows 2008 (R2) 当然完成支持IPv6,虚拟化支持 virt-v2v 让你轻松由ESX、KVM 转换到安装有Xen服务器上。更强大的LMAP 看看Apache 、MySQL 、PHP版本你就能感受到。
emos系统下载 ==============================>>> ftp://www6.extmail.org/emos/
一、EMOS安装
1、开始安装界面
15、安装完成之后,登陆效果![EMOS <wbr>配置及优化 EMOS 配置及优化_linux_30](http://s10.sinaimg.cn/mw690/66a1a5d5gd5d5bf34b1f9&690)
二、系统加固及
1、更新系统
[root@localhost ~]# yum update -y
2、升级EXTMAIL 1.2
2.1、备份原有版本
[root@localhost ~]# mv /var/www/extsuite/extmail /var/www/extsuite/extmail-v1.0.1.bak
2.2、安装新版本
[root@localhost ~]# tar -zxvf extmail-1.2.tar.gz
[root@localhost ~]# mv extmail-1.2 /var/www/extsuite/extmail
[root@localhost ~]# cp -a /var/www/extsuite/extmail/webmail.cf.default /var/www/extsuite/extmail/webmail.cf
2.3、修改数据库连接配置
[root@localhost ~]# vi /var/www/extsuite/extmail/webmail.cf
--------------------------------------------------------------------------------------------------
139 SYS_MYSQL_USER = extmail#修改成现有mysql数据库的用户名
140 SYS_MYSQL_PASS = 123456#修改成现有mysql数据库的密码
--------------------------------------------------------------------------------------------------
2.4、更改用户及组
[root@localhost ~]# chown -R vuser:vgroup /var/www/extsuite/extmail/cgi/
3、简单web登陆修改
[root@localhost ~]# vi /var/www/extsuite/extman/webman.cf
--------------------------------------------------------------------------------------------------
20 # sys_captcha_on 1|0 - to enable captcha feature or not
21 #SYS_CAPTCHA_ON = 1#注释登陆校验码
23 # sys_captcha_key
26 # sys_captcha_len
27 #SYS_CAPTCHA_LEN = 6#注释登陆校验码
38 # sys_user_lang, user default language
39 SYS_LANG = zh_CN#修改登陆后台默认的语言
--------------------------------------------------------------------------------------------------
4、修改附件大小
[root@localhost ~]# vi /etc/postfix/main.cf
--------------------------------------------------------------------------------------------------
75 message_size_limit = 104857600 #100M
76 mailbox_size_limit = 104857600 #100M
--------------------------------------------------------------------------------------------------
[root@localhost ~]# vi /var/www/extsuite/extmail/webmail.cf
------------------------------------------------------------------------------------------------101 SYS_MESSAGE_SIZE_LIMIT = 104857600#100M
--------------------------------------------------------------------------------------------------
三、HTTPS配置
1、安装配置
[root@localhost ~]# yum install mod_ssl -y
2、生成证书
[root@localhost ~]# openssl genrsa -out ca.key 1024
[root@localhost ~]# openssl req -new -key ca.key -out ca.csr
[root@localhost ~]# openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
3、移动证书
[root@localhost ~]# mv ca.crt /etc/pki/tls/certs
[root@localhost ~]# mv ca.key /etc/pki/tls/private/ca.key
[root@localhost ~]# mv ca.csr /etc/pki/tls/private/ca.csr
4、配置ssl.conf
[root@localhost ~]# cp -a /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak
[root@localhost ~]# vi /etc/httpd/conf.d/ssl.conf
--------------------------------------------------------------------------------------------------
86 DocumentRoot "/var/www/extsuite/extmail/html/" #修改默认目录
87 ServerNameserver.mail.com:443 #修改主机名
112 #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
113 SSLCertificateFile /etc/pki/tls/certs/ca.crt #修改成相应的CRT位置
119 #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
120 SSLCertificateKeyFile /etc/pki/tls/private/ca.key #修改成相应KEY位置
230 ScriptAlias /extmail/cgi "/var/www/extsuite/extmail/cgi" #修改成相应位置
231 Alias /extmail "/var/www/extsuite/extmail/html/ #修改成相应位置
232 ScriptAlias /extman/cgi "/var/www/extsuite/extman/cgi/" #修改成相应位置
233 Alias /extman "/var/www/extsuite/extman/html/" #修改成相应位置
234 Alias /monitor "/var/www/extsuite/monitor/" #修改成相应位置
235 <Directory "/var/www/extsuite/monitor/"> #235行到243行:WEB登陆访问控制,可以不要
236 AllowOverride AuthConfig
237 Order allow,deny
238 Allow from all
239 AuthType basic
240 AuthName "Mail Server !!"
241 AuthUserFile "/usr/share/dspam/webui/cgi-bin/.htpasswd"
242 require valid-user
243 </Directory> #235行到243行:WEB登陆访问控制,可以不要
244 Alias /phpmyadmin "/var/www/extsuite/phpmyadmin/"#可以不要、不安全
245 Alias /phpldapadmin "/var/www/extsuite/phpldapadmin/htdocs/"#可以不要、不安全
246 SuexecUserGroup vuser vgroup #增加指定执行程序的用户和组
--------------------------------------------------------------------------------------------------
5、配置跳转
[root@localhost ~]# cp -a /etc/httpd/conf/vhost_extmail.conf /etc/httpd/conf/vhost_extmail.conf.bak
[root@localhost ~]# vi /etc/httpd/conf/vhost_extmail.conf
--------------------------------------------------------------------------------------------------
26 #Suexec config #增加27到30行,就是利用REWIRTE模块
27 RewriteEngine on
28 RewriteCond %{SERVER_PORT} !^443$
29 RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]
30 SuexecUserGroup vuser vgroup #增加27到30行,就是利用REWIRTE模块
31 </VirtualHost>
--------------------------------------------------------------------------------------------------
[root@localhost ~]# service httpd restart
四、EMOS安全
1、黑名单
[root@localhost ~]# vi /usr/local/slockd/config/plugin.cf
--------------------------------------------------------------------------------------------------
64 spf_plugin = no#取消SLOCKD的SPF功能
72 dnsbl_plugin = no #关闭DNS查找
78 dnsbl_server_list =
79 zen.spamhaus.org,
80 # bl.spamcop.net,
81 cblplus.anti-spam.org.cn,
82 # dnsbl.sorbs.net,
83 # b.barracudacentral.org,
84 # dul.dnsbl.sorbs.net,
85 # hostkarma.junkemailfilter.com,
88 greylist_plugin = no #关闭黑名单
-------------------------------------------------------------------------------------------------
2、发送白名单
[root@localhost ~]# cp -a /usr/local/slockd/config/sender_whitelist /usr/local/slockd/config/sender_whitelist.bak
[root@localhost ~]# vi /usr/local/slockd/config/sender_whitelist
--------------------------------------------------------------------------------------------------
12 @qq.com#添加发送白名单、立即生效
--------------------------------------------------------------------------------------------------
3、白名单
[root@localhost ~]# cp -a /usr/local/slockd/config/whitelist /usr/local/slockd/config/whitelist.bak
[root@localhost ~]# vi /usr/local/slockd/config/whitelist
--------------------------------------------------------------------------------------------------
166 qq.com#添加白名单
--------------------------------------------------------------------------------------------------
五、反垃圾系统配置
1、AMAVISD查看
[root@localhost ~]# cp -a /usr/local/slockd/config/plugin.cf /usr/local/slockd/config/plugin.cf.bak
[root@localhost ~]# vi /etc/amavisd.conf
--------------------------------------------------------------------------------------------------
4 $max_servers = 10; #设置最大可使用的进程数
33 $remove_existing_x_scanned_headers= 1; #凡是经过Amavisd过滤的邮件,都会在邮件头中被加入一行邮件头信息
38 $policy_bank{'MYNETS'} = { #38-45行对本地发出的邮件不进行内容过滤
39 originating => 1,
40 os_fingerprint_method => undef,
41 allow_disclaimers => 1,
42 bypass_spam_checks_maps => [1],
43 bypass_banned_checks_maps => [1],
44 bypass_header_checks_maps => [1],
45 }; #38-45行对本地发出的邮件不进行内容过滤
70 $sa_tag2_level_deflt = 5.0; #超过这个分数,允许在邮件标题加入[SPAM]标记
71 $sa_kill_level_deflt = 5.0; #超过这个分数,直接將信件备份后删除
99 $sa_spam_subject_tag = '[SPAM] '; #加[SPAM]标记
100 $sa_spam_modifies_subj = 0; #当邮件被认为是垃圾邮件时,是否修改邮件的主题
111 $final_virus_destiny = D_PASS; #检测到病毒时的动作
112 $final_banned_destiny = D_PASS; #检测到受禁止的内容时的动作
113 $final_spam_destiny = D_PASS; #检测到垃圾邮件、广告邮件(spam)时的动作
114 $final_bad_header_destiny = D_PASS; #检测到不良信件时的动作
#默认有以下几种动作:
#D_PASS: 无论信件是否有问题,都会将信件发给收件人
#D_DISCARD: 信件将被丢弃,并且不会告知收件人及发件人
#D_BOUNCE: 信件不会发送给收件人,但会通知发件人邮件没有被投递
#D_REJECT: 邮件不会被投递给收件人,但会通知发件人邮件被拒绝
--------------------------------------------------------------------------------------------------
[root@localhost ~]# service clamd restart
备:EMOS1.6是最后一个不收费的版本;之后陆续将商业化版本。不管怎么样都应该感谢这群前辈!如遇到不能解决的问题:请查看官网说明文档 http://wiki.extmail.org/doku.php