著者: Dennis Skinner 日付: To: Daniel M. Drucker CC: exim-users 題目: Re: [Exim] How to try more than one router?
On Tue, 2003-10-14 at 12:57, 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
>
> This, of course, doesn't actually work -- one a message is accepted by the
> smarthost router, it doesn't let go of it - it goes into the defer state,
> and begins the retry schedule. No message that maches ! +local_domains will
> ever make it to the dnslookup router.
While this isn't an answer, it may help you understand why it isn't
"letting go of it". Its because this router doesn't have it anymore.
It was sent to the remote_smtp transport and that is what determined
that the msg was undeliverable.
I'm not sure whether it does what you want, but did you try
host_find_failed? This may just fail if the dns lookup for that host
fails.
Other than that, my first thought was similar to yours. Have a
precondition for the router that checks the server availability.