Try this:
I wrote this on the fly and haven’t tested if it works… but it should
First you need the directory structure that contains the main.cf fragment
mkdir -p /etc/e-smith/templates-custom/etc/postfix/main.cf
cd /etc/e-smith/templates-custom/etc/postfix/main.cf
Then create the fragment of the file:
vi 41sender_maps
and in 41sender_maps just write this line
smtp_generic_maps = hash:/etc/postfix/sender_rename
Save the file and give the command to regenerate /etc/postfix/main.cf
expand-template /etc/postfix/main.cf
If you go to see the file /etc/postfix/main.cf you’ll see that it added the new line
You create the file /etc/postfix/sender_rename
vi /etc/postfix/sender_rename
user@localdomain.local account@isp.example.com
@localdomain.local wholedomain@isp.example.com
save and then give the commands
postmap /etc/postfix/sender_rename
signal-event nethserver-mail-server-update