本篇文章更新時間:2019/02/16
如有資訊過時或語誤之處,歡迎使用 Contact 功能通知。
一介資男的 LINE 社群開站囉!歡迎入群聊聊~
如果本站內容對你有幫助,歡迎使用 BFX Pay 加密貨幣 或 新台幣 贊助支持。
前提與假設
已經有 Domain + MailGun 帳號,再來會使用 ubuntu !
以下操作全程使用root權限
第一步
安裝 postfix
apt-get install postfix
安裝時選用 Internet site
第二步
設定組態
vi /etc/postfix/main.cf
最下面補上
relayhost = smtp.mailgun.org
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:mailaddress [at~]mxp.tw:password
smtp_sasl_security_options = noanonymous
PS: relayhost這個欄位在上面已經有了的話要註解起來,以免啟動出現一堆錯誤訊息
static 的欄位就是填 MailGun信箱:密碼
最後一步
重新啟動服務
service postfix restart
驗證
確認postfix服務狀態是否啟動後
輸入
telnet 127.0.0.1 25
然後輸入下方指令,EMAIL記得改自己的
ehlo localhost
mail from: root@localhost
rcpt to: blahblah[at~]mxp.tw
data
Subject: My first mail on Postfix
Hi,
Are you there?
regards,
Admin
.
注意最後有個"."!
若是收到信就是成功拉~
參考資料:
- Set Up Postfix With Mailgun For Reliable E-Mail Delivery
- Postfix its installed but how do i test [closed]