Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Postfix forwarder: not runnig after WAN ip change!

    Scheduled Pinned Locked Moved pfSense Packages
    4 Posts 3 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dneuhaeuser
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

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

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • P
          phil.davis
          last edited by

          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?

          As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
          If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

          1 Reply Last reply Reply Quote 0
          • marcellocM
            marcelloc
            last edited by

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

            Treinamentos de Elite: http://sys-squad.com

            Help a community developer! ;D

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.