OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: jassonmc on February 01, 2023, 01:40:12 PM

Title: Postifx - Sender Canonical Rewriting, not working?
Post by: jassonmc on February 01, 2023, 01:40:12 PM
Hello there

I have following task at hand:
An internal mail sending machine (LAN zone) has a non changeable email sender address in this form: machine@otheraddress.com
That machine however needs to send mails to external address with this from address: machine@address.com

In order to achieve that I thought that "Sender Canonical Rewriting is the necessary feature and configured this:

Rewrite From:   /machine@otheraddress.com/i
Rewrite To:   machine@address.com

My expectation would be, that any outbound mail sending (from LAN to WAN) with a sender address of "machine@otheraddress.com" should now get rewritten to "machine@address.com".
Well, it's not working...

What am I doing wrong?

Thanks for a hint  ;)

Best
Juri
Title: Re: Postifx - Sender Canonical Rewriting, not working?
Post by: mimugmail on February 01, 2023, 02:50:36 PM
Can you check the contens of this file:
https://github.com/opnsense/plugins/blob/master/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf#L37

If it matches this:
https://github.com/opnsense/plugins/blob/master/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/sendercanonical#L5

Any logs?