Re: [exim] Experimental Redis lookup

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Warren Baker
Date:  
À: Brent Jones
CC: exim users
Sujet: Re: [exim] Experimental Redis lookup
On Wed, Apr 23, 2014 at 11:49 PM, Brent Jones <brent@???> wrote:
> I haven't use it yet, but would like to.
> Would you mind sharing snippets of how you are using it?
>


Sorry for the delay - too many national holidays here.

There are a few examples in the experimental-spec.txt documentation,
however I am using it for a number of things.
Lookups of users, domains, greylisting, white and blacklisting for
IPs, email addresses and so on.

For example querying my own whitelist per recipient and per domain

addresslist domain_whitelist_senders = <\n ${lookup redis{GET_DOMAIN_WHITELIST}}
addresslist rcpt_whitelist_senders = <\n ${lookup redis{GET_PER_RCPT_WHITELIST}}

The macros are defined below which both execute Redis' smembers
command (http://redis.io/commands/smembers):

GET_DOMAIN_WHITELIST = SMEMBERS whitelist:$domain
GET_PER_RCPT_WHITELIST = SMEMBERS whitelist:$local_part@$domain

Another example is using it to grab user data. The user data could be
stored in a hash

GET_USER = HGETALL $domain:$local_part

the hash values could then be used later on. For example extracting a
new forward address:

data = ${extract{forward}{${lookup redis {GET_USER}{$value}fail}}}

Hope that helps.


--
.warren
wagonza on #exim on freenode