postfix本機測試本機時,telnet連接出錯

正向解析、反向解析都沒有問題,postfix默認端口爲25

配置postfix的配置文件

[root@www:/var/named]# cd /etc/postfix/
[root@www:/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,然後測試

[root@www:/etc/postfix]# service postfix restart
關閉 postfix:                                             [確定]
啓動 postfix:                                             [確定]
[root@www:/etc/postfix]# vim /etc/resolv.conf 
nameserver 192.168.1.9將DNS解析指向本機
[root@www:/etc/postfix]# telnet mail.crwolf.com 25        
Trying 192.168.1.9...
telnet: connect to address 192.168.1.9: Connection refused        #連接拒絕
[root@www:/etc/postfix]# telnet localhost 25    #本地爲什麼可以?
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 www.crwolf.com ESMTP Postfix

檢查問題

先查看有沒有telnet服務

[root@www:/etc/postfix]# cd
[root@www:~]# rpm -qa telnet
telnet-0.17-48.el6.x86_64            #這個有
[root@www:~]# rpm -qa telnet-server        #這個沒有
[root@www:~]# chkconfig --list
基於 xinetd 的服務:           #xinetd這裏也沒有telnet
[root@www:~]# yum install -y telnet-server        #下載telnet-server
[root@www:~]# chkconfig --list
基於 xinetd 的服務:
telnet:        關閉

現在有telnet,但是服務是關閉的,將其打開

[root@www:~]# service xinetd restart
停止 xinetd:                                              [確定]
正在啓動 xinetd:                                          [確定]
[root@www:~]# service telnet start
telnet: 未被識別的服務
[root@www:~]# chkconfig telnet on
[root@www:~]# chkconfig --list
基於 xinetd 的服務:
telnet:        啓用
[root@www:~]# telnet mail.crwolf.com 25
Trying 192.168.1.9...
telnet: connect to address 192.168.1.9: Connection refused        #還是拒絕

查看telnet的配置

[root@www:~]# vim /etc/xinetd.d/telnet 
        disable = no        #這裏是接收的

再看以下postfix的配置文件

[root@www:~]# vim /etc/postfix/main.cf         #inet_interfaces這裏沒有$myhostname,添加進去
inet_interfaces = localhost -->  inet_interfaces = localhost, $myhostname
[root@www:~]# telnet www.crwolf.com 25         #能連接上了
Trying 192.168.1.9...
Connected to www.crwolf.com.
Escape character is '^]'.
220 www.crwolf.com ESMTP Postfix



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章