-/* $Cambridge: exim/src/src/verify.c,v 1.7 2004/11/22 11:30:04 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.12 2005/01/12 15:41:27 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2004 */
+/* Copyright (c) University of Cambridge 1995 - 2005 */
/* See the file NOTICE for conditions of use and distribution. */
/* Functions concerned with verifying things. The original code for callout
for (host = host_list; host != NULL; host = nexthost)
{
nexthost = host->next;
- if (tf.gethostbyname || string_is_ip_address(host->name, NULL))
+ if (tf.gethostbyname ||
+ string_is_ip_address(host->name, NULL) > 0)
(void)host_find_byname(host, NULL, &canonical_name, TRUE);
else
{
want to continue to verify the new child. */
if (rc == REROUTED) continue;
-
+
/* Handle hard failures */
if (rc == FAIL)
}
}
- /* Else go ahead with the sender verification. But is isn't *the*
+ /* Else go ahead with the sender verification. But it isn't *the*
sender of the message, so set vopt_fake_sender to stop sender_address
being replaced after rewriting or qualification. */
/* If the pattern is an IP address, optionally followed by a bitmask count, do
a (possibly masked) comparision with the current IP address. */
-if (string_is_ip_address(ss, &maskoffset))
+if (string_is_ip_address(ss, &maskoffset) > 0)
return (host_is_in_net(cb->host_address, ss, maskoffset)? OK : FAIL);
/* If the item is of the form net[n]-lookup;<file|query> then it is a lookup on
else
{
int keysep = 0;
+ BOOL defer = FALSE;
uschar *keydomain;
uschar keybuffer[256];
while ((keydomain = string_nextinlist(&key, &keysep, keybuffer,
sizeof(keybuffer))) != NULL)
{
- if (string_is_ip_address(keydomain, NULL))
+ if (string_is_ip_address(keydomain, NULL) > 0)
{
uschar keyrevadd[128];
invert_address(keyrevadd, keydomain);
dnslist_domain = string_copy(domain);
HDEBUG(D_dnsbl) debug_printf("=> that means %s is listed at %s\n",
keydomain, domain);
+ return OK;
}
- if (rc != FAIL) return rc; /* OK or DEFER */
+ /* If the lookup deferred, remember this fact. We keep trying the rest
+ of the list to see if we get a useful result, and if we don't, we return
+ DEFER at the end. */
+ if (rc == DEFER) defer = TRUE;
} /* continue with next keystring domain/address */
+
+ if (defer) return DEFER;
}
} /* continue with next dnsdb outer domain */