re2d2 发表于 2015-4-13 08:32:40

postfix本机测试本机时,telnet连接出错

正向解析、反向解析都没有问题,postfix默认端口为25
配置postfix的配置文件

1
2
3
4
5
6
7
# cd /etc/postfix/
# vim main.cf
myhostname = www.crwolf.com
myorigin = crwolf.com
mydomain = crwolf.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.1.0/24, 127.0.0.0/8




重启postfix,然后测试

1
2
3
4
5
6
7
8
9
10
11
12
13
# service postfix restart
关闭 postfix:                                             [确定]
启动 postfix:                                             [确定]
# vim /etc/resolv.conf
nameserver 192.168.1.9将DNS解析指向本机
# telnet mail.crwolf.com 25      
Trying 192.168.1.9...
telnet: connect to address 192.168.1.9: Connection refused      #连接拒绝
# telnet localhost 25    #本地为什么可以?
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 www.crwolf.com ESMTP Postfix




检查问题
先查看有没有telnet服务

1
2
3
4
5
6
7
8
9
10
# cd
# rpm -qa telnet
telnet-0.17-48.el6.x86_64            #这个有
# rpm -qa telnet-server      #这个没有
# chkconfig --list
基于 xinetd 的服务:         #xinetd这里也没有telnet
# yum install -y telnet-server      #下载telnet-server
# chkconfig --list
基于 xinetd 的服务:
telnet:      关闭




现在有telnet,但是服务是关闭的,将其打开


1
2
3
4
5
6
7
8
9
10
11
12
# service xinetd restart
停止 xinetd:                                              [确定]
正在启动 xinetd:                                          [确定]
# service telnet start
telnet: 未被识别的服务
# chkconfig telnet on
# chkconfig --list
基于 xinetd 的服务:
telnet:      启用
# telnet mail.crwolf.com 25
Trying 192.168.1.9...
telnet: connect to address 192.168.1.9: Connection refused      #还是拒绝




查看telnet的配置

1
2
# vim /etc/xinetd.d/telnet
      disable = no      #这里是接收的




再看以下postfix的配置文件

1
2
3
4
5
6
7
# vim /etc/postfix/main.cf         #inet_interfaces这里没有$myhostname,添加进去
inet_interfaces = localhost -->inet_interfaces = localhost, $myhostname
# telnet www.crwolf.com 25         #能连接上了
Trying 192.168.1.9...
Connected to www.crwolf.com.
Escape character is '^]'.
220 www.crwolf.com ESMTP Postfix



页: [1]
查看完整版本: postfix本机测试本机时,telnet连接出错