Re: [exim] Wildlsearch - case-dependent?

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: John Horne
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Wildlsearch - case-dependent?
On Wed, 2006-07-26 at 12:29 +0100, Philip Hazel wrote:
> On Wed, 26 Jul 2006, John Horne wrote:
>
> > Anyone know if there is a way of making (n)wildlsearch lookups
> > case-dependent? I'm using nwildlsearch with regex keys that begin with a
> > caret (^), but in some instances don't want the keys treated caselessly.
>
> (?-i) in the pattern will turn on case-dependence. However, the keys
> themselves will typically be lowercased, depending on the circumstances
> in which you are doing the lookup. For example, $local_part is often
> lower cased unless you set caseful_local_part.
>

Thanks for that. However, I think what I need is for the key that is
being looked up to be case-independent, rather than the key in the
lookup file. Sorry, my mistake for not wording this correctly initially.

In this instance I am searching on subject lines (yup, we're doing some
weird things down here! :-)) :

     condition = ${lookup {$h_Subject:} nwildlsearch \
                       {/etc/exim/tables/subj-blacklist} {1} {0} }


The key being looked up ($h_Subject:) seems lowercased before the file
is searched. As such we can't do a lookup of an uppercased subject line,
which must match an uppercased key in the lookup file. Lower and mixed
cases work fine.

I see no way around this unless the looked up key ($h_Subject:) was left
untouched, and the character case issue handled in the lookup file using
'(?i)' and '(?-i)'.


John.

-- 
---------------------------------------------------------------
John Horne, University of Plymouth, UK  Tel: +44 (0)1752 233914
E-mail: John.Horne@???       Fax: +44 (0)1752 233839