Postfix forwarder: not runnig after WAN ip change!



  • Hallo!

    I have the postfix package (version 2.8.7,1 pkg v.2.3.4_1) so far running fine on pfsense 2.0.1 (i386).

    But every night I get a problem after my WAN ip changes.
    The postfix service does not successfully restart then.

    I get this message in system log:
    Aug 17 00:06:22 postfix/postfix-script[51406]: fatal: the Postfix mail system is already running

    When I try to manually restart postfix via services menu, I get this message:
    Aug 17 00:26:19 postfix/master[10834]: fatal: bind xxx.xxx.xxx.xxx port 25: Can't assign requested address

    The shown IP address was my old address. So that cannot work of course.
    It seems that postfix package does not recognize the ip change correctly.

    I can only re-save the postfix config to work around this.
    Then the service successfully restarts.
    But after 24h I have the same problem again…

    Thanks
    Dennis



  • @dneuhaeuser:

    It seems that postfix package does not recognize the ip change correctly.

    That's because config files are created during "save" on gui.

    did you tried to reboot it at 03:00 as an workaround?

    Another way could be a php script that calls package_sync feature.



  • I see that postfix stores a logical interface name in config.xml like:

    				<enabled_interface>opt1</enabled_interface>
    
    

    So when it starts up it is able to lookup the current IP address of the interface/s and use that in the config file.
    It would be good to have a way for packages to specify a function to be called when an interface IP address changes - e.g. custom_php_address_change_command. The code that handles DHCP changes (and if the user changes static interface IPs from the GUI) could call each package-defined custom_php_address_change_command. That way packages that cared would receive a "notification" that an interface address had changed. The package could then check the interface addresses it cared about and decide if it needed to take any action (e.g. change its run-time config).
    The other option is to force a full resync of all packages at every IP address change - but that is unnecessarily disruptive to most packages that actually don't care.
    Maybe this functionality is already in the package system and packages just need to use it?



  • @phil.davis:

    Maybe this functionality is already in the package system and packages just need to use it?

    IIRC, pfsense restart services on ip changes, but if the package does not has the "build config" on /usr/local/etc/rc.d/package.sh it will not work.

    You can check it with varnish, it rebuilds config every service restart.


Locked