postfix 自动转发邮件

如果公司有员工离职,但是又担心有发给他的重要邮件,需要对postfix做如下配置
比如[email protected]是要离职的员工,[email protected]是收到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

加入如下内容
[email protected] bb@test.com  //[email protected] 是被监控的人  [email protected]是收邮件的人  ,中间要用tab键隔开

@test.com bb@test.com   ////这样写是监控所有人

3.编辑完后需要执行 postmap:

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

4.将 Postfix reload 后即可生效:
# postfix reload

给接收邮件的邮箱添加白名单,否则会被识别为垃圾邮件。

猜你喜欢

转载自my.oschina.net/u/188924/blog/899391
今日推荐