2011-01-25 37 views
17

我什麼都試過,我讀在線測試和我不能讓電子郵件出去後綴的安裝,但如何測試

telnet <IP> 25 
EHLO 
MAIL FROM: <from-email> 
RCPT TO: <recipient-email> 
DATA 
Type message here. 
. <Enter> 
=> 

我甚至嘗試這樣做,當我鍵入期間,我得到什麼? ..但後綴安裝

回答

13

(我剛剛得到這個工作,我的主要問題是,我沒有一個真正的互聯網主機名,在這樣的情況下回答這個問題,它可以幫助別人)

您需要用HELO指定一個主機名。即使如此,你應該得到一個錯誤,所以Postfix可能沒有運行。

另外,=>不是命令。 '。'在沒有任何文本的單行上,告訴Postfix該條目已完成。下面是我使用的條目:

telnet localhost 25 
(says connected) 
EHLO howdy.com 
(returns a bunch of 250 codes) 
MAIL FROM: [email protected] 
RCPT TO: (use a real email address you want to send to) 
DATA (type whatever you want on muliple lines) 
. (this on a single line tells Postfix that the DATA is complete) 

你應該得到這樣的迴應:

250 2.0.0確定:排隊的6E414C4643A

的電子郵件可能會在一個垃圾文件夾結束。如果沒有顯示,那麼您可能需要設置'Postfix on hosts without a real Internet hostname'。下面是我如何完成我的Ubuntu框步細分:

sudo vim /etc/postfix/main.cf 
smtp_generic_maps = hash:/etc/postfix/generic (add this line somewhere) 
(edit or create the file 'generic' if it doesn't exist) 
sudo vim /etc/postfix/generic 
(add these lines, I don't think it matters what names you use, at least to test) 
[email protected]    [email protected] 
[email protected]    [email protected] 
@localdomain.local    [email protected] 
then run: 
postmap /etc/postfix/generic (this needs to be run whenever you change the 
generic file) 

快樂創新

46

要檢查後綴是否正在運行或不

sudo postfix status 

如果它沒有運行,啓動它。

sudo postfix start 

然後遠程登錄到本地主機端口25來測試電子郵件ID

ehlo localhost 
mail from: [email protected] 
rcpt to: your_email_id 
data 
Subject: My first mail on Postfix 

Hi, 
Are you there? 
regards, 
Admin 
. 

不要忘記。在末尾,表示行結束

+0

@PJBrunet是的,您仍然可以使用狀態命令檢查後綴的狀態,如在答案中給出的 – 2017-02-12 09:15:56