Re: [exim] Random numbers

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Ian Eiloart
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Random numbers


--On 10 January 2006 17:11:16 +0100 Jakob Hirsch <jh@???> wrote:

> Ian Eiloart wrote:
>
>> Does Exim have a random number generator?
>
> Recent versions have the modulo operator, so you can build yourself a poor
> man's RNG:
> ${if eq{${eval:($tod_epoch+$pid)%2}}{0}}
>
> will give you true with a 50% (= 0.5 = reciprocal value of 2) chance (over
> a sufficent long period). That's much less expensive than a regex, I'd
> say.
> Note that messages received within the same second over the same
> connection will have the same value assigned, but that's typically not a
> problem with spam.


No, that's OK. And, actually characterising everything received over the
same connection has some value. For example, I'd like to know whether a
spam bot was planning on delivering hundreds of messages. If so, then my
spam rejection ratio could go way up. I guess I'd have to accept the
messages to find that out.


--
Ian Eiloart
Servers Team
Sussex University ITS