移至主內容
DarkRanger's Secret Area

主導覽

  • 首頁
  • 關於本站
  • Linux
  • 程式開發
  • N900
  • 譯文
  • 資訊技術辭典

文章分類

  • 影劇
  • 遊戲
  • 筆記
  • 雜文
  • 資訊技術
  • 站務訊息

最新內容

  • How-To:Linux 安裝 DevilutionX
  • 於 2012 年建立的一份音樂播放清單
  • How-To:Linux 安裝 Medal of Honor: Allied Assault
  • Fallout 4 (2015)
  • How-To:Linux 安裝 Blood
  • 《終極動員令》系列早期作品原始碼釋出
  • How-To:Linux 安裝 Doom 3
  • Nausicaä of the Valley of the Wind (1984)
  • Intel 內顯與 Linux 桌面死當問題排解
  • 《哥吉拉 -1.0》心得補遺

Postfix 使用 hiBox 寄信

發表日期:星期五, 07/12/2013 - 20:17,更新日期:星期五, 07/12/2013 - 21:25

hiBox 是中華電信針對企業用戶的郵件服務,也是 DR 所在的公司目前使用的郵件服務。由於最近 DR 要試驗一些網站服務,其中會涉及對外寄信的功能,因此 DR 想到如果能設定 Postfix 利用 hiBox 來寄信,如此一來就會省事很多。

 

於是 DR 主要參考了自己好些年前寫的 Postfix 使用 Gmail SMTP 轉寄這篇文章(內容陳舊,有興趣閱讀的人切勿照單全收),不過也發現用 hiBox 寄信所需的設定內容事實上是單純很多,本文接下來的內容便是在 CentOS 6.4 上的設定流程。

 

首先建立 /etc/postfix/sasl_passwd,並在裡頭寫入一個有效的 hiBox 郵件帳號、網域及密碼,按照下列格式:

www.hibox.hinet.net username@domain.com:password

 

然後執行 postmap 建立資料庫:

  • postmap hash:/etc/postfix/sasl_passwd

 

接著編輯 /etc/postfix/main.cf,寫入以下內容:

myorigin = domain.com

relayhost=[www.hibox.hinet.net]

smtp_sasl_auth_enable=yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

smtp_sasl_security_options = noanonymous

 

myorigin 參數要確實填寫申辦 hiBox 所用的網域名稱,否則會直接被 hiBox 拒絕。儲存設定後,重新啟動 Postfix,用 mail 指令寄封測試信,再檢查 maillog 確認被 hiBox 接受就完成了。

 

SELinux 部份,要使用網頁寄信記得要開放相關權限:

  • setsebool -P httpd_can_sendmail=1

 

 

筆記