2010-08-07 114 views
0

我正在亚马逊的EC2上设置我的Web服务器。我的网站曾经在本地运行,并使用我的ISP的SMTP服务器发送电子邮件,但之前没有问题 - 但现在电子邮件是从我的ISP外部发出的,因此不会接受它们。emailrelay“无法绑定侦听端口”

因此,我试图the advice here使用EmailRelay转发电子邮件,通过我在Google上的帐户添加身份验证。

我已经按照说明操作,创建emailrelay.auth文件,运行配置,使,使安装,但是当我尝试启动emailrelay服务我得到这个错误:

$ emailrelay --as-proxy smtp.gmail.com:587 --client-tls --client-auth /etc/emailrelay.auth 
emailrelay: error: cannot bind the listening port: 0.0.0.0:25 
emailrelay: exception: cannot bind the listening port: 0.0.0.0:25 

我浏览了user guide,尝试使用--interface选项,认为这可能是问题 - 提供各种IP,没有喜悦 - 我不知道接下来要尝试什么。

(我的服务器运行的Oracle Enterprise Linux 5.1)

编辑:

由于sendmail正在端口25上运行,我已经试过了不同的端口。现在,我得到一个新的错误:

$ emailrelay --as-proxy smtp.gmail.com:587 --client-tls --client-auth /etc/emailrelay.auth --port 8025 
emailrelay: error: cannot do tls/ssl: openssl not built in 
emailrelay: exception: cannot do tls/ssl: openssl not built in 

杀害的sendmail后,我重新尝试端口25和我得到同样的错误(“不能做TLS/SSL:OpenSSL的未建”)。

编辑:

看起来像OpenSSL是没有安装:

$ grep ssl config.log 
    $ ./configure --with-openssl 
configure:7373: checking for openssl 
conftest.cpp:31:25: error: openssl/ssl.h: No such file or directory 
| #include <openssl/ssl.h> 
configure:7431: WARNING: ignoring --with-openssl, check config.log and try setting CFLAGS 
config.status:719: creating src/gssl/Makefile 
+0

我在serverfault上创建了一个新问题来继续此操作... http://serverfault.com/questions/168780/send-emails-from-linux-via-google-smtp – 2010-08-10 07:09:00

回答

1

错误意味着它不能获得对25端口的独占访问(用于SMTP的默认端口)。这是因为它已被使用,或者因为作为非特权用户,您无权访问小于1024的端口。

可能已经有一个程序在端口25上运行。可能是sendmail,但可能是postfix或qmail(我不知道Oracle用于邮件的东西)。你需要关闭任何这样的程序。

如果您关闭了计算机上的任何电子邮件软件并以超级用户身份运行emailrelay,则您可能不会收到该错误消息。

+0

谢谢,我遵循了建议在http:// aplawrence。COM/SCOFAQ/FAQ_scotec4lsof.html并获得: $ lsof的-i:25 COMMAND PID USER FD型器件尺寸节点名称 sendmail的1377根的4U的IPv4 3863 TCP的localhost.localdomain:SMTP(LISTEN) 所以它看起来像sendmail正在运行。 – 2010-08-08 05:58:49

+0

我接受了这个,因为它回答了我的原始问题。我现在提出了另一个关于serverfault的问题,希望能让我走到终点:) – 2010-08-10 07:10:56

0

我在运行Ubuntu的EC2实例上遇到了同样的问题。

对于Ubuntu的

  1. 第一sudo apt-get install libssl-dev
  2. 然后(重新)运行./configure && make && sudo make install

现在或者使用:25如果清楚,或喂养的其他端口进行emailrelay --port 12345它作为预期。