I have an application running on centOS 7, which needs to be configured to send mail(postfix) to a third party SMTP server. I have found that a way to accomplish this is to configure a smarthost using the
relayhostparameter. But how do I set a specific from address for the mails sent from this server?
You can rewrite sender addresses with
sender_canonical_maps = hash:/etc/postfix/canonical
Which file will contain the canonical mappings you want, for instance:
root firstname.lastname@example.org @example.net email@example.com
And you generate its hash in the usual way:
See the documentation for more.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.