-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.383 2006/07/27 11:29:32 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.384 2006/07/27 13:50:43 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
This bug exists in every version of Exim that I still have, right back to
0.12.
+PH/26 (n)wildlsearch lookups are documented as being done case-insensitively.
+ However, an attempt to turn on case-sensitivity in a regex key by
+ including (?-i) didn't work because the subject string was already
+ lowercased, and the effects were non-intuitive. It turns out that a
+ one-line patch can be used to allow (?-i) to work as expected.
+
Exim version 4.62
-----------------
-/* $Cambridge: exim/src/src/match.c,v 1.14 2006/04/04 10:01:20 ph10 Exp $ */
+/* $Cambridge: exim/src/src/match.c,v 1.15 2006/07/27 13:50:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
returns ERROR)
Contents of the argument block:
- subject the subject string to be checked
+ origsubject the subject in its original casing
+ subject the subject string to be checked, lowercased if caseless
expand_setup if < 0, don't set up any numeric expansion variables;
if = 0, set $0 to whole subject, and either
$1 to what matches * or
int search_type, partial, affixlen, starflags;
int expand_setup = cb->expand_setup;
uschar *affix;
-uschar *s = cb->subject;
+uschar *s;
uschar *filename = NULL;
uschar *keyquery, *result, *semicolon;
void *handle;
if (valueptr != NULL) *valueptr = NULL; /* For non-lookup matches */
+/* For regular expressions, use cb->origsubject rather than cb->subject so that
+it works if the pattern uses (?-i) to turn off case-independence, overriding
+"caseless". */
+
+s = (pattern[0] == '^')? cb->origsubject : cb->subject;
+
/* If required to set up $0, initialize the data but don't turn on by setting
expand_nmax until the match is assured. */
^a\\.+b ^a\\.+b
\N^a\d+b \N^a\d+b
lsearch;DIR/aux-fixed/0002.quoted: lookup succeeded
+^(?-i)MiXeD-CD: Data found for case-dependent MiXeD-CD
+^MiXeD-nCD: Data found for case-independent MiXeD-nCD
a\\:b: ${lookup{a\\:b}nwildlsearch{DIR/aux-var/0002.wild}}
a\\:Xb: ${lookup{a\\:Xb}nwildlsearch{DIR/aux-var/0002.wild}}
+# Some tests of case-(in)dependence
+
+MiXeD-CD: ${lookup{MiXeD-CD}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
+MixeD-CD: ${lookup{MixeD-CD}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
+MiXeD-Ncd: ${lookup{MiXeD-Ncd}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
+MixeD-Ncd: ${lookup{MixeD-Ncd}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
+
# IP address (CIDR) lookups
1.2.3.4: ${lookup{1.2.3.4}iplsearch{DIR/aux-fixed/0002.iplsearch}}
> a\:b: ^a\\.+b
> a\:Xb: ^a\\.+b
>
+> # Some tests of case-(in)dependence
+>
+> MiXeD-CD: Data found for case-dependent MiXeD-CD
+> MixeD-CD: NOT FOUND
+> MiXeD-Ncd: Data found for case-independent MiXeD-nCD
+> MixeD-Ncd: Data found for case-independent MiXeD-nCD
+>
> # IP address (CIDR) lookups
>
> 1.2.3.4: data for 1.2.3.4