We want it to set up so emails sent with a from address of user1@. gets re-written to user1@mydomain.com when the email leaves the MTA.

Currently, we can configure Postfix with rewrite rules that have one-one mappings where
user1@something.something.mydomain -> user1@mydomain.com. But we have several subdomains and other internal domains in various combinations that could potentially relay through MTA.
Hence we’re seeking a way to configure it to rewrite the domain name