OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: fox983 on March 27, 2020, 02:26:48 am

Title: Postfix configuration
Post by: fox983 on March 27, 2020, 02:26:48 am
Hello,
some months ago I set up in OPNsense a mail alert system with ntopng and Postfix.
The emails had my public IP in the subject line and all was working fine.
After setting up a secondary internet connection, now the subject reports the secondary IP (DHCP) instead of the primary one (PPPOE connection - public IP).
How can I set back external IP of my primary internet connection in the subject line?
I've tried with option smtp_bind_address but no luck.
And another problem is if I set something in Services/Postfix/General - System Hostname or System Domain,
I continue to receive emails with hostname-domain set in System/Settings/General Hostname and Domain, not the ones I set.
Changes made in gui are written correctly in /usr/local/etc/postfix/main.cf but seems that are ignored.
Now emails arrive with secondary IP and hostname.domain in subject line
[opnsense.domain@192.168.15.1] instead of [firewall.test@external-IP]

Thanks in advance for those who want to help me
Title: Re: Postfix configuration
Post by: mimugmail on March 27, 2020, 06:40:57 am
Wasnt there a masquerade Domain parameter for this?
Title: Re: Postfix configuration
Post by: fox983 on March 27, 2020, 11:15:08 am
Yes but trying to set something.external.com in field Masquerade Domains, mails arrive with [opnsense.domain@192.168.15.1] in subject line.
All parameters seem to be ignored.
Title: Re: Postfix configuration
Post by: mimugmail on March 27, 2020, 04:35:56 pm
I have no idea why you are talking about subject lines? Is this some scripted stuff on your side?
Title: Re: Postfix configuration
Post by: fox983 on March 27, 2020, 07:25:04 pm
No script. I'm talking about subject line because here are the data I'd like to change.
Now subject of emails is "ntopng [opnsense.domain@192.168.15.1]" but it should be "ntopng [firewall.test@external-IP]"
Maybe is the ntopng's alert system that set these variables?
And if so how can I change them?
Title: Re: Postfix configuration
Post by: mimugmail on March 27, 2020, 07:43:10 pm
No idea, should be related to ntop