视频教程 https://www.youtube.com/watch?v=i9-GwQ98l9U
Zimbra是一个开源的邮件服务程序。它包含很多实用的特性:内建日历支持、email过滤规则、一个现代化的用户接口、反垃圾和病毒扫描等等。
Zimbra不但提供服务器端组件,它也包括一个基于web的邮件客户端。
Zimbra有两个版本,一个免费开源版本和一个商业版本。商业版本提供客户支持服务和一些高级组件,其实免费版本完全可以满足基本的企业应用。
本帖记录了在CentOS 7上安装开源Zimbra邮件服务程序的基本步骤。
系统最低要求
- CPU:2GHz
- 内存:8G
- 硬盘:10G
设置DNS记录
在开始架设邮件服务器之前你首先要设置DNS记录。Zimbra会自动检测DNS,如果不能正常解析,Zimbra的安装过程会终止。
至少要添加MX和A记录,例如:
1
2
|
example.com. IN MX 10 mail.example.com.
mail.example.com. IN A your_server_ip_addr
|
配置SELinux和防火墙
- 为了简单,关闭SELinux
配置防火墙规则:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# iptables -F
# iptables -P INPUT DROP
# iptables -P OUTPUT ACCEPT
# iptables -A INPUT -i lo -j ACCEPT
# iptables -A INPUT -s IP-Address-of-your-server/32 -j ACCEPT
# iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -p tcp –dport 22 -j ACCEPT
# iptables -A INPUT -p icmp -j ACCEPT
## Zimbra rules for external access ##
# iptables -A INPUT -p tcp –dport 25 -j ACCEPT
# iptables -A INPUT -p tcp –dport 80 -j ACCEPT
# iptables -A INPUT -p tcp –dport 110 -j ACCEPT
# iptables -A INPUT -p tcp –dport 143 -j ACCEPT
# iptables -A INPUT -p tcp –dport 443 -j ACCEPT
# iptables -A INPUT -p tcp –dport 465 -j ACCEPT
# iptables -A INPUT -p tcp –dport 587 -j ACCEPT
# iptables -A INPUT -p tcp –dport 993 -j ACCEPT
# iptables -A INPUT -p tcp –dport 995 -j ACCEPT
# iptables -A INPUT -p tcp –dport 3443 -j ACCEPT
# iptables -A INPUT -p tcp –dport 9071 -j ACCEPT
# iptables -A INPUT -p tcp –dport 7071 -j ACCEPT
|
设置Hostname和NTP
以mail.example.com为例:
1
|
# hostnamectl set-hostname mail.example.com
|
执行下面命令查看hostname状态:
1
|
# hostnamectl status
|
如果你使用某些基于VM的云服务,你也许需要配置/etc/cloud/cloud.cfg:
1
|
# vim /etc/cloud/cloud.cfg
|
添加一行:
1
|
preserve_hostname: true
|
编辑hosts文件:
1
|
# vim /etc/hosts
|
添加一行:
1
|
your_server_ip_addr mail.example.com mail
|
NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议。
1
2
3
|
# yum install ntp
# systemctl start ntpd
# systemctl enable ntpd
|
安装Zimbra
在安全Zimbra之前确保Postfix和sendmail没有启动,因为这些东西占用了25端口。
1
2
3
4
|
# systemctl stop postfix
# yum erase postfix
# systemctl stop sendmail
# systemctl disable sendmail
|
安装一些依赖包:
1
|
# yum install wget nmap-ncat libaio unzip perl-core sysstat
|
下载Zimbra:
1
2
|
# wget https://files.zimbra.com/downloads/8.8.8_GA/zcs-8.8.8_GA_2009.RHEL7_64.20180322150747.tgz
# tar zxvf zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
|
运行安装脚本:
1
2
|
# cd zcs-8.6.0_GA_1153.RHEL7_64.20141215151110
# ./install.sh
|
安装脚本会检查依赖,如果有依赖包没有安装,使用yum安装。
访问Zimbra web管理页面
使用浏览器访问:https://mail.example.com:7071。由于Zimbra使用自签名证书,浏览器也许会有警告。
用户名是admin,密码是在安装过程中设置的。
创建测试用户:
我创建两个用户test1@example.com和test2@example.com。
Manage->Accounts;创建完成之后你就可以使用这些用户登录https://mail.example.com。
OK,安装Zimbra完成。
节选自:http://blog.topspeedsnail.com/archives/5546