In my postfix main.cf I have:
smtpd_recipient_restrictions = reject_unauth_destination, check_recipient_access regexp:/etc/postfix/access.me
...
virtual_alias_maps = hash:/etc/postfix/virtual
...
In my virtual file I have:
a@mydomain.com xxxx@gmail.com
na@mydomain.com xxxx@gmail.com
@mydomain.com xxxx@gmail.com
In my access.me file I have:
/^abc/ OK
/a@mydomain.com/ OK
/na@mydomain.com/ REJECT failed test
/@mydomain.com/ REJECT failed test contact us@mydomain.com
With this I have successfully failed (!) to send to na@mydomain.com so I know access.me is being read correctly by postfix. If I send to xyz@mydomain.com it fails (correctly) rejected by Line 4 of access.me
However if I try to mail abc123@mydomain.com it fails with "User unknown in virtual alias table" which shows that it is accepted by line 1 of access.me, but I need this email to succeed and get through.
So nearly there but I must be misunderstanding postfix logic... Tim