Re: [exim] Wildlsearch - case-dependent?

Etusivu
Poista viesti
Vastaa
Lähettäjä: John Horne
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Wildlsearch - case-dependent?
On Wed, 2006-07-26 at 14:35 +0100, Philip Hazel wrote:
> On Wed, 26 Jul 2006, John Horne wrote:
>
> > 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.
>
> A *brief* look at the code suggests not, but I haven't spent time on it.
> I could well be wrong - there's a lot of code. I don't have time just
> now to actually run a test.
>
> Ordinary lsearch matching does a caseless comparison of keys; it doesn't
> force the case. This suggests it isn't expecting its keys to be
> case-forced.
>
> Certainly nwildlsearch has a default of caselessness for regex
> comparison, but (?-i) should suppress that.
>

Debugging output from 'exim -d' shows, using the word 'consideration' as
the subject line:

Uppercase subject and lookup file key:

CONSIDERATION in "^(?-i)CONSIDERATION"? no (end of list)

Lowercase subject and lookup file key:

consideration in "^(?-i)consideration"? yes (matched
"^(?-i)consideration")

Using mixed-case subject line:

CONsidERAtiOn in "^(?-i)consideration"? yes (matched
"^(?-i)consideration")

Now with uppercase lookup file key:

CONsidERAtiOn in "^(?-i)CONSIDERATION"? no (end of list)


As can be seen an uppercase comparison failed, when it should have
worked, but the lowercase one worked. Mixed-case shouldn't work at all,
but one did. A bug?



John.

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