Re: [exim] Round-robin dnslists?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: John Horne
日付:  
To: Exim users
題目: Re: [exim] Round-robin dnslists?
On Tue, 2009-09-01 at 15:01 +0100, Mike Cardwell wrote:
> John Horne wrote:
>
> > Anyone know if it is possible to configure the 'dnslists' condition in a
> > round-robin order? I want to check to see if a sending host is listed on
> > one of two RBL's, but don't necessarily want all the checks to go to the
> > first listed RBL:
> >
> >        dnslists = rbl-a : rbl-b

> >
> > I would rather it alternated between the two, rather than testing
> > 'rbl-a' all the time. Similar to the 'hosts_randomize' transport
> > statement.
>
> dnslists = ${if eq{${eval:$tod_epoch%2}}{1}{rbl-a:rbl-b}{rbl-b:rbl-a}}
>
> In the above example, the order depends on whether or not the number of
> seconds since the epoch is odd or even. Would that be sufficient?
>

Ha! Good solution :-) Yes, that works fine. A simple test with some
logging shows that each RBL is called, and over a period of time this
works out closer to a 50/50 split. (I changed the 'eq' to an '=='
though.)

Many thanks.


John.

-- 
--------------------------------------------------
John Horne, University of Plymouth, UK
Tel: +44 (0)1752 587287    Fax: +44 (0)1752 587001