From f9daeae0ce01e0f1a21d4904c1ed5541b08ec014 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Mon, 5 Dec 2005 14:38:18 +0000 Subject: [PATCH] ipliteral was not recognizing "ipv6" prefix. --- doc/doc-docbook/spec.ascd | 4 ++-- doc/doc-txt/ChangeLog | 5 ++++- src/src/routers/ipliteral.c | 22 ++++++++++++++-------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/doc-docbook/spec.ascd b/doc/doc-docbook/spec.ascd index 5d83e78b6..0fb9137d5 100644 --- a/doc/doc-docbook/spec.ascd +++ b/doc/doc-docbook/spec.ascd @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -$Cambridge: exim/doc/doc-docbook/spec.ascd,v 1.3 2005/11/15 16:10:50 ph10 Exp $ +$Cambridge: exim/doc/doc-docbook/spec.ascd,v 1.4 2005/12/05 14:38:18 ph10 Exp $ This is the primary source of the Exim Manual. It is an AsciiDoc document that is converted into DocBook XML for subsequent conversion into printing @@ -12040,7 +12040,7 @@ Processing messages %check_rfc2047_length% check length of RFC 2047 ``encoded words'' %delivery_date_remove% from incoming messages %envelope_to_remote% from incoming messages -%extract_addresses_remove_arguments%affects %-t% processing +%extract_addresses_remove_arguments% affects %-t% processing %headers_charset% default for translations %qualify_domain% default for senders %qualify_recipient% default for recipients diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 1c8725861..c95c33777 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.269 2005/12/01 14:21:25 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.270 2005/12/05 14:38:18 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -14,6 +14,9 @@ PH/01 The code for finding all the local interface addresses on a FreeBSD that it would not match correctly against @[] and not recognize the IPv6 addresses as local. +PH/02 The ipliteral router was not recognizing addresses of the form user@ + [ipv6:....] because it didn't know about the "ipv6:" prefix. + Exim version 4.60 ----------------- diff --git a/src/src/routers/ipliteral.c b/src/src/routers/ipliteral.c index ac99fd989..2b33a83cd 100644 --- a/src/src/routers/ipliteral.c +++ b/src/src/routers/ipliteral.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.5 2005/09/12 15:09:55 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.6 2005/12/05 14:38:18 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -102,6 +102,7 @@ ipliteral_router_options_block *ob = */ host_item *h; uschar *domain = addr->domain; +uschar *ip; int len = Ustrlen(domain); int rc; @@ -111,14 +112,19 @@ addr_succeed = addr_succeed; DEBUG(D_route) debug_printf("%s router called for %s: domain = %s\n", rblock->name, addr->address, addr->domain); -/* Check that the domain is an IP address enclosed in square brackets. If -not, the router declines. Otherwise route to the single IP address, setting the -host name to "(unnamed)". */ +/* Check that the domain is an IP address enclosed in square brackets. Remember +to allow for the "official" form of IPv6 addresses. If not, the router +declines. Otherwise route to the single IP address, setting the host name to +"(unnamed)". */ if (domain[0] != '[' || domain[len-1] != ']') return DECLINE; domain[len-1] = 0; /* temporarily */ -if (string_is_ip_address(domain+1, NULL) == 0) +ip = domain + 1; +if (strncmpic(ip, US"IPV6:", 5) == 0 || strncmpic(ip, US"IPV4:", 5) == 0) + ip += 5; + +if (string_is_ip_address(ip, NULL) == 0) { domain[len-1] = ']'; return DECLINE; @@ -128,10 +134,10 @@ if (string_is_ip_address(domain+1, NULL) == 0) but if it is set, it should probably work. */ if (verify_check_this_host(&(rblock->ignore_target_hosts), NULL, domain, - domain + 1, NULL) == OK) + ip, NULL) == OK) { DEBUG(D_route) - debug_printf("%s is in ignore_target_hosts\n", domain+1); + debug_printf("%s is in ignore_target_hosts\n", ip); addr->message = US"IP literal host explicitly ignored"; domain[len-1] = ']'; return DECLINE; @@ -142,7 +148,7 @@ if (verify_check_this_host(&(rblock->ignore_target_hosts), NULL, domain, h = store_get(sizeof(host_item)); h->next = NULL; -h->address = string_copy(domain+1); +h->address = string_copy(ip); h->port = PORT_NONE; domain[len-1] = ']'; /* restore */ h->name = string_copy(domain); -- 2.30.2