zimbra+mailman邮件系统部署大致分为六大部分:

第一部分:安装DNS服务器  第二部分:安装zimbra   第三部分:安装httpd等依赖包   第四部分:安装mailman  第五部分:为了和zimbra组合,修改httpd服务的相关设定  第六部分:创建mailman的默认站点列表

特别说明:为了实现mailman的web管理方式,本文采用单独的httpd服务,而不使用zimbra内置的web服务。

在安装过程中也是遇到了各种各样的问题,走了很多弯路,最后才有了此文,下面开始安装部署吧。


系统环境:

系统版本:
[root@xy ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core)
内核: 
[root@xy ~]# uname -r
3.10.0-862.el7.x86_64
系统位数:
[root@xy ~]# uname -m
x86_64

安装前准备:

1.关闭selinux和防火墙

关闭selinux:
[root@Zimbra ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
[root@xiaoyu ~]# setenforce 0

关闭防火墙:
[root@xiaoyu ~]# firewall-cmd --state  
not running
[root@xiaoyu ~]# systemctl stop firewalld   
[root@xiaoyu ~]# systemctl disable firewalld

2.配置主机名

[root@localhost ~]# hostnamectl --static set-hostname xiaoyu
[root@xiaoyu ~]# hostname
xiaoyu

3.更新系统:

[root@xiaoyu ~]# yum -y update

4.关闭安装的MTA服务:

[root@xiaoyu ~]#systemctl stop postfix
[root@xiaoyu ~]#systemctl disable postfix
[root@xiaoyu ~]#ystemctl stop sendmail
[root@xiaoyu ~]#systemctl disable sendmail


第一部分:安装DNS服务器

1.安装dns服务所需的软件包:

[root@xiaoyu ~]# yum -y install bind bind-utils bind-chroot
[root@xiaoyu ~]# cp /etc/named.conf /etc/named.conf.bak

2.修改主配置文件:

[root@xiaoyu ~]# cp /etc/named.conf /etc/named.conf.bak
[root@xiaoyu ~]# vim /etc/named.conf
options {
        listen-on port 53 { any; };   
        allow-query     { any; };   
};

同时增加如下配置:
zone "husyt.com" IN {
        type master;
        file "husyt.com.zone";
        allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "192.168.1.arpa";
        allow-update { none; };
};

3.配置区域配置文件:

[root@xiaoyu ~]# vim /var/named/husyt.com.zone
$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      ns.husyt.com.
        MX 10     mail.husyt.com.
ns        A       192.168.1.10
mail        A       192.168.1.10

[root@xiaoyu ~]# vim /var/named/192.168.1.arpa

$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS         ns.husyt.com.
10       PTR       ns.husyt.com.
10       PTR       mail.husyt.com.

4.启动dns服务:

[root@xiaoyu ~]# systemctl start named.service

5.使用本地的dns:

[root@xiaoyu ~]# echo "nameserver 127.0.0.1" >> /etc/resolv.conf


第二部分:安装zimbra

1.安装zimbra需要FQDN,所以我现在使用的是mail.husyt.com,主机名为:xiaoyu。

[root@xiaoyu ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1       localhost localhost.localdomain localhost6 localhost6.localdomain6
zimbra_ip   mail.husyt.com  xiaoyu

2.安装zimbra所需的依赖包

[root@xiaoyu ~]# yum -y install wget perl-devel perl perl-core ntpl nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite nc

3.下载zimbra安装包,解压并安装

创建存放软件的目录:

[root@xiaoyu ~]# mkdir /application
 [root@xiaoyu ~]# cd /application/
 [root@xiaoyu application]#  wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz  
 [root@xiaoyu application]# ll
 total 760748
 -rw-r--r--. 1 root root 779005849 Dec 16  2014 zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
 [root@xiaoyu application]# tar xf zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz 
 [root@xiaoyu application]# mv zcs-8.6.0_GA_1153.RHEL7_64.20141215151110 zimbra
 [root@xiaoyu application]# cd zimbra/
 [root@xiaoyu zimbra]# ./install.sh --platform-override
 
Operations logged to /tmp/install.log.22794
Checking for existing installation...
    zimbra-ldap...NOT FOUND
    zimbra-logger...NOT FOUND
    zimbra-mta...NOT FOUND
    zimbra-dnscache...NOT FOUND
    zimbra-snmp...NOT FOUND
    zimbra-store...NOT FOUND
    zimbra-apache...NOT FOUND
    zimbra-spell...NOT FOUND
    zimbra-convertd...NOT FOUND
    zimbra-memcached...NOT FOUND
    zimbra-proxy...NOT FOUND
    zimbra-archiving...NOT FOUND
    zimbra-core...NOT FOUND
 
 
PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.
ZIMBRA, INC. ("ZIMBRA") WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU
FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING
THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY
THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS
AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.
 
License Terms for the Zimbra Collaboration Suite:
  http://www.zimbra.com/license/zimbra-public-eula-2-5.html
 
 
 
Do you agree with the terms of the software license agreement? [N] y
 
 
 
Checking for prerequisites...
     FOUND: NPTL
     FOUND: nmap-ncat-6.40-13
     FOUND: sudo-1.8.19p2-14
     FOUND: libidn-1.28-4
     FOUND: gmp-6.0.0-15
     FOUND: libaio-0.3.109-13
     FOUND: libstdc++-4.8.5-28
     FOUND: unzip-6.0-19
     FOUND: perl-core-5.16.3-292
 
Checking for suggested prerequisites...
     FOUND: perl-5.16.3
     FOUND: sysstat
     FOUND: sqlite
Prerequisite check complete.
 
Checking for installable packages
 
Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-dnscache
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy
 
 
Select the packages to install
 
Install zimbra-ldap [Y] 
 
Install zimbra-logger [Y] 
 
Install zimbra-mta [Y] 
 
Install zimbra-dnscache [Y] n
 
Install zimbra-snmp [Y] 
 
Install zimbra-store [Y] 
 
Install zimbra-apache [Y] 
 
Install zimbra-spell [Y] 
 
Install zimbra-memcached [Y] 
 
Install zimbra-proxy [Y] 
Checking required space for zimbra-core
Checking space for zimbra-store
Checking required packages for zimbra-store
zimbra-store package check complete.
 
Installing:
    zimbra-core
    zimbra-ldap
    zimbra-logger
    zimbra-mta
    zimbra-snmp
    zimbra-store
    zimbra-apache
    zimbra-spell
    zimbra-memcached
    zimbra-proxy
 
The system will be modified.  Continue? [N] y
 
Removing /opt/zimbra
Removing zimbra crontab entry...done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/ld.so.conf...done.
Cleaning up /etc/security/limits.conf...done.
 
Finished removing Zimbra Collaboration Server.
 
Installing packages
 
    zimbra-core......zimbra-core-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-ldap......zimbra-ldap-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-logger......zimbra-logger-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-mta......zimbra-mta-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-snmp......zimbra-snmp-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-store......zimbra-store-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-apache......zimbra-apache-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-spell......zimbra-spell-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-memcached......zimbra-memcached-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-proxy......zimbra-proxy-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
Operations logged to /tmp/zmsetup09142018-155427.log
Installing LDAP configuration database...done.
Setting defaults...sh: /sbin/ifconfig: No such file or directory
 
 
DNS ERROR resolving MX for mail.husyt.com
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] 
Create domain: [mail.husyt.com] husyt.com
               MX: mail.husyt.com (10.16.17.3)
 
               Interface: 127.0.0.1
               Interface: ::1
               Interface: 10.16.17.3
done.
Checking for port conflicts
sh: netstat: command not found
 
Main menu
 
   1) Common Configuration:                                                  
   2) zimbra-ldap:                             Enabled                       
   3) zimbra-logger:                           Enabled                       
   4) zimbra-mta:                              Enabled                       
   5) zimbra-snmp:                             Enabled                       
   6) zimbra-store:                            Enabled                       
        +Create Admin User:                    yes                           
        +Admin user to create:                 admin@husyt.com               
******* +Admin Password                        UNSET                         
        +Anti-virus quarantine user:           virus-quarantine.r0glcnpc@husyt.com
        +Enable automated spam training:       yes                           
        +Spam training user:                   spam.rhr6mt0d@husyt.com       
        +Non-spam(Ham) training user:          ham.74smcfrgx@husyt.com       
        +SMTP host:                            mail.husyt.com                
        +Web server HTTP port:                 8080                          
        +Web server HTTPS port:                8443                          
        +Web server mode:                      https                         
        +IMAP server port:                     7143                          
        +IMAP server SSL port:                 7993                          
        +POP server port:                      7110                          
        +POP server SSL port:                  7995                          
        +Use spell check server:               yes                           
        +Spell server URL:                     http://mail.husyt.com:7780/aspell.php
        +Enable version update checks:         TRUE                          
        +Enable version update notifications:  TRUE                          
        +Version update notification email:    admin@husyt.com               
        +Version update source email:          admin@husyt.com               
        +Install mailstore (service webapp):   yes                           
        +Install UI (zimbra,zimbraAdmin webapps): yes                           
 
   7) zimbra-spell:                            Enabled                       
   8) zimbra-proxy:                            Enabled                       
   9) Default Class of Service Configuration:                                
   s) Save config to file                                                    
   x) Expand menu                                                            
   q) Quit                                    
 
Address unconfigured (**) items  (? - help) 6
 
 
Store configuration
 
   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@husyt.com               
** 4) Admin Password                           UNSET                         
   5) Anti-virus quarantine user:              virus-quarantine.r0glcnpc@husyt.com
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      spam.rhr6mt0d@husyt.com       
   8) Non-spam(Ham) training user:             ham.74smcfrgx@husyt.com       
   9) SMTP host:                               mail.husyt.com                
  10) Web server HTTP port:                    8080                          
  11) Web server HTTPS port:                   8443                          
  12) Web server mode:                         https                         
  13) IMAP server port:                        7143                          
  14) IMAP server SSL port:                    7993                          
  15) POP server port:                         7110                          
  16) POP server SSL port:                     7995                          
  17) Use spell check server:                  yes                           
  18) Spell server URL:                        http://mail.husyt.com:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       admin@husyt.com               
  22) Version update source email:             admin@husyt.com               
  23) Install mailstore (service webapp):      yes                           
  24) Install UI (zimbra,zimbraAdmin webapps): yes                           
 
Select, or 'r' for previous menu [r] 4
 
Password for admin@husyt.com (min 6 characters): [2N8CdR1ZD] 123456
 
Store configuration
 
   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@husyt.com               
   4) Admin Password                           set                           
   5) Anti-virus quarantine user:              virus-quarantine.r0glcnpc@husyt.com
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      spam.rhr6mt0d@husyt.com       
   8) Non-spam(Ham) training user:             ham.74smcfrgx@husyt.com       
   9) SMTP host:                               mail.husyt.com                
  10) Web server HTTP port:                    8080                          
  11) Web server HTTPS port:                   8443                          
  12) Web server mode:                         https                         
  13) IMAP server port:                        7143                          
  14) IMAP server SSL port:                    7993                          
  15) POP server port:                         7110                          
  16) POP server SSL port:                     7995                          
  17) Use spell check server:                  yes                           
  18) Spell server URL:                        http://mail.husyt.com:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       admin@husyt.com               
  22) Version update source email:             admin@husyt.com               
  23) Install mailstore (service webapp):      yes                           
  24) Install UI (zimbra,zimbraAdmin webapps): yes                           
 
Select, or 'r' for previous menu [r] r
 
Main menu
 
   1) Common Configuration:                                                  
   2) zimbra-ldap:                             Enabled                       
   3) zimbra-logger:                           Enabled                       
   4) zimbra-mta:                              Enabled                       
   5) zimbra-snmp:                             Enabled                       
   6) zimbra-store:                            Enabled                       
   7) zimbra-spell:                            Enabled                       
   8) zimbra-proxy:                            Enabled                       
   9) Default Class of Service Configuration:                                
   s) Save config to file                                                    
   x) Expand menu                                                            
   q) Quit                                    
 
*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a
Save configuration data to a file? [Yes] 
Save config in file: [/opt/zimbra/config.32000] 
Saving config in /opt/zimbra/config.32000...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup09142018-155427.log
Setting local config values...done.
Initializing core config...Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Creating SSL zimbra-store certificate...done.
Creating new zimbra-ldap SSL certificate...done.
Creating new zimbra-mta SSL certificate...done.
Creating new zimbra-proxy SSL certificate...done.
Installing mailboxd SSL certificates...done.
Installing MTA SSL certificates...done.
Installing LDAP SSL certificate...done.
Installing Proxy SSL certificate...done.
Initializing ldap...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Setting BES searcher  password...done.
Creating server entry for mail.husyt.com...done.
Setting Zimbra IP Mode...done.
Saving CA in ldap ...done.
Saving SSL Certificate in ldap ...done.
Setting spell check URL...done.
Setting service ports on mail.husyt.com...done.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.husyt.com...done.
Adding mail.husyt.com to zimbraMailHostPool in default COS...done.
Creating domain husyt.com...done.
Setting default domain name...done.
Creating domain husyt.com...already exists.
Creating admin account admin@husyt.com...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.rhr6mt0d@husyt.com...done.
Creating user ham.74smcfrgx@husyt.com...done.
Creating user virus-quarantine.r0glcnpc@husyt.com...done.
Setting spam training and Anti-virus quarantine accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mail.husyt.com...done.
Configuring SNMP...done.
Setting up syslog.conf...done.
Starting servers...done.
Installing common zimlets...
               com_zimbra_adminversioncheck...done.
               com_zimbra_attachcontacts...done.
               com_zimbra_attachmail...done.
               com_zimbra_bulkprovision...done.
               com_zimbra_cert_manager...done.
               com_zimbra_clientuploader...done.
               com_zimbra_date...done.
               com_zimbra_email...done.
               com_zimbra_mailarchive...done.
               com_zimbra_phone...done.
               com_zimbra_proxy_config...done.
               com_zimbra_srchhighlighter...done.
               com_zimbra_tooltip...done.
               com_zimbra_url...done.
               com_zimbra_viewmail...done.
               com_zimbra_webex...done.
               com_zimbra_ymemoticons...done.
Finished installing common zimlets.
Restarting mailboxd...done.
Creating galsync account for default domain...done.
 
You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
               The VERSION of zcs installed (8.6.0_GA_1153_RHEL7_64)
               The ADMIN EMAIL ADDRESS created (admin@husyt.com)
 
Notify Zimbra of your installation? [Yes] no
Notification skipped
Setting up zimbra crontab...done.
 
 
Moving /tmp/zmsetup09142018-155427.log to /opt/zimbra/log
 
 
Configuration complete - press return to exit 
 
 
[root@xiaoyu zimbra]#

7.确认zimbra服务是否运行正常:

[root@xiaoyu ~]# su - zimbra
Last login: Fri Sep 14 16:55:50 CST 2018 on pts/1
[zimbra@xiaoyu ~]$ zmcontrol status
Host mail.husyt.com
	amavis                  Running
	antispam                Running
	antivirus               Running
	ldap                    Running
	logger                  Running
	mailbox                 Running
	memcached               Running
	mta                     Running
	opendkim                Running
	proxy                   Running
	service webapp          Running
	snmp                    Running
	spell                   Running
	stats                   Running
	zimbra webapp           Running
	zimbraAdmin webapp      Running
	zimlet webapp           Running
	zmconfigd               Running
[zimbra@xiaoyu ~]$


8.验证zimbraweb管理界面及邮箱使用是否正常

管理界面:

https://zimbra_ip:7071/,输入安装时的用户名和密码登录即可。

zimbra+mailman邮件系统部署_mail

登陆后,界面如下:

zimbra+mailman邮件系统部署_zimbra_02

web版邮箱:https://zimbra_ip/,输入用户名和密码进行登录:

zimbra+mailman邮件系统部署_zimbra_03

登录后如下:

zimbra+mailman邮件系统部署_mail_04

为了进行测试,新建邮件账户:xiaoyu@husyt.com

现在使用admin@husyt.com发送邮件给xiaoyu@husyt.com和外域qq邮箱,验证是否正常。

zimbra+mailman邮件系统部署_centos7_05

经确认,邮箱已收到邮件,如下:

admin@husyt.com:

zimbra+mailman邮件系统部署_mail_06

xiaoyu@htsyt.com:

zimbra+mailman邮件系统部署_centos7_07

xxx@qq:

提示:如果收件箱没有,也可能在垃圾箱

zimbra+mailman邮件系统部署_mail_08


经测试,zimbra邮箱可以正常使用。

至此,zimbra搭建完成。


第三部分:安装httpd服务

1.安装httpd所需的依赖包:

[root@xiaoyu ~]# yum -y install autoconf libtool  expat-devel  gcc gcc-c++

2.安装apr:

[root@xiaoyu ~]# cd /application/
[root@xiaoyu application]# wget http://mirrors.shu.edu.cn/apache/apr/apr-1.6.3.tar.gz 
[root@xiaoyu application]# tar xf apr-1.6.3.tar.gz 
[root@xiaoyu application]# cd apr-1.6.3
[root@xiaoyu apr-1.6.3]# ./buildconf 
[root@xiaoyu apr-1.6.3]# ./configure
[root@xiaoyu apr-1.6.3]# make
[root@xiaoyu apr-1.6.3]# make install


问题1:
[root@xiaoyu apr-1.6.3]# ./buildconf
buildconf: checking installation...
buildconf: python version 2.7.5 (ok)
buildconf: autoconf version 2.69 (ok)
buildconf: libtool version 2.4.2 (ok)
buildconf: copying libtool helper files using /usr/bin/libtoolize
buildconf: creating include/arch/unix/apr_private.h.in ...
perl: warning: Setting locale failed.   
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
buildconf: creating configure ...
buildconf: generating 'make' outputs ...
buildconf: rebuilding rpm spec file

解决方法:LANG=C

问题2:
config.status: executing libtool commands
rm: cannot remove 'libtoolT': No such file or directory
config.status: executing default commands

解决方法:
安装Apr出现的问题  rm: cannot remove `libtoolT': No such file or directory 
.configure配置参数:

(1)编辑 configure文件,查找 $RM "$cfgfile"这个地方,用#注释掉
(2)在configure里面 RM='$RM'   这里的$RM后面一定有一个空格。 如果后面没有空格,直接连接减号,就依
然会报错,把RM='$RM'改为RM='$RM  -f'。

3.安装apr-util:

[root@xiaoyu ~]# cd /application/
[root@xiaoyu application]# wget http://mirrors.shu.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
[root@xiaoyu application]# tar xf apr-util-1.6.1.tar.gz 
[root@xiaoyu application]# cd apr-util-1.6.1
[root@xiaoyu apr-util-1.6.1]# ./configure --with-apr=/usr/local/apr
[root@xiaoyu apr-util-1.6.1]# make
[root@xiaoyu apr-util-1.6.1]# make install

4.安装pcre:

[root@xiaoyu ~]# cd /application/
[root@xiaoyu application]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz
[root@xiaoyu application]# tar xf pcre-8.42.tar.gz 
[root@xiaoyu application]# cd pcre-8.42
[root@xiaoyu pcre-8.42]# ./configure
[root@xiaoyu pcre-8.42]# make
[root@xiaoyu pcre-8.42]# make  install

5.安装httpd:

[root@xiaoyu ~]# cd /application/
[root@xiaoyu application]# wget http://mirrors.shu.edu.cn/apache/httpd/httpd-2.4.34.tar.gz 
[root@xiaoyu application]# tar xf httpd-2.4.34.tar.gz 
[root@xiaoyu application]# cp -r /application/apr-1.6.3 /application/httpd-2.4.34/srclib/apr
[root@xiaoyu application]# cp -r /application/apr-util-1.6.1 /application/httpd-2.4.34/srclib/apr-util
[root@xiaoyu application]# cd httpd-2.4.34
[root@xiaoyu httpd-2.4.34]# ./configure --prefix=/usr/local/apache2 --with-included-apr
[root@xiaoyu httpd-2.4.34]# make 
[root@xiaoyu httpd-2.4.34]# make install

第四部分:安装mailman

1.安装mailman所需的依赖包:

[root@xiaoyu ~]# yum install python python-devel gcc gcc-c++

2.新建mailman所需的用户和组及相关权限设定:

[root@xiaoyu ~]# groupadd mailman
[root@xiaoyu ~]# useradd -c "GNU Mailman" -g mailman -M -s /sbin/nologin mailman
[root@xiaoyu ~]# cd /usr/local
[root@xiaoyu local]# mkdir mailman
[root@xiaoyu local]# chgrp mailman mailman
[root@xiaoyu local]# chmod a+rx,g+ws mailman

3.下载mailman安装包并安装:

[root@xiaoyu ~]# cd /application/
[root@xiaoyu application]# wget http://downloads.sourceforge.net/project/mailman/Mailman%202.1%20%28stable%29/2.1.12/mailman-2.1.12.tgz
[root@xiaoyu application]# tar xf mailman-2.1.12.tgz 
[root@xiaoyu application]# cd mailman-2.1.12
[root@xiaoyu mailman-2.1.12]# ./configure --with-mail-gid=mailman --with-cgi-gid=mailman 
[root@xiaoyu mailman-2.1.12]# make
[root@xiaoyu mailman-2.1.12]# make install


第五部分:为了和zimbra组合,修改相关设定

httpd服务:

1.修改mailman相关目录的权限:

[root@xiaoyu ~]# cd /usr/local/mailman/archives
[root@xiaoyu archives]# chown zimbra private
[root@xiaoyu archives]# chmod o-x private
检查安装:
/usr/local/mailman/bin/check_perms -f

2.更改/usr/local/apache2/conf/httpd.conf文件:

   变更配置之前,先对配置文件进行备份:

[root@xiaoyu ~]# cp -a  /usr/local/apache2/conf/httpd.conf  /usr/local/apache2/conf/httpd.conf.bak

  (1)变更用户:

   User zimbra
   Group zimbra

  (2)开启LoadModule cgid_module modules/mod_cgid.so模块

LoadModule cgid_module modules/mod_cgid.so

  (3)端口号为了避免和zimbra的httpd服务冲突,改为8081:

 Listen 8081

  (4)在/usr/local/apache2/conf/httpd.conf增加如下内容:

在下述代码下面增加mailman的相关配置:
<Directory />
    AllowOverride none
    Require all denied
</Directory>

增加的配置如下:
#
#  httpd configuration settings for use with mailman.
#

ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
<Directory "/usr/local/mailman/cgi-bin/">
   AllowOverride None
   Options None
   Require all granted
#   Order allow,deny
#   Allow from all
</Directory>

Alias /pipermail/ /usr/local/mailman/archives/public/
<Directory "/usr/local/mailman/archives/public">
   AllowOverride None
   Options None
   Require all granted
#   Order allow,deny
#   Allow from all
</Directory>


# Uncomment the following line, replacing www.example.com with your server’s
# name, to redirect queries to /mailman to the listinfo page (recommended).
# RedirectMatch ^/mailman[/]*$ http://www.example.com/mailman/listinfo

检查语法:
[root@xiaoyu ~]# /usr/local/apache2/bin/apachectl -t
Syntax OK

3.拷贝mailman的icons并重启Apache服务:

[root@xiaoyu ~]# cd /usr/local/apache2/htdocs/
[root@xiaoyu htdocs]# mkdir mmimages
[root@xiaoyu htdocs]# chown -R zimbra:zimbra mmimages

zimbra用户:
[root@xiaoyu htdocs]# su - zimbra
Last login: Fri Sep 14 17:00:36 CST 2018 on pts/1
[zimbra@xiaoyu ~]$ cd /usr/local/apache2/htdocs/
[zimbra@xiaoyu htdocs]$ cp /usr/local/mailman/icons/* mmimages/

root用户:
[root@xiaoyu htdocs]# /usr/local/apache2/bin/apachectl stop
httpd (no pid file) not running      
[root@xiaoyu htdocs]# /usr/local/apache2/bin/apachectl start

postfix服务:

1.修改postfix服务之前,先关闭zimbra服务:

 [root@xiaoyu ~]#  /etc/init.d/zimbra stop

2.编辑 /opt/zimbra/postfix/conf/main.cf 配置文件:

[root@xiaoyu ~]# cp -a  /opt/zimbra/postfix/conf/main.cf /opt/zimbra/postfix/conf/main.cf.bak
[root@xiaoyu ~]# vim /opt/zimbra/postfix/conf/main.cf
将virtual_alias_maps和alias_maps修改为如下内容: 
virtual_alias_maps = ldap:/opt/zimbra/conf/ldap-vam.cf,lmdb:/usr/local/mailman/data/virtual-mailman
alias_maps = lmdb:/etc/aliases,lmdb:/usr/local/mailman/data/aliases

3.编辑/opt/zimbra/conf/zmconfigd.cf删除下述的配置变量,否则重启zimbra时,/opt/zimbra/postfix/conf/main.cf 中的配置会变回默认配置:

[root@xiaoyu ~]# cp -a /opt/zimbra/conf/zmconfigd.cf /opt/zimbra/conf/zmconfigd.cf.bak
[root@xiaoyu ~]# vim /opt/zimbra/conf/zmconfigd.cf
删除如下内容:
mydestination
virtual_alias_maps
alias_maps
mynetworks

删除内容具体如下:
if VAR zimbraMtaMyDestination
                POSTCONF mydestination VAR zimbraMtaMyDestination
fi
POSTCONF virtual_alias_maps                     VAR zimbraMtaVirtualAliasMaps
POSTCONF alias_maps                             VAR zimbraMtaAliasMaps
if VAR zimbraMtaMyNetworks
                POSTCONF mynetworks VAR zimbraMtaMyNetworks
fi

提示:为了防止在重启zimbra服务后,配置恢复到默认状态,还可以采用如下命令:
su - zimbra
zmprov ms mail.imanudin.net zimbraMtaVirtualAliasMaps 'ldap:/opt/zimbra/conf/ldap-vam.cf,lmdb:/var/lib/mailman/data/virtual-mailman'
zmprov ms mail.husyt.com zimbraMtaAliasMaps 'lmdb:/etc/aliases,lmdb:/var/lib/mailman/data/aliases'
zmprov ms mail.imanudin.net zimbraMtaMyDestination 'localhost mail.husyt.com'
zmcontrol restart

4.编辑/usr/local/mailman/Mailman/mm_cfg.py文件,在文件结尾添加如下内容:

[root@xiaoyu ~]# cp -a /usr/local/mailman/Mailman/mm_cfg.py /usr/local/mailman/Mailman/mm_cfg.py.bak
[root@xiaoyu ~]# vim  /usr/local/mailman/Mailman/mm_cfg.py   
MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/opt/zimbra/postfix/sbin/postalias'
POSTFIX_MAP_CMD = '/opt/zimbra/postfix/sbin/postmap'
IMAGE_LOGOS = '/mmimages/'
DEFAULT_URL_PATTERN = 'http://%s:8081/mailman/'    
POSTFIX_STYLE_VIRTUAL_DOMAINS = [ 'husyt.com' ]
#add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
add_virtualhost('mail.husyt.com','husyt.com')


重启httpd服务:
[root@xiaoyu ~]# /usr/local/apache2/bin/apachectl restart 

特别提示:
如果需要增加不同的域进行访问,则只需要增加如下内容即可访问
add_virtualhost( "abc.com", "abc.com )
add_virtualhost( "zxc.com", "zxc.com" )
add_virtualhost( "xxx.com", "xxx.com" )

5.启动zimbra服务:

[root@xiaoyu ~]# /etc/init.d/zimbra start


第六部分:创建mailman的默认站点列表:

1.创建mailman的默认站点列表

[root@xiaoyu ~]#  cd /usr/local/mailman/
[root@xiaoyu mailman]# ./bin/newlist mailman mailman@husyt.com
Initial mailman password:      
Hit enter to notify mailman owner...mailman@husyt.com   

[root@xiaoyu mailman]#  bin/config_list -i /usr/local/mailman/data/sitelist.cfg mailman
Non-standard property restored: personalize
[root@xiaoyu mailman]# bin/genaliases 
[root@xiaoyu mailman]# chown  mailman:mailman /usr/local/mailman/data/aliases*
[root@xiaoyu mailman]# chown mailman:mailman /usr/local/mailman/data/virtual-mailman*
[root@xiaoyu mailman]# 
[root@xiaoyu mailman]# cd /usr/local/mailman/
[root@xiaoyu mailman]# bin/config_list -i data/sitelist.cfg mailman
Non-standard property restored: personalize
[root@xiaoyu mailman]# /usr/local/mailman/bin/genaliases
[root@xiaoyu mailman]# /usr/local/mailman/bin/mmsitepass 
New site password: 
Again to confirm password: 
Password changed.

2.修改的属主和属组,必须是mailman(aliases and virtual-mailman must be owned by mailman):

[root@xiaoyu mailman]# chown zimbra:zimbra /usr/local/mailman/data/aliases*
[root@xiaoyu mailman]# chown zimbra:zimbra /usr/local/mailman/data/virtual-mailman*

3.将mailman加入计划任务:

[root@xiaoyu ~]# cd /usr/local/mailman/cron 
[root@xiaoyu cron]# crontab -u mailman crontab.in

[root@xiaoyu cron]# cp /usr/local/mailman/scripts/mailman /etc/init.d/
[root@xiaoyu cron]# chkconfig --add mailman

4.启动mailman服务:

[root@xiaoyu ~]# /etc/init.d/mailman start

5.验证mailman管理界面是否能打开:

访问网址:http://zimbra_ip:8081/mailman/listinfo

zimbra+mailman邮件系统部署_linux_09



如需使用域名访问,则在windows本地的hosts文件中增加如下内容:

192.168.1.10    husyt.com

访问网址:http://husyt.com:8081/mailman/listinfo

zimbra+mailman邮件系统部署_zimbra_10

至此,zimbra+mailman部署完成。