Exim Multidomain 測試一

建構想法:
1、不影嚮原主機架構
2、快速建置符合需求
3、決定使用rewrite方式

新增一個資料表 multidomain,新增兩欄位 Pridomain & Secdomain。

Pridomain:為主要Domain
Secdomain:為次要Domain 或第三筆、第四筆Domain

修改 Exim configure rewrite 區
######################################################################
# REWRITE CONFIGURATION #
######################################################################

參數如下:
begin rewrite
*@* "${lookup mysql {SELECT pridomain FROM multidomaindb WHERE secdomain='$2'}{$1@$value}fail}" Tbct

其中使用到 Tbct 表示意義如下:
T rewrite the envelope To field
b rewrite the Bcc: header
c rewrite the Cc: header
t rewrite the To: header

參數用意:
將進來的emailaddress,凡有第二筆Domain以上,皆置換為主要Domain後,送往後端主機。

測試結論,rewrite 在acl check之後,所以必須克服此問題。

Posted in 標籤: |

0 意見: