Make $router_name usable from transport
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 26 Mar 2023 15:17:16 +0000 (16:17 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 26 Mar 2023 15:18:07 +0000 (16:18 +0100)
doc/doc-docbook/spec.xfpt
src/src/deliver.c
test/confs/0143
test/stderr/0143

index fed13f23db311f923a3c0d3bd2a124f2293b2e0c..8055daebeb5f9c0b170649f3edb8f427655fe29b 100644 (file)
@@ -13450,7 +13450,8 @@ This is an obsolete name for &$bounce_return_size_limit$&.
 .cindex "router" "name"
 .cindex "name" "of router"
 .vindex "&$router_name$&"
-During the running of a router this variable contains its name.
+During the running of a router, or a transport called,
+this variable contains the router name.
 
 .vitem &$runrc$&
 .cindex "return code" "from &%run%& expansion"
index f3a406990de0d66bb73a1782bb6917e54daafdca..ad045c8cc5d2a8470389b2195f1cd1f1c476db60 100644 (file)
@@ -2371,7 +2371,9 @@ if ((pid = exim_fork(US"delivery-local")) == 0)
      addr->local_part, tp->name);
 
     /* Setting these globals in the subprocess means we need never clear them */
-    transport_name = addr->transport->name;
+
+    transport_name = tp->name;
+    if (addr->router) router_name = addr->router->name;
     driver_srcfile = tp->srcfile;
     driver_srcline = tp->srcline;
 
@@ -4663,7 +4665,9 @@ all pipes, so I do not see a reason to use non-blocking IO here
     host_item *h;
 
     /* Setting these globals in the subprocess means we need never clear them */
-    transport_name = addr->transport->name;
+
+    transport_name = tp->name;
+    if (addr->router) router_name = addr->router->name;
     driver_srcfile = tp->srcfile;
     driver_srcline = tp->srcline;
 
index 8f0300aa09451bbcbd601348dbe61790ccb2e240..f451be3940107fe2618e5af4f7fab986814e74a9 100644 (file)
@@ -32,7 +32,7 @@ my_smtp:
   interface = HOSTIPV4
   port = PORT_S
   hosts_try_fastopen = :
-  debug_print = transport_name <$transport_name>
+  debug_print = transport_name <$transport_name> from router <$router_name>
 
 
 # End
index 158e97d53b1edc71ee6c526ea3721c61c4e1ac16..9feb83a4b6ab17f9b34b41455e60359528628d19 100644 (file)
@@ -12,7 +12,7 @@ dropping to exim gid; retaining priv uid
 router_name <my_main_router>
 >>>>>>>>>>>>>>>> Remote deliveries >>>>>>>>>>>>>>>>
 --------> userx@domain.com <--------
-transport_name <my_smtp>
+transport_name <my_smtp> from router <my_main_router>
 my_smtp transport entered
   userx@domain.com
 hostlist: