Here are the quick steps to accomplish this:
# vi /etc/postfix/main.cf
Modify the “mydomain” variable to your email domain
# mydomain = example.com
Make sure to uncomment the proper network interface.
# inet_interfaces = all
Now at the bottom of this file you need to specify the generic map file for rewriting the address.
# smtp_generic_maps = hash:/etc/postfix/generic
Save and exit main.cf. Now we need to edit /etc/postfix/generic
# vi /etc/postfix/generic
You need to specify the mapping of the original address to the one you want. Since in this case I just want to rewrite everything I usually add the following two lines and it seems to catch everything.
email@example.com firstname.lastname@example.org @example.com email@example.com
Save and exit the file. Now we need to create the postfix db.
# postmap /etc/postfix/generic
This will create the /etc/postfix/generic.db hash file.