2015-10-25 76 views
0

我試圖從我的終端(bash)發送一封電子郵件。我所做的:從Bash發送郵件失敗,沒有錯誤信息

echo "text" | mail -vs "subject" "[email protected]" 

冗餘標誌返回

Mail Delivery Status Report will be mailed to <Me> 

但無論是Mail Delivery Status Report也不電子郵件在我的收件箱接收。 Mail Delivery Status Report似乎保存在文件/var/mail/Me中。以下是我收到的最後一份報告:

--EAB82C90F6D.1445818910/Remis-MacBook-Pro.local 
Content-Description: Delivery report 
Content-Type: message/delivery-status 

Reporting-MTA: dns; Remis-MacBook-Pro.local 
X-Postfix-Queue-ID: EAB82C90F6D 
X-Postfix-Sender: rfc822; [email protected] 
Arrival-Date: Sun, 25 Oct 2015 17:21:49 -0700 (PDT) 

Final-Recipient: rfc822; [email protected] 
Action: delayed 
Status: 4.4.1 
Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to 
    alt2.gmail-smtp-in.l.google.com[173.194.219.26]:25: Connection refused 

--EAB82C90F6D.1445818910/Remis-MacBook-Pro.local 
Content-Description: Message Headers 
Content-Type: text/rfc822-headers 

Return-Path: <[email protected]> 
Received: by Remis-MacBook-Pro.local (Postfix, from userid 501) 
     id EAB82C90F6D; Sun, 25 Oct 2015 17:21:49 -0700 (PDT) 
To: [email protected] 
Message-Id: <[email protected]> 
Date: Sun, 25 Oct 2015 17:21:49 -0700 (PDT) 
From: [email protected] (Remi) 

--EAB82C90F6D.1445818910/Remis-MacBook-Pro.local-- 

問題出在哪裏?


我在Mac OSX薩爾瓦多卡皮塔諾版10.11

回答

0

混合these instructionsthese instructions我說,

relayhost = [smtp.gmail.com]:587 
smtp_sasl_auth_enable = yes 
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd 
smtp_sasl_security_options = noanonymous 
smtp_use_tls = yes 
smtp_sasl_mechanism_filter = plain 

/etc/postfix/main.cf

我還創建/etc/postfix/sasl_passwd並寫下

[smtp.gmail.com]:587 [email protected]:password 

其中。然後我跑

sudo chmod 600 /etc/postfix/sasl_passwd 
sudo postmap /etc/postfix/sasl_passwd 
sudo launchctl stop org.postfix.master 
sudo launchctl start org.postfix.master 

,並改變了我的谷歌帳戶設置,讓「不夠安全的應用」(詳見說明書here)。它的工作!