差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| mail [2016/10/21 21:07] – jz | mail [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] | ||
| </ | </ | ||
| + | |||
| + | 如果主機不想架設 mail server,而是使用別的 SMTP 伺服器,可以停用預設的 sendmail,改為使用 ssmtp。 | ||
| ===== 停用 sendmail ===== | ===== 停用 sendmail ===== | ||
| 行 20: | 行 24: | ||
| </ | </ | ||
| - | ==== ssmtp ==== | + | ===== ssmtp ===== |
| 安裝 | 安裝 | ||
| 行 27: | 行 31: | ||
| cd / | cd / | ||
| make replace | make replace | ||
| - | 或手動編輯 / | + | 或手動編輯 / |
| </ | </ | ||
| 行 34: | 行 38: | ||
| < | < | ||
| - | 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 | ||
| </ | </ | ||
| + | |||
| + | 別名設定 / | ||
| + | < | ||
| + | root: | ||
| + | </ | ||
| + | |||
| + | 若不使用 ssmtp 也可以更改 / | ||
| + | 缺點是所有使用者會使用同樣的地址。 | ||
| + | < | ||
| + | set [email protected] smtp=example.com | ||
| + | set smtp-auth-user=example smtp-auth-password=password | ||
| + | set smtp-auth=login | ||
| + | </ | ||
| + | |||
| + | 除了 ssmtp 也可以用 msmtp | ||
| + | |||
| + | |||
| + | 參考 | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||