Hi,

In <5f0a4d43797f50decd8590a59d9e6...@localhost>
  "Multiple Milters" on Thu, 11 Jun 2009 09:27:11 +0200,
  Ihsan Dogan <ih...@dogan.ch> wrote:

> I'm running two spamfilters on two machines, which are accessed with
> milter. In case of an error (eg: the first milter service is not running),
> I would like that Postfix wold use the second one on the other host.
> 
> I was expecting something something like this:
> smtpd_milters = inet:[127.0.0.1],[1.2.3.4]:41001
> 
> Is such a setup possible with Postfix?

You can do it with milter manager:
  http://milter-manager.sourceforge.net/


milter-manager.conf:
  manager.connection_spec = "inet:12...@[127.0.0.1]"

  define_applicable_condition("fallback") do |condition|
    condition.description = "fallback to secondary milter if primary milter is 
down"
    condition.define_connect_stopper do |context, host, address|
      # stop secondary milter if primary milter isn't quieted
      # (if primary milter is quieted, primary-milter is down)
      not context.children["primary-milter"].quitted?
    end
  end

  define_milter("primary-milter") do |milter|
    milter.description = "primary milter"
    milter.connection_spec = "inet:23...@[127.0.0.1]"
  end

  define_milter("secondary-milter") do |milter|
    milter.description = "secondary milter"
    milter.connection_spec = "inet:41...@[1.2.3.4]"

    # apply "fallback" condition to use secondary milter
    # only when primary milter is down
    milter.applicable_conditions = ["fallback"]
  end

main.cf:
  # only register milter manager.
  smtpd_milters = inet:[127.0.0.1]:12345


Thanks,
--
kou

Reply via email to