mail

差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
mail [2016/10/21 21:07] jzmail [2016/10/23 00:10] (目前版本) jz
行 1: 行 1:
-====== mail ======+以下操作是在 FreeBSD 
 + 
 +===== mail =====
  
 工具預設使用的發信軟體 工具預設使用的發信軟體
行 10: 行 12:
 echo "This is a test mail." | mail -s "test mail" [email protected] echo "This is a test mail." | mail -s "test mail" [email protected]
 </code> </code>
 +
 +如果主機不想架設 mail server,而是使用別的 SMTP 伺服器,可以停用預設的 sendmail,改為使用 ssmtp。
  
 ===== 停用 sendmail ===== ===== 停用 sendmail =====
行 20: 行 24:
 </code> </code>
  
-==== ssmtp ====+===== ssmtp =====
  
 安裝 安裝
行 27: 行 31:
 cd /usr/ports/mail/ssmtp cd /usr/ports/mail/ssmtp
 make replace make replace
-或手動編輯 /etc/mail/mailer.conf 將預設的 sendmail 改成/usr/local/sbin/ssmtp+或手動編輯 /etc/mail/mailer.conf 將預設的 sendmail 改成 /usr/local/sbin/ssmtp
 </code> </code>
  
行 34: 行 38:
  
 <code> <code>
-AuthUser=user.name@gmail.com+AuthUser=example@example.com
 AuthPass=password AuthPass=password
-FromLineOverride=YES +mailhub=smtp.example.com:587
-mailhub=smtp.gmail.com:587+
 UseSTARTTLS=YES UseSTARTTLS=YES
 +UseTLS=Yes
 +FromLineOverride=YES
 +rewriteDomain=example.com
 </code> </code>
 +
 +別名設定 /usr/local/etc/ssmtp/revaliases
 +<code>
 +root:[email protected]:smtp.example.com:587
 +</code>
 +
 +若不使用 ssmtp 也可以更改 /etc/mail.rc,
 +缺點是所有使用者會使用同樣的地址。
 +<code>
 +set [email protected] smtp=example.com
 +set smtp-auth-user=example smtp-auth-password=password
 +set smtp-auth=login
 +</code>
 +
 +除了 ssmtp 也可以用 msmtp
 +
 +
 +參考
 +  * https://fourdollars.blogspot.tw/2009/08/ssmtp-gmail.html
 +  * https://www.freebsd.org/doc/handbook/mail-changingmta.html#mail-disable-sendmail
 +  * https://wiki.freebsd.org/SecureSSMTP
 +  * http://linuxpitstop.com/install-ssmtp-to-send-emails-to-gmail-and-office3655/
 +  * https://wiki.archlinux.org/index.php/SSMTP
 +  * http://lang.idv.tw/doku.php/os/linux/%E5%AF%84mail
 +  * https://www.freebsd.org/cgi/man.cgi?query=msmtp&apropos=0&sektion=0&manpath=FreeBSD+6.4-RELEASE+and+Ports&format=html
 +  * https://wiki.archlinux.org/index.php/mutt
 +  * http://tecadmin.net/ways-to-send-email-from-linux-command-line/
  • mail.1477055241.txt.gz
  • 上一次變更: 2016/10/21 21:07
  • jz