We are currently migrating Mail Restriction from Linux System to Exchange but we have to do it by batch so as to limit the effect if in case something might not go as planned. With that said, we have identified the users to be migrated but the problem is that we can’t relay mails to our Exchange servers.
We have tried checking on the sender_dependent_relayhost_maps and related config but no to avail.
However, to my surprise and what worked for us is that utilizing smtpd_sender_restrictions. Below is what I have done for our setup:
Add a line below under smtpd_sender_restrictions:
And I have this on my /etc/postfix/for_migration file and postmap this file and restared postfix.
yongitz.testme@ FILTER relay:[192.168.1.9]
With this, when the user yongitz.testme sends an email, local postfix does not queue the mail but instead relays it to our Exchange Server(192.168.1.9).
I actually have tried this using header_checks but seems to be inconsistent and since this works, I am happy with it as we can now go on with the migration.