# postfix

邮件服务器 25

邮件服务器:DNS提供邮箱域名解析——》postfix提供邮件服务

邮件服务器(192.168.88.25):
[root@email ~]# getenforce 
	Disabled
[root@email ~]# rpm -q firewalld
	package firewalld is not installed

# named.service(53)
[root@email ~]# yum install -y bind bind-chroot
[root@email ~]# cat -n /etc/named.conf
     1  // named.conf
     2  // See /usr/share/doc/bind*/sample/ for example named configuration files.
     3
     4  options {
     5          directory       "/var/named";
     6  };
     7
     8  zone "example.com" IN {
     9          type master;
    10          file "example.com.zone";
    11  };
[root@email ~]# ll /var/named/named.localhost		# 注意:用户named必须对地址库文件有r权限
	-rw-r----- 1 root named 194 116 23:27 /var/named/named.localhost	
[root@email ~]# cp -a /var/named/{named.localhost,example.com.zone}
[root@email ~]# cat /var/named/example.com.zone 
     1  $TTL 1D
     2  @       IN SOA  @ rname.invalid. (
     3                                          0       ; serial
     4                                          1D      ; refresh
     5                                          1H      ; retry
     6                                          1W      ; expire
     7                                          3H )    ; minimum
     8          NS      server
     9          MX  10  mail
    10  server  A       192.168.88.25
    11  mail    A       192.168.88.25
[root@email ~]# systemctl enable named.service --now
[root@email ~]# ss -ntulp | grep :53			# 返回DNS服务

# 测试
[root@client ~]# echo 'nameserver 192.168.88.25' > /etc/resolv.conf
[root@client ~]# yum install -y bind-utils
[root@client ~]# nslookup mail.example.com
    Server:         192.168.88.25
    Address:        192.168.88.25#53

    Name:   mail.example.com
    Address: 192.168.88.25

[root@client ~]# host example.com
	example.com mail is handled by 10 mail.example.com.
[root@client ~]# host mail.example.com
	mail.example.com has address 192.168.88.25

# postfix.service(25)
[root@email ~]# yum install -y postfix
	117 #myorigin = $myhostname
	118 myorigin = example.com					# 为邮箱后缀example.com的发件人提供邮件服务。本机使用邮件服务时,省略邮件域名后缀默认为example.com
    132 inet_interfaces = all					# 允许所有人使用本服务
    133 #inet_interfaces = $myhostname
    134 #inet_interfaces = $myhostname, localhost
    135 #inet_interfaces = localhost
	183 mydestination = example.com				# 为邮箱后缀example.com的收件人提供邮件服务
[root@email ~]# systemctl enable postfix.service --now
[root@email ~]# ss -ntulp | grep :25
    tcp   LISTEN 0      100           0.0.0.0:25        0.0.0.0:*    users:(("master",pid=4523,fd=16))
    tcp   LISTEN 0      100              [::]:25           [::]:*    users:(("master",pid=4523,fd=17))

end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值