2016年10月25日 星期二

Postfix forward mail to another SMTP gateway


舊文章整理張貼 -

今天剛好有機會可以測試一個Mail gateway的產品,於是很快就把設備安裝並設定好,此時需要將原有的mail server的外寄信件都轉送到這台Mail gateway上

檢視目前郵件的系統,是Postfix mail,經瞭解設定方式後,記錄一下設定方式:
1. 修改main.cf 設定,更改relayhos

# vi /etc/postfix/main.cf

修改relayhost 值

relayhost = mail gateway IP  --> 修改後存檔離開
2. 重新啓動postfix 服務,即可完成

# service postfix restart

另外補充一下,如果要將所有信件都導送到其他的Mail Server主機或Gateway,設定如下:
1. 修改main.cf 設定,增加一筆transport的設定

#vi /etc/postfix/main.cf
在最後面增加一筆設定
transport_maps = hash:/etc/postfix/transport  --> 完成後存檔離開
2. 設定transport內容

#vi /etc/postfix/transport
在最後面增加一筆設定
* smtp:[mail gateway IP]  --> 存檔後離開
3. 重新postfix

# postmap /etc/postfix/transport
# service postfix restart

沒有留言:

張貼留言