Added timeout setting to transport filter. Fixes: #614
[exim.git] / src / src / transports / smtp.c
index 4e1f3c45b76e4de3e90d913db8f8c72a43f9859a..e56093f4d8a9b5fec7d696cc1ab356cc64185064 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/transports/smtp.c,v 1.39 2008/03/05 21:13:23 tom Exp $ */
+/* $Cambridge: exim/src/src/transports/smtp.c,v 1.41 2009/01/02 17:22:12 nm4 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -1382,6 +1382,7 @@ if (tblock->filter_command != NULL)
   sprintf(CS buffer, "%.50s transport", tblock->name);
   rc = transport_set_up_command(&transport_filter_argv, tblock->filter_command,
     TRUE, DEFER, addrlist, buffer, NULL);
+  transport_filter_timeout = tblock->filter_timeout;
 
   /* On failure, copy the error to all addresses, abandon the SMTP call, and
   yield ERROR. */
@@ -2264,6 +2265,15 @@ if (hostlist == NULL || (ob->hosts_override && ob->hosts != NULL))
 
     host_build_hostlist(&hostlist, s, ob->hosts_randomize);
 
+    /* Check that the expansion yielded something useful. */
+    if (hostlist == NULL)
+      {
+      addrlist->message =
+        string_sprintf("%s transport has empty hosts setting", tblock->name);
+      addrlist->transport_return = PANIC;
+      return FALSE;   /* Only top address has status */
+      }
+
     /* If there was no expansion of hosts, save the host list for
     next time. */