-/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.6 2005/12/05 14:38:18 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2009 */
/* See the file NOTICE for conditions of use and distribution. */
uschar *domain = addr->domain;
uschar *ip;
int len = Ustrlen(domain);
-int rc;
+int rc, ipv;
addr_new = addr_new; /* Keep picky compilers happy */
addr_succeed = addr_succeed;
if (strncmpic(ip, US"IPV6:", 5) == 0 || strncmpic(ip, US"IPV4:", 5) == 0)
ip += 5;
-if (string_is_ip_address(ip, NULL) == 0)
+ipv = string_is_ip_address(ip, NULL);
+if (ipv == 0 || (disable_ipv6 && ipv == 6))
{
domain[len-1] = ']';
return DECLINE;