Re: [Exim] String expansion and named lists

Inizio della pagina
Delete this message
Reply to this message
Autore: Kelley Reynolds
Data:  
To: Tim Jackson
CC: exim-users
Oggetto: Re: [Exim] String expansion and named lists
--- Original Message ---
From: Tim Jackson <lists@???>
Sent: Mon, 22 Mar 2004 16:00:31 +0000
To: exim-users@???
Subject: Re: [Exim] String expansion and named lists

> However, FWIW, I must say that it would be an *extremely* useful feature
> if Philip could find the time to add it. Even just support for named lists
> would be a great start.


Not exactly the same as what you're after, but after bringing up named variables previously and consequently being shot down, I've found some pretty clean workarounds for not having them (without using perl, obviously). For example, using a little creativity, you can have at least the read portion by using the ${extract} function for LDAP-style lookups.

For example, I have an SQL table with a variety of settings and using only one acl variable, I can store an entire row and just retrieve the bits I want using a slightly modified query.

warn set acl_m9 = ${lookup pgsql{select 'sender_verify=' || sender_verify from addresses where foo=bar limit 1}{$value}fail}

${extract{sender_verify}{$acl_m9}{$value}fail}

as an example. To make things even cleaner, you can use macros and just substitute bits in the config.

SENDER_VERIFY = ${extract{spam_assassin_threshold}{$acl_m9}{$value}fail}

then something like

  deny  condition = SENDER_VERIFY
        !verify = sender


Then just store 0 or 1 in the database. This lets you get a large number of named variables stored in a single acl_variable with only one database query instead of many. For writing to a list like that... well... that's more complicated, but can still be done with a mix of regex and some other fun.

Not quite what you were after, but sort of relevant nonetheless.