Masquerading or replacing outgoing SMTP email address with Postfix

Postfix can replace an outgoing email address by another one. To do so, you must perform these steps:

Add in /etc/postfix/main.cf the following line

smtp_generic_maps = hash:/etc/postfix/generic_maps

Add in hash:/etc/postfix/generic_maps a line for each email address you want to replaced.  The line shall contain the email address to replace followed by the new email address separated by a space.  For example:

user@machine-name emailaddress@domain.tld

Generate or update the map by issuing the following command

postmap /etc/postfix/generic_maps

Restart postfix by issuing the following command

service postfix restart