# -*- 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", "Stress Notify", "Trust",
                "Remote Network", "S25R", "Unauthenticated"]
              ],
              ["spfmilter",
               ["Remote Network", "Unauthenticated", "No Stress"]],
              ["clamav-milter", []],
              ["dkim-filter", []],
              ["opendkim", []],
              ["spamass-milter",
               ["Remote Network", "Unauthenticated", "No Stress"]],
              ["amavisd-new-milter", []],
             ]
candidates.each do |candidate, conditions|
  detector = DebianInitDetector.new(configuration, candidate)
  detector.detect
  detector.apply(self) do |milter|
    milter.applicable_conditions = conditions
  end
end
