Re: [exim] Random number generation in an ACL

Top Page
Delete this message
Reply to this message
Author: Chris Lightfoot
Date:  
To: Ian P. Christian
CC: exim-users
Subject: Re: [exim] Random number generation in an ACL
On Thu, Jul 06, 2006 at 05:48:57PM +0100, Ian P. Christian wrote:
> On Thursday 06 July 2006 17:45, Chris Lightfoot wrote:
> > Does your database have a rng function? If so you can call
> > through to that. I don't think there's one in Exim exposed
> > to the string expansion functions (at least, I couldn't
> > find one when I looked the other day).
>
> well, possibly.. I just didnt' want to do the query at all unless it was
> needed - but I dunno which adds the more overhead, using perl (this is my
> only use for perl, without this it wouldn't be used at all) or calling a
> query like...
>
> delete * from table where age > 1 day and rng(1000) == 1;
>
>
> I presume by you're comment that you wanted to do this too? Is a feature
> request in order here?


I wanted something slightly different (a random ID to
identify a connection as part of a greylisting setup; I
could have used a hash of the connection params, but that
seemed easier). In your case, you could always do a
`select random()' or whatever and test it in a condition
on the ACL.

On the other hand, it'd be a handy feature to have without
needing a database....

--
You cannot win the game, and you are not allowed to stop playing
(the third law)