Hello All,
I would like to forward the root mail to my email address using an exchange server. I installed postfix. In main.cf the only thing I changed is mydomain = company.com and myorigin = $mydomain. The hostname is host.company.com. in aliases I changed root to myemail@company.com.
When I test it using echo test | mail -s "Test Message" root it is sending it to the exchange server, but it is not forwarding it to my email. It is sending it to root@company.com.
I have searched around quite a bit and tried a variety of different settings in main.cf. I can send email using sendmail myemail@company.com without an issue.
Looking for suggestions on resolving this issue.
Thank you
forward root mail to exchange server
Re: forward root mail to exchange server
look at ~/.forward
Re: forward root mail to exchange server
You need to look at the address rewriting in Postfix, specifically, "canonical_maps".
Re: forward root mail to exchange server
@BShT Thank you. I removed the changes I made to the postfix main.cf, then created the .forward file with my address in it. This is working on two of the seven servers. I will dig through to see why it is not working on the five.
I do have an additional question. The email is being sent from root@hostname.domain.com. Is there a way to remove the host name? Even better would be hostname@domain.com.
@Whoever, thank you for the response. I will research this.
I do have an additional question. The email is being sent from root@hostname.domain.com. Is there a way to remove the host name? Even better would be hostname@domain.com.
@Whoever, thank you for the response. I will research this.
Re: forward root mail to exchange server
For your question about the sender email address, look at "sender_canonical_maps".