postfix本机测试本机时,telnet连接出错
正向解析、反向解析都没有问题,postfix默认端口为25
配置postfix的配置文件
[root@www:/var/named]#cd/etc/postfix/[root@www:/etc/postfix]#vimmain.cfmyhostname=www.crwolf.commyorigin=crwolf.commydomain=crwolf.commydestination=$myhostname,localhost.$mydomain,localhost,$mydomainmynetworks=192.168.1.0/24,127.0.0.0/8
重启postfix,然后测试
[root@www:/etc/postfix]#servicepostfixrestart关闭postfix:[确定]启动postfix:[确定][root@www:/etc/postfix]#vim/etc/resolv.confnameserver192.168.1.9将DNS解析指向本机[root@www:/etc/postfix]#telnetmail.crwolf.com25Trying192.168.1.9...telnet:connecttoaddress192.168.1.9:Connectionrefused#连接拒绝[root@www:/etc/postfix]#telnetlocalhost25#本地为什么可以?Trying::1...Connectedtolocalhost.Escapecharacteris'^]'.220www.crwolf.comESMTPPostfix
检查问题
先查看有没有telnet服务
[root@www:/etc/postfix]#cd[root@www:~]#rpm-qatelnettelnet-0.17-48.el6.x86_64#这个有[root@www:~]#rpm-qatelnet-server#这个没有[root@www:~]#chkconfig--list基于xinetd的服务:#xinetd这里也没有telnet[root@www:~]#yuminstall-ytelnet-server#下载telnet-server[root@www:~]#chkconfig--list基于xinetd的服务:telnet:关闭
现在有telnet,但是服务是关闭的,将其打开
[root@www:~]#servicexinetdrestart停止xinetd:[确定]正在启动xinetd:[确定][root@www:~]#servicetelnetstarttelnet:未被识别的服务[root@www:~]#chkconfigtelneton[root@www:~]#chkconfig--list基于xinetd的服务:telnet:启用[root@www:~]#telnetmail.crwolf.com25Trying192.168.1.9...telnet:connecttoaddress192.168.1.9:Connectionrefused#还是拒绝
查看telnet的配置
[root@www:~]#vim/etc/xinetd.d/telnetdisable=no#这里是接收的
再看以下postfix的配置文件
[root@www:~]#vim/etc/postfix/main.cf#inet_interfaces这里没有$myhostname,添加进去inet_interfaces=localhost-->inet_interfaces=localhost,$myhostname[root@www:~]#telnetwww.crwolf.com25#能连接上了Trying192.168.1.9...Connectedtowww.crwolf.com.Escapecharacteris'^]'.220www.crwolf.comESMTPPostfix