Make $router_name usable from transport
[exim.git] / src / src / deliver.c
index e2994b116615ab4a074e50472e27a7a88ae4bcbf..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;
 
@@ -5954,7 +5958,7 @@ wording. */
 
     tctx.u.fd = fileno(fp);
     tctx.tblock = &tb;
-    tctx.options = topt;
+    tctx.options = topt | topt_truncate_headers;
     tb.add_headers = dsnnotifyhdr;
 
     /*XXX no checking for failure!  buggy! */
@@ -6172,7 +6176,7 @@ fprintf(f, "--%s\n"
 fflush(f);
 /* header only as required by RFC. only failure DSN needs to honor RET=FULL */
 tctx.u.fd = fileno(f);
-tctx.options = topt_add_return_path | topt_no_body;
+tctx.options = topt_add_return_path | topt_truncate_headers | topt_no_body;
 transport_filter_argv = NULL;   /* Just in case */
 return_path = sender_address;   /* In case not previously set */
 
@@ -6333,7 +6337,7 @@ if (addr_senddsn)
     /* Write the original email out */
 
     tctx.u.fd = fd;
-    tctx.options = topt_add_return_path | topt_no_body;
+    tctx.options = topt_add_return_path | topt_truncate_headers | topt_no_body;
     /*XXX hmm, FALSE(fail) retval ignored.
     Could error for any number of reasons, and they are not handled. */
     transport_write_message(&tctx, 0);