参考:https://blog.csdn.net/linuxnews/article/details/51106905

环境配置:

本机ip:192.168.1.41
设置主机名

hostnamectl set-hostname mail.jlkj.com

添加hosts

echo "192.168.1.41  mail.jlkj.com" >> /etc/hosts

关闭防火墙:

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
setenforce 0
systemctl stop iptables
systemctl disable iptables
systemctl stop firewalld
systemctl disable firewalld

关闭其他邮件服务

systemctl stop postfix.service
systemctl disable postfix.service

安装依赖:

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

设置本地dns:

配置dns服务器
1.安装bind

yum -y install bind bind-utils

2.修改主配置文件
vim /etc/named.conf
添加下面的配置:

zone "jlkj.com" IN {
        type master;
        file "jlkj.com";
        allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "192.168.1.arpa";
        allow-update { none; };
};

2.配置区域配置文件
vim /var/named/jlkj.com

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

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.jlkj.com.
109     PTR     ns.jlkj.com.
109     PTR     mail.jlkj.com.

3.重启bind

systemctl restart named.service

4.使用本地dns服务器

# [root@mail named]# cat /etc/resolv.conf
# Generated by NetworkManager
search jlkj.com
nameserver 127.0.0.1
nameserver 192.168.1.1
nameserver 114.114.114.114

测试MX解析:

[root@mail ~]# nslookup -qt=mx mail.jlkj.com
*** Invalid option: qt=mx
Server:		127.0.0.1
Address:	127.0.0.1#53

Name:	mail.jlkj.com
Address: 192.168.1.41

现在就是正常的了

安装zimbrta

 wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
tar -zxvf zcs-8.6.0_GA_1153.RHEL7_64.20141215151110
 mv zcs-8.6.0_GA_1153.RHEL7_64.20141215151110 zimbra
cd zimbrta
#开启一键傻瓜式的安装
./install.sh --platform-override
# su - zimbra        //切换到zimbra用户
# zmcontrol start    //启动zimbra

# zmcontrol status   //查看启动状态
# zmcontrol stop     //停止zimbra

其中的确定与选项步骤请参考:https://blog.csdn.net/linuxnews/article/details/51106905 安装zimbra就行了

安装完毕后:

管理服务端:https://192.168.1.41:7071
客户端;https://192.168.1.41
此时内网能手能发,外网能发不能收,要求外网能发能收需要一个公网。并且在dns厂家那里配置MX记录

foxmail配置:

这里写图片描述

Logo

更多推荐