如果我尝试:
telnet localhost 143
我可以访问imap
如果我尝试
telnet server.name 143
我明白了
telnet: Unable to connect to remote host: Connection timed out
查看我的 netstat 的输出。
netstat --numeric-ports -l | grep 143
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN
tcp6 0 0 :::143 :::* LISTEN
上面的输出是什么意思?
我无能为力,无法让 imap 远程工作,与服务器上的 webmail 完美配合。
我正在从笔记本电脑终端远程访问服务器,并在本地进行本地主机连接
最佳答案
你引用的输出:
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN
tcp6 0 0 :::143 :::* LISTEN
表示您有一个程序(大概是您的 imap 服务器)通过 tcp(在 IPv4 和 IPv6 上)监听端口 143。而“0.0.0.0”部分意味着它应该接受来自任何来源的连接。 (如果本地地址为“127.0.0.1:143”,则意味着只接受本地连接。)
因此,由于看起来您的服务器正在正确监听,我会首先检查 server.name 是否实际解析为正确的 IP 地址。您能否联系该服务器上的任何其他服务以确保该部分正常工作?
假设这行得通,那么接下来我要检查的就是您的防火墙。你可能会看看 http://www.cyberciti.biz/faq/howto-display-linux-iptables-loaded-rules/但你可以从运行开始:
sudo iptables -L -v
在我没有防火墙规则的机器上,我得到了这个:
$ sudo iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
如果您得到的结果大不相同,我会仔细查看是否阻碍了您的流量。
关于linux - 无法远程通过telnet连接到imap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11817167/