ph10 2007/05/08 14:08:22 BST
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src verify.c
exim-test/aux-fixed 0002.matchip
exim-test/scripts/0000-Basic 0002
exim-test/stdout 0002
Log:
Use colon, not dot, as IPv6 separator in host-list lookups that use the
iplsearch lookup type.
Revision Changes Path
1.506 +17 -0 exim/exim-doc/doc-txt/ChangeLog
1.50 +6 -3 exim/exim-src/src/verify.c
1.2 +1 -0 exim/exim-test/aux-fixed/0002.matchip
1.14 +1 -0 exim/exim-test/scripts/0000-Basic/0002
1.14 +1 -0 exim/exim-test/stdout/0002
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.505
retrieving revision 1.506
diff -u -r1.505 -r1.506
--- ChangeLog 19 Apr 2007 13:19:06 -0000 1.505
+++ ChangeLog 8 May 2007 13:08:22 -0000 1.506
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.505 2007/04/19 13:19:06 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.506 2007/05/08 13:08:22 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -7,6 +7,23 @@
-----------------
PH/01 Another patch from the Sieve maintainer.
+
+PH/02 When an IPv6 address is converted to a string for single-key lookup
+ in an address list (e.g. for an item such as "net24-dbm;/net/works"),
+ dots are used instead of colons so that keys in lsearch files need not
+ contain colons. This was done some time before quoting was made available
+ in lsearch files. However, iplsearch files do require colons in IPv6 keys
+ (notated using the quote facility) so as to distinguish them from IPv4
+ keys. This meant that lookups for IP addresses in host lists did not work
+ for iplsearch lookups.
+
+ This has been fixed by arranging for IPv6 addresses to be expressed with
+ colons if the lookup type is iplsearch. This is not incompatible, because
+ previously such lookups could never work.
+
+ The situation is now rather anomolous, since one *can* have colons in
+ ordinary lsearch keys. However, making the change in all cases is
+ incompatible and would probably break a number of configurations.
Exim version 4.67
Index: verify.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/verify.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- verify.c 1 Mar 2007 11:17:00 -0000 1.49
+++ verify.c 8 May 2007 13:08:22 -0000 1.50
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/verify.c,v 1.49 2007/03/01 11:17:00 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/verify.c,v 1.50 2007/05/08 13:08:22 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2201,7 +2201,8 @@
name, we have to fish the file off the start of the query. For a single-key
lookup, the key is the current IP address, masked appropriately, and
reconverted to text form, with the mask appended. For IPv6 addresses, specify
- dot separators instead of colons. */
+ dot separators instead of colons, except when the lookup type is "iplsearch".
+ */
if (mac_islookup(search_type, lookup_absfilequery))
{
@@ -2216,11 +2217,13 @@
filename = NULL;
key = semicolon + 1;
}
- else
+ else /* Single-key style */
{
+ int sep = (Ustrcmp(lookup_list[search_type].name, "iplsearch") == 0)?
+ ':' : '.';
insize = host_aton(cb->host_address, incoming);
host_mask(insize, incoming, mlen);
- (void)host_nmtoa(insize, incoming, mlen, buffer, '.');
+ (void)host_nmtoa(insize, incoming, mlen, buffer, sep);
key = buffer;
filename = semicolon + 1;
}
Index: 0002.matchip
===================================================================
RCS file: /home/cvs/exim/exim-test/aux-fixed/0002.matchip,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0002.matchip 7 Feb 2006 10:16:23 -0000 1.1
+++ 0002.matchip 8 May 2007 13:08:22 -0000 1.2
@@ -1,2 +1,3 @@
1.2.3.4: data for 1.2.3.4
5.6.7.0/24: data for 5.6.7.0/24
+"abcd::dcba": data for abcd::dcba
Index: 0002
===================================================================
RCS file: /home/cvs/exim/exim-test/scripts/0000-Basic/0002,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- 0002 26 Feb 2007 14:07:04 -0000 1.13
+++ 0002 8 May 2007 13:08:22 -0000 1.14
@@ -375,6 +375,7 @@
match_ip: 12 ${if match_ip{1.2.3.4}{lsearch;DIR/aux-fixed/0002.matchip}}
match_ip: 13 ${if match_ip{1.2.3.4}{net-lsearch;DIR/aux-fixed/0002.matchip}}
match_ip: 14 ${if match_ip{5.6.7.8}{net24-lsearch;DIR/aux-fixed/0002.matchip}}
+match_ip: 15 ${if match_ip{abcd::dcba}{net-iplsearch;DIR/aux-fixed/0002.matchip}}
queue_running: ${if queue_running{y}{n}}
first_delivery: ${if first_delivery{y}{n}}
Index: 0002
===================================================================
RCS file: /home/cvs/exim/exim-test/stdout/0002,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- 0002 26 Feb 2007 14:07:04 -0000 1.13
+++ 0002 8 May 2007 13:08:22 -0000 1.14
@@ -345,6 +345,7 @@
> match_ip: 12 true
> match_ip: 13 true
> match_ip: 14 true
+> match_ip: 15 true
>
> queue_running: n
> first_delivery: n