Allow certain users to only send emails to specific domains

Solution 1:

One way to do this is with header_checks. Create an additional SMTP listener in master.cf, e.g. on port 10587. In header_checks on your main listener (e.g. 587), do FILTER localhost:10587 on mail with header From: <restricted senders>.

Then in the additional listener (port 10587), have a second set of header checks which do the REJECT action on all mail which does not match To: <allowed search>.