So, first up, let me mention that the mail client usually sets the outgoing From: address. So, Thunderbird, Outlook, etc. are responsible for the outgoing address.
That said, if you’re sending from an application on the server, and it doesn’t know how to set the From: address (pretty rare, and pretty weird, but OK), you can use canonical maps to have Postfix reset the from field. More on that below, but I want to stop you from going down dead ends first:
I have played with the setting "What domain to use in outbound mail", but it doesn't work the way I expect.
This is always a nonsensical setting in a virtual hosting environment…it can’t possibly have a good effect. In a virtual hosting environment there could be hundreds of domains to use in outbound mail…how could one name ever be the right path?
It shouldn’t be set to anything.
You can’t set this on a server-wide basis for virtual hosting…which is what you’re doing with those settings. They should remain at defaults (which is basically letting Postfix figure it out on its own).
So, make sure those are at their defaults. They can interfere with mail clients that do set the From: field correctly, and they can interfere with delivery and other stuff. They’re just bad news, so don’t mess with them.
What you do want, assuming you can’t configure the sending clients to correctly set the From: address, is to enable canonical maps in Virtualmin and Postfix. This can be turned on in Module Config->Server Settings->Also update outgoing addresses for mailboxes?
I don’t think this will instantly add canonical maps for all mailboxes…so you’ll need to update the ones that are not sending with clients that can set a From: address correctly (just edit it and save it with no changes should add the canonical map, I think). Or, if you must update for everyone, there’s probably a way to do it with the “virtualmin modify-user” command…I’ll ask Jamie to chime in with how that can be done safely (without deleting the mail user and recreating, for example).