-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.32 2004/11/18 10:35:18 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.33 2004/11/18 11:17:33 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
there was an errors_to setting on the router. The errors_to setting is now
respected.
+35. If an IPv6 address is given for -bh or -bhc, it is now converted to the
+ canonical form (fully expanded) before being placed in
+ $sender_host_address.
+
Exim version 4.43
-----------------
-/* $Cambridge: exim/src/src/exim.c,v 1.8 2004/11/10 10:29:56 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.9 2004/11/18 11:17:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (host_checking)
{
+ int x[4];
+ int size;
+
sender_ident = NULL;
if (running_in_test_harness && sender_host_port != 0 &&
interface_address != NULL && interface_port != 0)
verify_get_ident(1413);
+
+ /* In case the given address is a non-canonical IPv6 address, canonicize
+ it. The code works for both IPv4 and IPv6, as it happens. */
+
+ size = host_aton(sender_host_address, x);
+ sender_host_address = store_get(48); /* large enough for full IPv6 */
+ (void)host_nmtoa(size, x, -1, sender_host_address, ':');
+
+ /* Now set up for testing */
host_build_sender_fullhost();
smtp_input = TRUE;
-/* $Cambridge: exim/src/src/expand.c,v 1.6 2004/11/17 16:12:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.7 2004/11/18 11:17:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Convert to masked textual format and add to output. */
yield = string_cat(yield, &size, &ptr, buffer,
- host_nmtoa(count, binary, mask, buffer));
+ host_nmtoa(count, binary, mask, buffer, '.'));
continue;
}
-/* $Cambridge: exim/src/src/functions.h,v 1.3 2004/11/17 14:32:25 ph10 Exp $ */
+/* $Cambridge: exim/src/src/functions.h,v 1.4 2004/11/18 11:17:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
extern BOOL host_is_tls_on_connect_port(int);
extern void host_mask(int, int *, int);
extern int host_name_lookup(void);
-extern int host_nmtoa(int, int *, int, uschar *);
+extern int host_nmtoa(int, int *, int, uschar *, int);
extern uschar *host_ntoa(int, const void *, uschar *, int *);
extern int host_scan_for_local_hosts(host_item *, host_item **, BOOL *);
-/* $Cambridge: exim/src/src/host.c,v 1.2 2004/11/12 16:54:55 ph10 Exp $ */
+/* $Cambridge: exim/src/src/host.c,v 1.3 2004/11/18 11:17:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* We can't use host_ntoa() because it assumes the binary values are in network
byte order, and these are the result of host_aton(), which puts them in ints in
host byte order. Also, we really want IPv6 addresses to be in a canonical
-format, so we output them with no abbreviation. However, we can't use the
-normal colon separator in them because it terminates keys in lsearch files, so
-use dot instead.
+format, so we output them with no abbreviation. In a number of cases we can't
+use the normal colon separator in them because it terminates keys in lsearch
+files, so we want to use dot instead. There's an argument that specifies what
+to use for IPv6 addresses.
Arguments:
count 1 or 4 (number of ints)
binary points to the ints
mask mask value; if < 0 don't add to result
buffer big enough to hold the result
+ sep component separator character for IPv6 addresses
Returns: the number of characters placed in buffer, not counting
the final nul.
*/
int
-host_nmtoa(int count, int *binary, int mask, uschar *buffer)
+host_nmtoa(int count, int *binary, int mask, uschar *buffer, int sep)
{
int i, j;
uschar *tt = buffer;
for (i = 0; i < 4; i++)
{
j = binary[i];
- sprintf(CS tt, "%04x.%04x.", (j >> 16) & 0xffff, j & 0xffff);
+ sprintf(CS tt, "%04x%c%04x%c", (j >> 16) & 0xffff, sep, j & 0xffff, sep);
while (*tt) tt++;
}
}
-tt--; /* lose final . */
+tt--; /* lose final separator */
if (mask < 0)
*tt = 0;
-/* $Cambridge: exim/src/src/verify.c,v 1.5 2004/11/12 16:54:55 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.6 2004/11/18 11:17:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Adjust parameters for the type of lookup. For a query-style
lookup, there is no file name, and the "key" is just 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. */
+ appropriately, and reconverted to text form, with the mask appended.
+ For IPv6 addresses, specify dot separators instead of colons. */
if (mac_islookup(search_type, lookup_querystyle))
{
{
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, '.');
key = buffer;
filename = semicolon + 1;
}