2010-08-07 142 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它作爲預期。