emailrelay“无法绑定监听端口”

发布于 2024-09-12 23:30:41 字数 1686 浏览 8 评论 0原文

我正在 Amazon 的 EC2 上设置我的 Web 服务器。我的网站过去在本地运行并使用我的 ISP 的 SMTP 服务器发送电子邮件,这以前不是问题 - 但现在电子邮件来自外部,我的 ISP 不会接受它们。

因此,我正在尝试 此处的建议通过我在 Google 上的帐户使用 EmailRelay 转发电子邮件并添加身份验证。

我已按照说明操作,创建了 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

我查看了 用户指南,尝试使用 --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

I'm setting up my web server on Amazon's EC2. My site used to run locally and used my ISP's SMTP server to send email, which hasn't been a problem before - but now that the emails are originating from outside my ISP won't accept them.

Therefore, I'm trying the advice here to use EmailRelay to forward emails, adding authentication, via my account on Google.

I've followed the instructions, created the emailrelay.auth file, run the configure, make, make install, but when I try to start the emailrelay service I'm getting this error:

$ 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

I've looked through the user guide, tried using the --interface option thinking this might be the issue - providing various IPs, with no joy - and I don't know what to try next.

(my server is running Oracle Enterprise Linux 5.1)

EDIT:

Since sendmail is running on port 25, I've tried an alternative port. Now I get a new error:

$ 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

After killing sendmail, I've retried with port 25 and I get the same error ("cannot do tls/ssl: openssl not built in").

EDIT:

Looks like openssl is not installed:

$ 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柳絮泡泡 2024-09-19 23:30:41

该错误意味着它无法获得对端口 25(SMTP 的默认端口)的独占访问。这要么是因为它已在使用中,要么是因为作为非特权用户,您无权访问编号小于 1024 的端口。

可能已经有一个程序在端口 25 上运行。可能是 sendmail,但也可能是 postfix 或 qmail (我不知道Oracle用什么来发送邮件)。您需要关闭任何此类程序。

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

The error means that it can't gain exclusive access to port 25 (the default port for SMTP). This is either because it is already in use, or because, as an unprivileged user, you don't have access to ports numbered less than 1024.

There may already be a program running on port 25. Probably sendmail, but possibly postfix or qmail (I don't know what Oracle uses for mail). You will need to shut any such program down.

If you shut down any email software on the computer and run emailrelay as root, you will probably not get that error message.

找个人就嫁了吧 2024-09-19 23:30:41

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

对于 Ubuntu

  1. 首先 sudo apt-get install libssl-dev
  2. 然后(重新)运行 ./configure &&制作&& sudo make install

现在,如果清除的话,可以使用 :25 ,或者将另一个端口提供给 emailrelay --port 12345 ,它可以按预期工作。

I got to this question having the same issue on an EC2 instance running Ubuntu.

For Ubuntu:

  1. first sudo apt-get install libssl-dev
  2. then (re-)run ./configure && make && sudo make install

Now either using :25 if clear, or feeding another port to emailrelay --port 12345 it works as expected.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文