# -*- ruby -*-

security.privilege_mode = true

base_dir = "/var/run/milter-manager"
manager.connection_spec = "unix:#{base_dir}/milter-manager.sock"
controller.connection_spec = "unix:#{base_dir}/milter-manager-controller.sock"

candidates = [
              ["milter-greylist",
               ["Sendmail Compatible",
                "Remote Network", "S25R", "Unauthenticated"]
              ],
              ["mimedefang", []],
              ["enma", ["Remote Network", "Unauthenticated"]],
              ["dk-milter", []],
              ["dkim-filter", []],
              ["spamass-milter", ["Remote Network", "Unauthenticated"]],
              ["amavismilter", []],
              ["milter-regex", ["Remote Network", "Unauthenticated"]],
             ]
candidates.each do |candidate, conditions, spec_detector|
  detector = PkgsrcRCDetector.new(configuration, candidate, &spec_detector)
  detector.detect
  detector.apply(self) do |milter|
    milter.applicable_conditions = conditions
  end
end
