2012-06-10 36 views
0

通過本地主機發送與Python我有以下簡單的代碼,發送電子郵件:電子郵件沒有被Ubuntu上

server = smtplib.SMTP('localhost') 
server.set_debuglevel(1) 
server.sendmail(fromaddr, toaddrs, msg) 
server.quit() 

但是永遠不會被髮送的消息。我添加了「set_debuglevel」行,試圖解決但產量沒有多大的意義對我說:

send: 'ehlo [127.0.1.1]\r\n' 
reply: '250-ubuntu\r\n' 
reply: '250-PIPELINING\r\n' 
reply: '250-SIZE 10240000\r\n' 
reply: '250-VRFY\r\n' 
reply: '250-ETRN\r\n' 
reply: '250-STARTTLS\r\n' 
reply: '250-ENHANCEDSTATUSCODES\r\n' 
reply: '250-8BITMIME\r\n' 
reply: '250 DSN\r\n' 
reply: retcode (250); Msg: ubuntu 
PIPELINING 
SIZE 10240000 
VRFY 
ETRN 
STARTTLS 
ENHANCEDSTATUSCODES 
8BITMIME 
DSN 
send: 'mail FROM:<[email protected]> size=337\r\n' 
reply: '250 2.1.0 Ok\r\n' 
reply: retcode (250); Msg: 2.1.0 Ok 
send: 'rcpt TO:<[email protected]>\r\n' 
reply: '250 2.1.5 Ok\r\n' 
reply: retcode (250); Msg: 2.1.5 Ok 
send: 'data\r\n' 
reply: '354 End data with <CR><LF>.<CR><LF>\r\n' 
reply: retcode (354); Msg: End data with <CR><LF>.<CR><LF> 
data: (354, 'End data with <CR><LF>.<CR><LF>') 
send: 'Hello!\r\n\r\nThe below URLs are either broken or taking too long to respond:\r\nhttp://www.google.com/does-not-exist/\r\nhttp://www.cnn.com/does-not-exist\r\n\r\nLog in and navigate to http://blahblah.com/wp-admin to update the content.\r\n\r\nThanks,\r\n\r\nYour friends at Foo Bar Consulting\r\n.\r\n' 
reply: '250 2.0.0 Ok: queued as E7B8820144\r\n' 
reply: retcode (250); Msg: 2.0.0 Ok: queued as E7B8820144 
data: (250, '2.0.0 Ok: queued as E7B8820144') 
send: 'quit\r\n' 
reply: '221 2.0.0 Bye\r\n' 
reply: retcode (221); Msg: 2.0.0 Bye 

我已經安裝後綴(我相信這是默認安裝時設置我的Ubuntu與標準的LAMP包),但我不知道還有什麼地方可以尋求幫助。

任何洞察力或想法將不勝感激。

回答

0
  1. 你可能想看看sendmail的日誌

  2. 確保您的本地DNS的作品。嘗試ping foobarconsulting.com

+0

我可以從我的Ubuntu服務器ping域。不幸的是,sendmail日誌甚至沒有今天的日期(6月10日),這也沒有多大意義。 – Adam