postfix 自動轉發郵件

若是公司有員工離職,可是又擔憂有發給他的重要郵件,須要對postfix作以下配置
好比aa@test.com是要離職的員工,bb@test.com是收到aa 郵件的人

1.編輯主配置文件,加入以下內容
 vi /etc/postfix/main.cf

recipient_bcc_maps = hash:/etc/postfix/recipient_bcc_maps //收郵件
sender_bcc_maps = hash:/etc/postfix/sender_bcc_maps //發郵件
# always_bcc //監控全部用戶,全部用戶的郵件都會轉發到bb的郵箱

2.編輯recipient_bcc_maps
# vi /etc/postfix/recipient_bcc_maps
# vi /etc/postfix/sender_bcc_maps

加入以下內容
aa@test.com bb@test.com  //aa@test.com 是被監控的人  bb@test.com是收郵件的人  ,中間要用tab鍵隔開post

@test.com bb@test.com   ////這樣寫是監控全部人

3.編輯完後須要執行 postmap:spa

 # postmap hash:/etc/postfix/sender_bcc_maps
 # postmap hash:/etc/postfix/recipient_bcc_maps

4.將 Postfix reload 後便可生效:
# postfix reload

 

給接收郵件的郵箱添加白名單,不然會被識別爲垃圾郵件。ip

相關文章
相關標籤/搜索