Re: [exim] Greylist memcached perl implementation

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Warren Baker
Date:  
À: Mike Cardwell
CC: exim-users
Sujet: Re: [exim] Greylist memcached perl implementation
2009/7/28 Mike Cardwell <exim-users@???>

>
> Hmmm, you could do that all inside Exim to. Use ${readfile} to get the
> list of memcached servers. Then, you'd use a simple hashing algorithm
> like: Take the first octet of the IP address and then mod it against the
> number of servers you've obtained. Eg:
>
> ${eval:${sg{$sender_host_address}{\N\..+\N}{}}%3}
>
> That would return consistant values for each IP address where the values
> are 0, 1 or 2. Then pick the server to connect to.
>
> It's not straight forward though.
>


or make use of a numeric hash based upon sender address,host address and/or
recipient etc. Then use the result as the key to determine the server to
connect to. The hash number would be the number of servers in the cluster:

${nhash{2}{$sender_address/$local_part@$domain}}

either way works.

.warren