本地主机 25 上的连接被拒绝(apache James)

本地主机 25 上的连接被拒绝(apache James)

我正在看类似问题,但我所掌握的信息是,这可能是操作系统的问题,而不是 James 的问题:

thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ bin/james start
Starting Apache James Server App...
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ telnet 127.0.0.1 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ cat log/james-server.log 
INFO  02:23:21,406 | org.apache.james.container.spring.context.JamesServerApplicationContext | Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext@3ee0b7: startup date [Wed Aug 15 02:23:21 PDT 2012]; root of context hierarchy
INFO  03:33:22,785 | org.apache.james.container.spring.context.JamesServerApplicationContext | Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext@13336f: startup date [Wed Aug 15 03:33:22 PDT 2012]; root of context hierarchy
INFO  11:26:26,082 | org.apache.james.container.spring.context.JamesServerApplicationContext | Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext@3ee0b7: startup date [Wed Aug 15 11:26:26 PDT 2012]; root of context hierarchy
INFO  11:40:31,812 | org.apache.james.container.spring.context.JamesServerApplicationContext | Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext@d51c6c: startup date [Wed Aug 15 11:40:31 PDT 2012]; root of context hierarchy
INFO  13:00:10,698 | org.apache.james.container.spring.context.JamesServerApplicationContext | Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext@3ee0b7: startup date [Wed Aug 15 13:00:10 PDT 2012]; root of context hierarchy
INFO  13:59:51,478 | org.apache.james.container.spring.context.JamesServerApplicationContext | Refreshing org.apache.james.container.spring.context.JamesServerApplicationContext@13d1929: startup date [Wed Aug 15 13:59:51 PDT 2012]; root of context hierarchy
thufir@dur:~/apache-james-3.0-beta4$ 

快速开始指定:

Step 7: Test
############

$ telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 172.16.1.131 SMTP Server (JAMES SMTP Server 3.0-beta4) ready Sat, 6 Nov 2010 17:31:33 +0100 (CET)
ehlo test

但是,它没有在 netstat 中显示:

thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ bin/james start
Starting Apache James Server App...
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ netstat -l --numeric-ports | grep james
thufir@dur:~/apache-james-3.0-beta4$ 

所以,宾果,我认为这就是关键。如果它确实在运行,为什么 James 没有在 netstat 中显示?

答案1

你确定这不是配置错误吗?例如,你确定它在端口 25 上运行吗?我编写的服务器也遇到过类似的问题,我试图在端口 7980 上进行 telnet,而我要求它绑定到端口 7908。

如果我处于您的位置,我会自己运行的第一个诊断程序是 netstat,以确保服务器确实在侦听该端口。Netstat似乎正是这项工作的工具。 您可以在命令行中尝试类似这样的操作:netstat -l --numeric-ports | grep james,看看您能从中得到什么。 如果您不是命令行迷,您可以使用应用程序Network tools,转到Netstat,然后从项目符号列表中激活选择Display: Active Network Services.

如果它确实在该端口上运行,我接下来会想到防火墙或其他东西。您是否尝试过从同一网络上的另一台主机访问服务器?

[编辑]:快速浏览一下快速开始指南建议,为了能够正确运行 James,您需要在 Linux 上安装 libc6 !! - sudo apt-get install libc6-i386 libc6-dev-i386。如果您已确保安装了 libgc6,并且已正确添加了域和用户,尽管它似乎仍然不起作用,但您可能需要检查配置文件。特别令人感兴趣的似乎是以下内容:smtpsever.conf,,pop3server.conf也许还有database.propertiesjmx.properties。请注意,在编辑这些文件时应小心。我建议您寻找有关服务器未正确绑定到地址的原因的提示。我事先不知道文件的内容,所以我无法就编辑提出建议。

注意:如果其他方法都失败了,您可能需要尝试通过 java cli 使用 james:

usage: java org.apache.james.cli.ServerCmd --host <arg> <command>
    -h,--host </arg>   node hostname or ip address
    -p,--port </arg>   remote jmx agent port number

相关内容