mswart / chef-postfix-full

Chef cookbook to setup and manage a postfix instance, it is designed for administrators who needs the full control about postfix
Apache License 2.0
8 stars 8 forks source link

Disable default service in master.cf #12

Open endorama opened 9 years ago

endorama commented 9 years ago

Hello, there is a way to disable a default service? I need to make Postfix use a outgoing non standard port due to limitation of the network in which the server will be, and I'd like to disable smtp on port 25 ( because cannot be used ).

Making postfix listen on specific port has been easy:

"postfix": {
    "master": {
      "inet:20100": {
        "private": false,
        "command": "smtpd"
      }
    }
  }

I didn't find a way to disable smtp on port 25. I tried

"postfix": {
    "master": {
      "inet:smtp": null
    }
  }

but is not working.

There is a way to prevent this recipe from adding line smtp inet n - - - - smtpd in the master.cf file?

Thank you.

mswart commented 9 years ago

Your proposed way is the way it is intended to be solved. The problem is that the chef had for a long time a broken deep merge strategy that ignored nil values. See https://tickets.opscode.com/browse/CHEF-4101. This is fixed with chef/chef#719 and released with chef 12.0.0.

If you can upgrade to chef 12 it would solve the problem directly. If you stuck with an older version, it is more complicated. We have a couple of options: