Cychin Net

a Chin's 生活雜記!

Postfix forward mail to another SMTP gateway

by Alex on 2013 年 04 月 25 日

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

檢視目前郵件的系統,是Postfix mail,經瞭解設定方式後,記錄一下設定方式:

1. 修改main.cf 設定,更改relayhost

# 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

 

發佈留言

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

* Copy This Password *

* Type Or Paste Password Here *