[操作疑難] Merlin 梅林發送 EMAIL Script 問題

本帖最後由 ~粉腸~ 於 2016-12-20 21:52 編輯



唔知點解用左依句 Script 會收到 EMAIL ,但不能顯示發送者名稱(ex: Your Router),只顯示 > (紅方格)
  1. #!/bin/sh
  2. FROM="[email protected]"
  3. AUTH="[email protected]"
  4. PASS="xxxxxxxxxxxxxxxx"
  5. FROMNAME="Your Router"
  6. TO="[email protected]"

  7. ntpclient -h pool.ntp.org -s &> /dev/null
  8. sleep 5

  9. echo "Subject: WAN state notification" >/tmp/mail.txt
  10. echo "From: \"$FROMNAME\"<$FROM>" >>/tmp/mail.txt
  11. echo "Date: `date -R`" >>/tmp/mail.txt
  12. echo "" >>/tmp/mail.txt
  13. echo "I just got connected to the internet." >>/tmp/mail.txt
  14. echo "" >>/tmp/mail.txt
  15. echo "My WAN IP is: `nvram get wan0_ipaddr`" >>/tmp/mail.txt
  16. echo "Uptime is: `uptime | cut -d ',' -f1 | sed 's/^.\{12\}//g'`" >>/tmp/mail.txt
  17. echo "" >>/tmp/mail.txt
  18. echo "---- " >>/tmp/mail.txt
  19. echo "Your friendly router." >>/tmp/mail.txt
  20. echo "" >>/tmp/mail.txt

  21. cat /tmp/mail.txt | sendmail -H"exec openssl s_client -quiet \
  22. -CAfile /jffs/configs/Equifax_Secure_Certificate_Authority.pem \
  23. -connect smtp.gmail.com:587 -tls1 -starttls smtp" \
  24. -f"$FROM" \
  25. -au"$AUTH" -ap"$PASS" $TO

  26. rm /tmp/mail.txt
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

Your friendly router好友善

TOP

FROMNAME 有無用單英文字試過?

TOP

相關文章