postfix限定特定用户才能发送到别名的解决方法

建立了staff@ibaihe.com的一个别名
只允许域内root@ibaihe.com才能发送到staff@ibaihe.com这个别名其他用户都不能发到到这个别名
设置方法如下:
1)在main.cf里定义如下的smtpd_restriction_classes:
# senders
smtpd_restriction_classes = local_only
local_only = check_sender_access hash:/etc/postfix/local_domains, reject
2)将main.cf里的smtpd_sender_restrctions定义为:
smtpd_sender_restrictions =
check_recipient_access hash:/etc/postfix/local_recipient
3)vi /etc/postfix/local_recipient:
staff@ibaihe.com    local_only
4)vi /etc/postfix/local_domains:
root@ibaihe.com    OK
5)为3,4的文件建立hash:

postmap hash:/etc/postfix/local_recipient
postmap hash:/etc/postfix/local_domains