這是本文件的舊版!
工具預設使用的發信軟體
/etc/mail/mailer.conf
發信
echo "This is a test mail." | mail -s "test mail" [email protected]
在 /etc/mail.rc 可以設定 smtp server
set [email protected] smtp=example.com set smtp-auth-user=example smtp-auth-password=password set smtp-auth=login
停用 sendmail
sendmail_enable="NO" sendmail_submit_enable="NO" sendmail_outbound_enable="NO" sendmail_msp_queue_enable="NO"
ssmtp
安裝
pkg install ssmtp cd /usr/ports/mail/ssmtp make replace 或手動編輯 /etc/mail/mailer.conf 將預設的 sendmail 改成 /usr/local/sbin/ssmtp
設定 /usr/local/etc/ssmtp/ssmtp.conf
[email protected] AuthPass=password mailhub=smtp.example.com:587 UseSTARTTLS=YES