I want to configure postfix to only send mail to addresses in a whitelist. I have tried to use
main.cf like so:
smtpd_recipient_restrictions = reject_unauth_destination check_recipient_access hash:/path/to/whitelist
The whitelist file is of the format
email@example.com OK firstname.lastname@example.org OK
And then translated into a hash with the
Still, the relay is sending mail to non-whitelisted addresses. What am I missing?
Edit: I am sending this mail via the
sendmail command, which apparently bypasses the smptd restrictions. Is there a way to deal with this?
Edit 2/The rest of the story: I spent quite a bit of time trying to make sendmail send via SMTP only to discover the command I was using was not sendmail, but postfix's sendmail compatibility interface which mimics functionality but can't be told to use SMTP as far as I could tell.
84104's solution worked perfectly though.