[Exim] Exim 4: Opinions sought

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Exim 4: Opinions sought
I'd like to hear any opinions anyone has about the following. Sorry the
explanation is a bit long...

The $key variable in Exim was invented as a kludge, and has always been
somewhat confusing. For those who aren't familiar, it's what you have to
use when setting list options like this

hold_domains = mysql;select domain from sometable where domain='$key'

in order to get the domain that is of interest into the query.

For Exim 4, I have been working on a way of eliminating the need for
$key. I've basically done this; in all the cases where you might want to
do a query-style lookup in a list, the data you might need is now
available in one of the other variables. For example, the above becomes

hold_domains = mysql;select domain from sometable where domain='$domain'

which is more like what people expect.

However, it turns out that the most useful way to do this has ended up
expanding the entire list, before testing each element in the list in
turn. (Previously, only those elements that consisted of a query-style
lookup were expanded - another kludge.)

This isn't a problem, except for regular expressions. A setting such as

hold_domains = ^\d+.*\.com$

now has to be specified as

hold_domains = ^\\d+.*\\.com\$

because it gets expanded. Furthermore, because I've now made retry and
rewrite patterns exactly the same as an element in an address list, the
same problem arises there too.

The question is: should something be done, and if so, what? I see these
options:

(1) Do nothing. Require people to escape \ and $ in their regular
expressions. This would pretty much be every regex in a configuration.

(2) Implement some new expansion syntax so that parts of a string could
be marked "don't expand". It could be something like this:

hold_domains = \N^\d+.*\.com$\N : other items ...

On encountering \N, the expander would copy verbatim until it hit the
following \N, or end of string.

This would mean that almost all regexs would appear in that form. The
feature might be useful in contexts other than lists (e.g. regex in
filter files).

(3) Something else ...


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.