前言
phabricator 配置email 其實很簡單,配好smtp 服務器、端口、協議、用戶名和登陸密碼,但過程卻好麻煩。
開始時跟着官網配 sendmail ,又 google 又 baidu,折騰了1天還是不行。快要放棄時,換了成 SMTP,竟然成功了,真是踏破鐵鞋無覓處...
配置
1. 配置mail-adapter
管理員身份登陸 phabricator 后台:進入 config -> mail -> metamta.mail-adapter 選擇 PhabricatorMailImplementationPHPMailerAdapter 【如圖】
2. 配置 phpmailer
這個只能再服務器后端用命令配置了,進入 phabricator 所在的目錄
運行一下命令
bin/config set phpmailer.mailer smtp
bin/config set phpmailer.smtp-host smtp.163.com -- 和下面的 smtp-user 一致的服務器,我只試過 163的
bin/config set phpmailer.smtp-port 465 -- 確保 465端口未被防火牆 block,如果不行也可試下用 25 端口
bin/config set phpmailer.smtp-protocol SSL
bin/config set phpmailer.smtp-user your@163.com -- 你的賬號
bin/config set phpmailer.smtp-password auto password -- 注意這不是登陸163的密碼,而是在163郵箱設置開通 POP3/SMTP 時設置的授權碼
不需要重啟 phd 就起效的
可通過下面命令查看配置的值
cat conf/local/local.json
查看郵件發送狀態
bin/mail list-outbound
查看某個郵件發送詳情
bin/mail show-outbound --id 25
--id 25 是指查看 id 未 25 的郵件發送詳情,可以查看發送失敗的原因