Re: [Exim] How to try more than one router?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Dean Brooks
日付:  
To: Daniel M. Drucker
CC: exim-users
題目: Re: [Exim] How to try more than one router?
On Tue, Oct 14, 2003 at 12:57:52PM -0400, Daniel M. Drucker wrote:

> I am currently delivering all of my mail through a smarthost. I would like
> to make it so that, in the event that smarthost is not reachable, my machine
> instead attempts to deliver the mail itself.
>
> The first two entries in my routers section look like this:
>
> smarthost:
> driver = manualroute
> domains = ! +local_domains
> transport = remote_smtp
> route_list = * smarthost.myothersite.org
>
> # shouldn't ever use dnslookup unless smarthost fails
> dnslookup:
> driver = dnslookup
> domains = ! +local_domains
> transport = remote_smtp
> ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> no_more


Because once a message is routed, it sticks with the assigned transport.
That is why its not falling through. However, you can easily get
what you want. Change your routers to:

  smarthost:
    driver = manualroute
    domains = ! +local_domains
    condition = ${if > {$message_age}{900}{yes}{no}}      <<<<< Insert this
    transport = remote_smtp
    route_list = * smarthost.myothersite.org


  # shouldn't ever use dnslookup unless smarthost fails
  dnslookup:
    driver = dnslookup
    domains = ! +local_domains
    transport = remote_smtp
    ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
    no_more


The condition on your first router will only operate if the age
of the message is 15 minutes or younger. If it is unable to
deliver within 15 minutes, the router will be skipped and will
attempt direct delivery.

You could change the 15 minutes to something else if you wanted.

-Dean