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 relayhost
parameter. But how do I set a specific from address for the mails sent from this server?
Asked
Active
Viewed 206 times
1
BastianW
- 2,848
- 4
- 19
- 34
panickedprocrastinator
- 661
- 1
- 5
- 8
-
Usual approach: Configure the mail-sending app to set the address you want. – Sven Jul 25 '16 at 07:47
1 Answers
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
- 237,123
- 42
- 477
- 940
-
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