Re: [exim] Is it possible to skip a router if a transport is…

Top Page
Delete this message
Reply to this message
Author: Todd Lyons
Date:  
To: Oliver Howe
CC: exim-users
Subject: Re: [exim] Is it possible to skip a router if a transport is unavailable?
On Wed, Jun 5, 2013 at 3:21 AM, Oliver Howe <ojhowe@???> wrote:
> I have a router that calls a custom transport that relies on a database
> connection.
> Is there a way to skip on to the next router if the database connection is
> not available?


I would add a second condition to the router that tests the database
connection directly, or call a script to test the database connection
and return a 1 or 0:

condition = ${lookup mysql {SELECT 1;}}

or if you don't use mysql directly in your exim config:

condition = ${run {/path/to/db_test.pl}}

If the database is available, a return of 1 is true, and so it will
pass and go to the transport. Keep in mind that the routers after
this one might not be configured to handle emails that _should_ have
been caught by previous routers. You might have additional work
required on the routers following this one you modify (or have to add
another router to handle the missed email, such as simply queue it).

...Todd

--
The total budget at all receivers for solving senders' problems is $0.
If you want them to accept your mail and manage it the way you want,
send it the way the spec says to. --John Levine