当前位置:   article > 正文

基于Linux CentOS 7安装搭建zimbra开源邮件服务器_zimbra 安装

zimbra 安装

1、环境

  1. 网络:飞塔防火墙用于端口映射
  2. 系统:Centos7
  3. ip地址:10.10.104.130(这里用的是本地服务器)
  4. 域名:mail.zimbra.com(我这里用的是阿里域名)

2、配置主机名(主机名和邮箱域名相同)

  1. hostnamectl set-hostname mail.zimbra.com
  2. echo "10.10.104.130 mail.zimbra.com" >> /etc/hosts

3、运行以下命令,禁用SELinux,然后停止SELinux运行:

setenforce 0

编辑SELinux配置文件,服务器重启之后仍然会保持禁用状态:

  1. vi /etc/selinux/config
  2. SELINUX=enforced
  3. 修改为:SELINUX=disabled

4、安装和更新zimbra所需要的包和库

  1. yum -y install perl perl-core nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite nc
  2. yum -y update

5、关闭安装的MTA服务

  1. systemctl stop postfix.service
  2. systemctl disable postfix.service

6、设置阿里域名解析
阿里云域名解析配置

7、下载并解压zimbra(官网地址:https://www.zimbra.com/downloads/)

  1. wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
  2. tar -zxvf zcs-8.6.0_GA_1153.RHEL7_64.20141215151110
  3. mv zcs-8.6.0_GA_1153.RHEL7_64.20141215151110 /usr/local/zimbra

8、安装zimbra

  1. cd /usr/local/zimbra
  2. ./install.sh --platform-override
  3. Operations logged to /tmp/install.log.2744
  4. Checking for existing installation...
  5. zimbra-ldap...NOT FOUND
  6. zimbra-logger...NOT FOUND
  7. zimbra-mta...NOT FOUND
  8. zimbra-dnscache...NOT FOUND
  9. zimbra-snmp...NOT FOUND
  10. zimbra-store...NOT FOUND
  11. zimbra-apache...NOT FOUND
  12. zimbra-spell...NOT FOUND
  13. zimbra-convertd...NOT FOUND
  14. zimbra-memcached...NOT FOUND
  15. zimbra-proxy...NOT FOUND
  16. zimbra-archiving...NOT FOUND
  17. zimbra-core...NOT FOUND
  18. PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.
  19. ZIMBRA, INC. ("ZIMBRA") WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU
  20. FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING
  21. THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY
  22. THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS
  23. AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.
  24. License Terms for the Zimbra Collaboration Suite:
  25. http://www.zimbra.com/license/zimbra-public-eula-2-5.html
  26. Do you agree with the terms of the software license agreement? [N] y
  27. Checking for prerequisites...
  28. FOUND: NPTL
  29. FOUND: nmap-ncat-6.40-7
  30. FOUND: sudo-1.8.6p7-17
  31. FOUND: libidn-1.28-4
  32. FOUND: gmp-6.0.0-12
  33. FOUND: libaio-0.3.109-13
  34. FOUND: libstdc++-4.8.5-4
  35. FOUND: unzip-6.0-15
  36. FOUND: perl-core-5.16.3-286
  37. Checking for suggested prerequisites...
  38. FOUND: perl-5.16.3
  39. FOUND: sysstat
  40. FOUND: sqlite
  41. Prerequisite check complete.
  42. Checking for installable packages
  43. Found zimbra-core
  44. Found zimbra-ldap
  45. Found zimbra-logger
  46. Found zimbra-mta
  47. Found zimbra-dnscache
  48. Found zimbra-snmp
  49. Found zimbra-store
  50. Found zimbra-apache
  51. Found zimbra-spell
  52. Found zimbra-memcached
  53. Found zimbra-proxy
  54. Select the packages to install
  55. Install zimbra-ldap [Y]
  56. Install zimbra-logger [Y]
  57. Install zimbra-mta [Y]
  58. Install zimbra-dnscache [Y] n
  59. Install zimbra-snmp [Y]
  60. Install zimbra-store [Y]
  61. Install zimbra-apache [Y]
  62. Install zimbra-spell [Y]
  63. Install zimbra-memcached [Y]
  64. Install zimbra-proxy [Y]
  65. Checking required space for zimbra-core
  66. Checking space for zimbra-store
  67. Checking required packages for zimbra-store
  68. zimbra-store package check complete.
  69. Installing:
  70. zimbra-core
  71. zimbra-ldap
  72. zimbra-logger
  73. zimbra-mta
  74. zimbra-snmp
  75. zimbra-store
  76. zimbra-apache
  77. zimbra-spell
  78. zimbra-memcached
  79. zimbra-proxy
  80. The system will be modified. Continue? [N] y
  81. Removing /opt/zimbra
  82. Removing zimbra crontab entry...done.
  83. Cleaning up zimbra init scripts...done.
  84. Cleaning up /etc/ld.so.conf...done.
  85. Cleaning up /etc/logrotate.d/zimbra...done.
  86. Cleaning up /etc/security/limits.conf...done.
  87. Finished removing Zimbra Collaboration Server.
  88. Installing packages
  89. zimbra-core......zimbra-core-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  90. zimbra-ldap......zimbra-ldap-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  91. zimbra-logger......zimbra-logger-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  92. zimbra-mta......zimbra-mta-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  93. zimbra-snmp......zimbra-snmp-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  94. zimbra-store......zimbra-store-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  95. zimbra-apache......zimbra-apache-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  96. zimbra-spell......zimbra-spell-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  97. zimbra-memcached......zimbra-memcached-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  98. zimbra-proxy......zimbra-proxy-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
  99. Operations logged to /tmp/zmsetup04082016-205457.log
  100. Installing LDAP configuration database...done.
  101. Setting defaults...
  102. DNS ERROR resolving MX for mail.zimbra.com
  103. It is suggested that the domain name have an MX record configured in DNS
  104. Change domain name? [Yes]
  105. Create domain: [mail.zimbra.com] zimbra.com **//输入域名后缀(如:mail.csdn.net就输入csdn.net)**
  106. MX: mail.zimbra.com(XXX.XX.XXX.XXX) **//括号为公网ip**
  107. Interface: 127.0.0.1
  108. Interface: ::1
  109. Interface: 10.10.104.130
  110. done.
  111. Checking for port conflicts
  112. Main menu
  113. 1) Common Configuration:
  114. 2) zimbra-ldap: Enabled
  115. 3) zimbra-logger: Enabled
  116. 4) zimbra-mta: Enabled
  117. 5) zimbra-snmp: Enabled
  118. 6) zimbra-store: Enabled
  119. +Create Admin User: yes
  120. +Admin user to create: admin@zimbra.com
  121. ******* +Admin Password UNSET
  122. +Anti-virus quarantine user: virus-quarantine.vhwa2pqsa7@zimbra.com
  123. +Enable automated spam training: yes
  124. +Spam training user: spam.jqlkpspj@zimbra.com
  125. +Non-spam(Ham) training user: ham.jztdgrii_b@zimbra.com
  126. +SMTP host: email.zimbra.com
  127. +Web server HTTP port: 8080
  128. +Web server HTTPS port: 8443
  129. +Web server mode: https
  130. +IMAP server port: 7143
  131. +IMAP server SSL port: 7993
  132. +POP server port: 7110
  133. +POP server SSL port: 7995
  134. +Use spell check server: yes
  135. +Spell server URL: http://mail.zimbra.com:7780/aspell.php
  136. +Enable version update checks: TRUE
  137. +Enable version update notifications: TRUE
  138. +Version update notification email: admin@zimbra.com
  139. +Version update source email: admin@zimbra.com
  140. +Install mailstore (service webapp): yes
  141. +Install UI (zimbra,zimbraAdmin webapps): yes
  142. 7) zimbra-spell: Enabled
  143. 8) zimbra-proxy: Enabled
  144. 9) Default Class of Service Configuration:
  145. s) Save config to file
  146. x) Expand menu
  147. q) Quit
  148. Address unconfigured (**) items (? - help) 6 **//邮件服务器基本配置,这里我们只设置管理员密码**
  149. Store configuration
  150. 1) Status: Enabled
  151. 2) Create Admin User: yes
  152. 3) Admin user to create: admin@zimbra.com
  153. ** 4) Admin Password UNSET
  154. 5) Anti-virus quarantine user: virus-quarantine.vhwa2pqsa7@zimbra.com
  155. 6) Enable automated spam training: yes
  156. 7) Spam training user: spam.jqlkpspj@zimbra.com
  157. 8) Non-spam(Ham) training user: ham.jztdgrii_b@zimbra.com
  158. 9) SMTP host: email.zimbra.com
  159. 10) Web server HTTP port: 8080
  160. 11) Web server HTTPS port: 8443
  161. 12) Web server mode: https
  162. 13) IMAP server port: 7143
  163. 14) IMAP server SSL port: 7993
  164. 15) POP server port: 7110
  165. 16) POP server SSL port: 7995
  166. 17) Use spell check server: yes
  167. 18) Spell server URL: http://mail.zimbra.com:7780/aspell.php
  168. 19) Enable version update checks: TRUE
  169. 20) Enable version update notifications: TRUE
  170. 21) Version update notification email: admin@zimbra.com
  171. 22) Version update source email: admin@zimbra.com
  172. 23) Install mailstore (service webapp): yes
  173. 24) Install UI (zimbra,zimbraAdmin webapps): yes
  174. Select, or 'r' for previous menu [r] 4 **//管理员密码配置**
  175. Password for admin@zimbra.com (min 6 characters): [5okG5xTdX] 123456
  176. Store configuration
  177. 1) Status: Enabled
  178. 2) Create Admin User: yes
  179. 3) Admin user to create: admin@zimbra.com
  180. 4) Admin Password set
  181. 5) Anti-virus quarantine user: virus-quarantine.vhwa2pqsa7@zimbra.com
  182. 6) Enable automated spam training: yes
  183. 7) Spam training user: spam.jqlkpspj@zimbra.com
  184. 8) Non-spam(Ham) training user: ham.jztdgrii_b@zimbra.com
  185. 9) SMTP host: admin@zimbra.com
  186. 10) Web server HTTP port: 8080
  187. 11) Web server HTTPS port: 8443
  188. 12) Web server mode: https
  189. 13) IMAP server port: 7143
  190. 14) IMAP server SSL port: 7993
  191. 15) POP server port: 7110
  192. 16) POP server SSL port: 7995
  193. 17) Use spell check server: yes
  194. 18) Spell server URL: http://admin@zimbra.com :7780/aspell.php
  195. 19) Enable version update checks: TRUE
  196. 20) Enable version update notifications: TRUE
  197. 21) Version update notification email: admin@zimbra.com
  198. 22) Version update source email: admin@zimbra.com
  199. 23) Install mailstore (service webapp): yes
  200. 24) Install UI (zimbra,zimbraAdmin webapps): yes
  201. Select, or 'r' for previous menu [r] r
  202. Main menu
  203. 1) Common Configuration:
  204. 2) zimbra-ldap: Enabled
  205. 3) zimbra-logger: Enabled
  206. 4) zimbra-mta: Enabled
  207. 5) zimbra-snmp: Enabled
  208. 6) zimbra-store: Enabled
  209. 7) zimbra-spell: Enabled
  210. 8) zimbra-proxy: Enabled
  211. 9) Default Class of Service Configuration:
  212. s) Save config to file
  213. x) Expand menu
  214. q) Quit
  215. *** CONFIGURATION COMPLETE - press 'a' to apply
  216. Select from menu, or press 'a' to apply config (? - help) a
  217. Save configuration data to a file? [Yes]
  218. Save config in file: [/opt/zimbra/config.11982]
  219. Saving config in /opt/zimbra/config.11982...done.
  220. The system will be modified - continue? [No] yes
  221. Operations logged to /tmp/zmsetup04082016-205457.log
  222. Setting local config values...done.
  223. Initializing core config...Setting up CA...done.
  224. Deploying CA to /opt/zimbra/conf/ca ...done.
  225. Creating SSL zimbra-store certificate...done.
  226. Creating new zimbra-ldap SSL certificate...done.
  227. Creating new zimbra-mta SSL certificate...done.
  228. Creating new zimbra-proxy SSL certificate...done.
  229. Installing mailboxd SSL certificates...done.
  230. Installing MTA SSL certificates...done.
  231. Installing LDAP SSL certificate...done.
  232. Installing Proxy SSL certificate...done.
  233. Initializing ldap...done.
  234. Setting replication password...done.
  235. Setting Postfix password...done.
  236. Setting amavis password...done.
  237. Setting nginx password...done.
  238. Setting BES searcher password...done.
  239. Creating server entry for mail.zimbra.com...done.
  240. Setting Zimbra IP Mode...done.
  241. Saving CA in ldap ...done.
  242. Saving SSL Certificate in ldap ...done.
  243. Setting spell check URL...done.
  244. Setting service ports on mail.zimbra.com...done.
  245. Setting zimbraFeatureTasksEnabled=TRUE...done.
  246. Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
  247. Setting TimeZone Preference...done.
  248. Initializing mta config...done.
  249. Setting services on mail.zimbra.com...done.
  250. Adding mail.zimbra.com to zimbraMailHostPool in default COS...done.
  251. Creating domain zimbra.com...done.
  252. Setting default domain name...done.
  253. Creating domain zimbra.com...already exists.
  254. Creating admin account admin@zimbra.com...done.
  255. Creating root alias...done.
  256. Creating postmaster alias...done.
  257. Creating user spam.jqlkpspj@zimbra.com...done.
  258. Creating user ham.jztdgrii_b@zimbra.com...done.
  259. Creating user virus-quarantine.vhwa2pqsa7@zimbra.com...done.
  260. Setting spam training and Anti-virus quarantine accounts...done.
  261. Initializing store sql database...done.
  262. Setting zimbraSmtpHostname for mail.zimbra.com...done.
  263. Configuring SNMP...done.
  264. Setting up syslog.conf...done.
  265. Starting servers...done.
  266. Installing common zimlets...
  267. com_zimbra_adminversioncheck...done.
  268. com_zimbra_attachcontacts...done.
  269. com_zimbra_attachmail...done.
  270. com_zimbra_bulkprovision...done.
  271. com_zimbra_cert_manager...done.
  272. com_zimbra_clientuploader...done.
  273. com_zimbra_date...done.
  274. com_zimbra_email...done.
  275. com_zimbra_mailarchive...done.
  276. com_zimbra_phone...done.
  277. com_zimbra_proxy_config...done.
  278. com_zimbra_srchhighlighter...done.
  279. com_zimbra_tooltip...done.
  280. com_zimbra_url...done.
  281. com_zimbra_viewmail...done.
  282. com_zimbra_webex...done.
  283. com_zimbra_ymemoticons...done.
  284. Finished installing common zimlets.
  285. Restarting mailboxd...done.
  286. Creating galsync account for default domain...done.
  287. You have the option of notifying Zimbra of your installation.
  288. This helps us to track the uptake of the Zimbra Collaboration Server.
  289. The only information that will be transmitted is:
  290. The VERSION of zcs installed (8.6.0_GA_1153_RHEL7_64)
  291. The ADMIN EMAIL ADDRESS created (admin@zimbra.com)
  292. Notify Zimbra of your installation? [Yes] no
  293. Notification skipped
  294. Setting up zimbra crontab...done.
  295. Moving /tmp/zmsetup04082016-205457.log to /opt/zimbra/log
  296. Configuration complete - press return to exit

重要:接下来移除文件 /etc/resolv.conf 第一行的 nameserver 127.0.0.1 然后reboot重启系统。

9、启动之后查看服务运行状态:

  1. [root@mail ~]# su - zimbra <--切换到zimbra用户下
  2. Last login: Thu Nov 28 21:30:21 CST 2019 on pts/0
  3. [zimbra@mail ~]$
  4. [zimbra@mail ~]$ zmcontrol status <--查看zimbra服务运行状态
  5. Host mail.chenxie.net
  6. amavis Running
  7. antispam Running
  8. antivirus Running
  9. dnscache Running
  10. imapd Running
  11. ldap Running
  12. logger Running
  13. mailbox Running
  14. memcached Running
  15. mta Running
  16. opendkim Running
  17. proxy Running
  18. service webapp Running
  19. snmp Running
  20. spell Running
  21. stats Running
  22. zimbra webapp Running
  23. zimbraAdmin webapp Running
  24. zimlet webapp Running
  25. zmconfigd Running

10、公网邮件收发和账号登录配置
系统管理员:https://10.10.104.130:7071
客户端:https://10.10.104.130

11、配置SMTP认证
zimbra邮件系统安装完成后开启的是TLS认证功能,没有开始postfix的SMTP认证功能。open relay对公网上所有的用户开放,意味着垃圾邮件制造者可以使用我们的邮件服务器做中转站达到发送垃圾邮件的目的,我们的邮件服务器有可能会被反垃圾邮件联盟组织列入黑名单,导致互联网上的邮件服务器拒收我们的邮件,因此我们需要关闭服务器的open relay功能,启用SMTP认证,只给通过认证的用户进行邮件的转发。
测试服务器是否开始SMTP认证,在CMD命令行执行telnet 命令 如下:

  1. [zimbra@mail root]$ telnet 10.10.104.130 25
  2. Connecting to 10.10.104.130:25...
  3. Connection established.
  4. To escape to local shell, press 'Ctrl+Alt+]' .
  5. 220 zimbra.net ESMTP Postfix
  6. ehlo zimbra.com
  7. 250-zimbra.com
  8. 250-PIPELINING
  9. 250-SIZE 10240000
  10. 250-VRFY
  11. 250-ETRN
  12. 250-STARTTLS
  13. 250-ENHANCEDSTATUSCODES
  14. 250-8BITMIME
  15. 250 DSN
  16. quit221 2.0.0 Bye

12.防火墙或者路由做端口映射(NAT)配置

在以上命令结果中,没有看到任何有关AUTH认证的参数,表明服务器是没有开启SMTP认证功能的。
开启smtp认证功能

  1. zmprov modifyServer mail.zimbra.net zimbraMtaTlsAuthOnly FALSE
  2. zmcontrol restart

批量添加用户
zmprov createAccount 邮箱@域名 密码 displayName ‘用户名’ (建议用英文名)

  1. zmprov createAccount mary@zimbra.com admin123 displayName 'Mary'
  2. zmprov createAccount tom@zimbra.com admin123 displayName 'Tom'

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/900329
推荐阅读
相关标签
  

闽ICP备14008679号