forward root mail to exchange server

Issues related to applications and software problems
Post Reply
TxHemi
Posts: 2
Joined: 2021/01/13 15:15:31

forward root mail to exchange server

Post by TxHemi » 2021/02/24 20:35:31

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

BShT
Posts: 584
Joined: 2019/10/09 12:31:40

Re: forward root mail to exchange server

Post by BShT » 2021/02/25 17:36:03

look at ~/.forward

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: forward root mail to exchange server

Post by Whoever » 2021/02/25 21:29:26

You need to look at the address rewriting in Postfix, specifically, "canonical_maps".

TxHemi
Posts: 2
Joined: 2021/01/13 15:15:31

Re: forward root mail to exchange server

Post by TxHemi » 2021/02/26 17:33:59

@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.

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: forward root mail to exchange server

Post by Whoever » 2021/02/28 21:22:18

For your question about the sender email address, look at "sender_canonical_maps".

Post Reply