本篇文章更新時間:2019/02/16
如有資訊過時或語誤之處,歡迎使用 Contact 功能通知或向一介資男的 LINE 社群反應。
如果本站內容對你有幫助,歡迎贊助支持


前提與假設

已經有 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
.

注意最後有個"."!

若是收到信就是成功拉~

參考資料:

  1. Set Up Postfix With Mailgun For Reliable E-Mail Delivery
  2. Postfix its installed but how do i test [closed]


Share:

作者: Chun

WordPress 社群貢獻者、開源社群推廣者。專注於 WordPress 外掛開發、網站效能最佳化、伺服器管理,以及 iDempiere 開源 ERP 導入與客製開發。曾參與 WordCamp Taipei 等社群活動,GitHub Arctic Code Vault Contributor。提供資訊顧問、WordPress 開發教學、主機最佳化與企業 ERP 整合服務。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *


文章
Filter
Apply Filters
Mastodon