本文是针对postfix的配置文件做的修改,主要目的是实现,aa@ask.com账户给all@ask.com(所有人的组)发送邮件,而其他的人不能发送邮件的解决方案。

严格控制别名使用权限:(以下步骤都是在/etc/postfix/目录下做的)

1.   vim main.cf
smtpd_sender_restrictions =
             permit_mynetworks,
             reject_sender_login_mismatch,
             reject_authenticated_sender_login_mismatch,
             reject_unauthenticated_sender_login_misatch,
             check_recipient_access hash:/etc/postfix/local_recipient                             #添加检测条
smtpd_restriction_classes = allow_to_all                                                                 #定义发送目标列表
allow_to_all = check_sender_access hash:/etc/postfix/local_sender_all, reject         #定义规则

 
 

2.  vim local_recipient
all@ask.com                   allow_to_all                                                                     #定义具体检测条件

3.
vim local_sender_all                                                                                               #定义具体的规则
aa@ask.com  ok

 
 

4.

postmap hash:/etc/postfix/local_sender_all                                                             #生成hash文件
postmap hash:/etc/postfix/local_recipient                                                               #生成hash文件

 
 

5.
service postfix reload
剩下的就开始测试吧……