1

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?

BastianW
  • 2,868
  • 4
  • 20
  • 34

1 Answers1

3

You can rewrite sender addresses with sender_canonical_maps.

For example:

sender_canonical_maps = hash:/etc/postfix/canonical

Which file will contain the canonical mappings you want, for instance:

root            no-reply@example.com
@example.net    somebody@example.com

And you generate its hash in the usual way:

postmap /etc/postfix/canonical

See the documentation for more.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • I've tried this out and shot a test mail, Don't know whether it'll work yet, or if the other configurations i've done are appropriate either. Appreciate the help. Thank you. – panickedprocrastinator Jul 25 '16 at 08:55