main.conf中新建限制類
smtpd_restriction_classes= send_to_all, send_to_rdp
send_to_all =check_sender_access hash:/etc/postfix/npc/local_sender_all,reject
send_to_rdp =check_sender_access hash:/etc/postfix/npc/local_sender_rdp,reject
smtpd_recipient_restrictions= check_sender_accesshash:/etc/postfix/npc/local_sender_all,
check_sender_accesshash:/etc/postfix/npc/local_sender_rdp,
check_recipient_access hash:/etc/postfix/npc/local_recipients,
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
reject_unauth_destination
# vim local_recipients
[email protected] send_to_all
rd_dept@test.com send_to_rdp
注:訪問限制中是逐條匹配訪問列表的,匹配成功就退出
#vim local_sender_all
#vimlocal_sender_rdp
postmaphash:/etc/postfix/npc/local_recipients
postmaphash:/etc/postfix/npc/local_sender_all
postmaphash:/etc/postfix/npc/local_sender_rdp
postfixreload