(2) Some old tests needed tweaking because of previous changes.
(3) Comment added to EDITME re USE_READLINE.
-/* $Cambridge: exim/src/exim_monitor/em_globals.c,v 1.4 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/exim_monitor/em_globals.c,v 1.5 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim Monitor *
header_line *header_last = NULL;
header_line *header_list = NULL;
+BOOL host_lookup_deferred = FALSE;
BOOL host_lookup_failed = FALSE;
uschar *interface_address = NULL;
int interface_port = 0;
-# $Cambridge: exim/src/src/EDITME,v 1.6 2004/12/17 14:52:44 ph10 Exp $
+# $Cambridge: exim/src/src/EDITME,v 1.7 2005/01/25 14:16:33 ph10 Exp $
##################################################
# The Exim mail transport agent #
# USE_READLINE=yes
+# You may need to add -ldl to EXTRA_LIBS when you set USE_READLINE=yes.
+# Note that this option adds to the size of the Exim binary, because the
+# dynamic loading library is not otherwise included.
+
###############################################################################
-/* $Cambridge: exim/src/src/expand.c,v 1.11 2005/01/13 10:09:36 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.12 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
{ "host", vtype_stringptr, &deliver_host },
{ "host_address", vtype_stringptr, &deliver_host_address },
{ "host_data", vtype_stringptr, &host_data },
+ { "host_lookup_deferred",vtype_int, &host_lookup_deferred },
{ "host_lookup_failed", vtype_int, &host_lookup_failed },
{ "inode", vtype_ino, &deliver_inode },
{ "interface_address", vtype_stringptr, &interface_address },
-/* $Cambridge: exim/src/src/globals.c,v 1.14 2005/01/12 14:41:12 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.15 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *host_data = NULL;
BOOL host_find_failed_syntax= FALSE;
uschar *host_lookup = NULL;
+BOOL host_lookup_deferred = FALSE;
BOOL host_lookup_failed = FALSE;
uschar *host_lookup_order = US"bydns:byaddr";
uschar *host_lookup_msg = US"";
-/* $Cambridge: exim/src/src/globals.h,v 1.10 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.11 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
extern BOOL host_checking_callout; /* TRUE if real callout wanted */
extern uschar *host_data; /* Obtained from lookup in ACL */
extern uschar *host_lookup; /* For which IP addresses are always looked up */
+extern BOOL host_lookup_deferred; /* TRUE if lookup deferred */
extern BOOL host_lookup_failed; /* TRUE if lookup failed */
extern uschar *host_lookup_order; /* Order of host lookup types */
extern uschar *host_lookup_msg; /* Text for why it failed */
-/* $Cambridge: exim/src/src/host.c,v 1.7 2005/01/12 12:17:41 ph10 Exp $ */
+/* $Cambridge: exim/src/src/host.c,v 1.8 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
The variable host_lookup_msg is set to an empty string on sucess, or to a
reason for the failure otherwise, in a form suitable for tagging onto an error
-message, and also host_lookup_failed is set TRUE if the lookup failed. Any
-dynamically constructed string for host_lookup_msg must be in permanent store,
-because it might be used for several incoming messages on the same SMTP
+message, and also host_lookup_failed is set TRUE if the lookup failed. If there
+was a defer, host_lookup_deferred is set TRUE.
+
+Any dynamically constructed string for host_lookup_msg must be in permanent
+store, because it might be used for several incoming messages on the same SMTP
connection. */
int
dns_answer dnsa;
dns_scan dnss;
+host_lookup_deferred = host_lookup_failed = FALSE;
+
HDEBUG(D_host_lookup)
debug_printf("looking up host name for %s\n", sender_host_address);
{
HDEBUG(D_host_lookup)
debug_printf("Test harness: host name lookup returns DEFER\n");
+ host_lookup_deferred = TRUE;
return DEFER;
}
{
HDEBUG(D_host_lookup)
debug_printf("IP address PTR lookup gave temporary error\n");
+ host_lookup_deferred = TRUE;
return DEFER;
}
}
{
HDEBUG(D_host_lookup)
debug_printf("IP address lookup using gethostbyaddr()\n");
-
rc = host_name_lookup_byaddr();
- if (rc == DEFER) return rc; /* Can't carry on */
+ if (rc == DEFER)
+ {
+ host_lookup_deferred = TRUE;
+ return rc; /* Can't carry on */
+ }
if (rc == OK) break; /* Found a name */
}
} /* Loop for bydns/byaddr scanning */
log_write(L_host_lookup_failed, LOG_MAIN, "no host name found for IP "
"address %s", sender_host_address);
host_lookup_msg = US" (failed to find host name from IP address)";
-
-host_lookup_failed = TRUE;
+ host_lookup_failed = TRUE;
return FAIL;
}
else if (rc == HOST_FIND_AGAIN)
{
HDEBUG(D_host_lookup) debug_printf("temporary error for host name lookup\n");
+ host_lookup_deferred = TRUE;
return DEFER;
}
else
host_lookup_msg = string_sprintf(" (%s does not match any IP address for %s)",
sender_host_address, save_hostname);
store_pool = old_pool;
-
host_lookup_failed = TRUE;
return FAIL;
}
uschar **addrlist;
host_item *last = NULL;
BOOL temp_error = FALSE;
+#if HAVE_IPV6
+int af;
+#endif
+
+/* If we are in the test harness, a name ending in .test.again.dns always
+forces a temporary error response. */
+
+if (running_in_test_harness)
+ {
+ uschar *endname = host->name + Ustrlen(host->name);
+ if (Ustrcmp(endname - 14, "test.again.dns") == 0)
+ return HOST_FIND_AGAIN;
+ }
/* In an IPv6 world, we need to scan for both kinds of address, so go round the
loop twice. Note that we have ensured that AF_INET6 is defined even in an IPv4
standalone). */
#if HAVE_IPV6
- int af;
-
#ifndef STAND_ALONE
if (dns_ipv4_lookup != NULL &&
match_isinlist(host->name, &dns_ipv4_lookup, 0, NULL, NULL, MCL_DOMAIN,
-/* $Cambridge: exim/src/src/spool_in.c,v 1.5 2005/01/12 12:24:13 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.6 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
deliver_manual_thaw = FALSE;
/* dont_deliver must NOT be reset */
header_list = header_last = NULL;
+host_lookup_deferred = FALSE;
host_lookup_failed = FALSE;
interface_address = NULL;
interface_port = 0;
else if (Ustrncmp(big_buffer, "-bmi_verdicts ", 14) == 0)
bmi_verdicts = string_copy(big_buffer + 14);
#endif
+ else if (Ustrcmp(big_buffer, "-host_lookup_deferred") == 0)
+ host_lookup_deferred = TRUE;
else if (Ustrcmp(big_buffer, "-host_lookup_failed") == 0)
host_lookup_failed = TRUE;
else if (Ustrncmp(big_buffer, "-body_linecount", 15) == 0)
-/* $Cambridge: exim/src/src/spool_out.c,v 1.4 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_out.c,v 1.5 2005/01/25 14:16:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (deliver_firsttime) fprintf(f, "-deliver_firsttime\n");
if (deliver_freeze) fprintf(f, "-frozen %d\n", deliver_frozen_at);
if (dont_deliver) fprintf(f, "-N\n");
+if (host_lookup_deferred) fprintf(f, "-host_lookup_deferred\n");
if (host_lookup_failed) fprintf(f, "-host_lookup_failed\n");
if (sender_local) fprintf(f, "-local\n");
if (local_error_message) fprintf(f, "-localerror\n");