Add tls_verify_hosts and tls_try_verify_hosts to smtp transport. Bug 1371
[exim.git] / src / src / route.c
index 346a7c6a72c5cdf5f17c1a7054d922cab49bbd32..c83233e978e468e552b1e8be7e596a80e7e47786 100644 (file)
@@ -1,10 +1,8 @@
-/* $Cambridge: exim/src/src/route.c,v 1.14 2009/11/16 19:50:37 nm4 Exp $ */
-
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2009 */
+/* Copyright (c) University of Cambridge 1995 - 2013 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions concerned with routing, and the list of generic router options. */
@@ -50,7 +48,7 @@ optionlist optionlist_routers[] = {
                  (void *)(offsetof(router_instance, caseful_local_part)) },
   { "check_local_user",   opt_bool | opt_public,
                  (void *)(offsetof(router_instance, check_local_user)) },
-  { "condition",          opt_stringptr|opt_public,
+  { "condition",          opt_stringptr|opt_public|opt_rep_con,
                  (void *)offsetof(router_instance, condition) },
   { "debug_print",        opt_stringptr | opt_public,
                  (void *)offsetof(router_instance, debug_string) },
@@ -74,9 +72,9 @@ optionlist optionlist_routers[] = {
                  (void *)offsetof(router_instance, fallback_hosts) },
   { "group",              opt_expand_gid | opt_public,
                  (void *)(offsetof(router_instance, gid)) },
-  { "headers_add",        opt_stringptr|opt_public,
+  { "headers_add",        opt_stringptr|opt_public|opt_rep_str,
                  (void *)offsetof(router_instance, extra_headers) },
-  { "headers_remove",     opt_stringptr|opt_public,
+  { "headers_remove",     opt_stringptr|opt_public|opt_rep_str,
                  (void *)offsetof(router_instance, remove_headers) },
   { "ignore_target_hosts",opt_stringptr|opt_public,
                  (void *)offsetof(router_instance, ignore_target_hosts) },
@@ -1635,6 +1633,7 @@ for (r = (addr->start_router == NULL)? routers : addr->start_router;
   /* Set the expansion variables now that we have the affixes and the case of
   the local part sorted. */
 
+  router_name = r->name;
   deliver_set_expansions(addr);
 
   /* For convenience, the pre-router checks are in a separate function, which
@@ -1642,6 +1641,7 @@ for (r = (addr->start_router == NULL)? routers : addr->start_router;
 
   if ((rc = check_router_conditions(r, addr, verify, &pw, &error)) != OK)
     {
+    router_name = NULL;
     if (rc == SKIP) continue;
     addr->message = error;
     yield = rc;
@@ -1680,6 +1680,7 @@ for (r = (addr->start_router == NULL)? routers : addr->start_router;
           {
           DEBUG(D_route)
             debug_printf("\"more\"=false: skipping remaining routers\n");
+         router_name = NULL;
           r = NULL;
           break;
           }
@@ -1723,6 +1724,8 @@ for (r = (addr->start_router == NULL)? routers : addr->start_router;
   yield = (r->info->code)(r, addr, pw, verify, paddr_local, paddr_remote,
     addr_new, addr_succeed);
 
+  router_name = NULL;
+
   if (yield == FAIL)
     {
     HDEBUG(D_route) debug_printf("%s router forced address failure\n", r->name);
@@ -1958,6 +1961,9 @@ if (yield == DEFER) {
     (
       Ustrstr(addr->message, "mysql") != NULL ||
       Ustrstr(addr->message, "pgsql") != NULL ||
+#ifdef EXPERIMENTAL_REDIS
+      Ustrstr(addr->message, "redis") != NULL ||
+#endif
       Ustrstr(addr->message, "sqlite") != NULL ||
       Ustrstr(addr->message, "ldap:") != NULL ||
       Ustrstr(addr->message, "ldapdn:") != NULL ||
@@ -1969,6 +1975,7 @@ if (yield == DEFER) {
 }
 
 deliver_set_expansions(NULL);
+router_name = NULL;
 disable_logging = FALSE;
 return yield;
 }