Rename feature to "Transport Post-Delivery Actions"
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 21 Jul 2013 19:08:02 +0000 (20:08 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 21 Jul 2013 20:30:36 +0000 (21:30 +0100)
18 files changed:
doc/doc-txt/experimental-spec.txt
src/src/EDITME
src/src/config.h.defaults
src/src/deliver.c
src/src/exim.c
src/src/expand.c
src/src/globals.c
src/src/globals.h
src/src/structs.h
src/src/transport.c
src/src/transports/smtp.c
src/src/transports/smtp.h
test/confs/5700
test/scripts/5700-deliv-log/5700 [deleted file]
test/scripts/5700-deliv-log/REQUIRES [deleted file]
test/scripts/5700-tpt-post-dlv-action/5700 [new file with mode: 0644]
test/scripts/5700-tpt-post-dlv-action/REQUIRES [new file with mode: 0644]
test/stdout/0390

index a7651f6c0b27665d0c00ab3c7e6e21567a6061bc..04fd5d35c55e900e11e819aa8cbf38fb40b76f4f 100644 (file)
@@ -844,56 +844,55 @@ b. Configure, somewhere before the DATA ACL, the control option to
 
 
 
 
 
 
-DBL (Database Logging)
+Transport post-delivery actions
 --------------------------------------------------------------
 
 An arbitrary per-transport string can be expanded on successful delivery,
 and (for SMTP transports) a second string on deferrals caused by a host error.
 --------------------------------------------------------------
 
 An arbitrary per-transport string can be expanded on successful delivery,
 and (for SMTP transports) a second string on deferrals caused by a host error.
-This feature allows the writing of exim internal log information
+This feature may be used, for example, to write exim internal log information
 (not available otherwise) into a database. 
 
 (not available otherwise) into a database. 
 
-In order to use DBL, you must set
+In order to use the feature, you must set
 
 
-EXPERIMENTAL_DBL=yes
+EXPERIMENTAL_TPDA=yes
 
 in your Local/Makefile
 
 and define the expandable strings in the runtime config file, to
 be executed at end of delivery.
 
 
 in your Local/Makefile
 
 and define the expandable strings in the runtime config file, to
 be executed at end of delivery.
 
-Additionally, there are 8 more variables, available at end of
+Additionally, there are 6 more variables, available at end of
 delivery:
 
 delivery:
 
-dbl_delivery_ip             IP of host, which has accepted delivery
-dbl_delivery_port           Port of remote host which has accepted delivery
-dbl_delivery_fqdn           FQDN of host, which has accepted delivery
-dbl_delivery_local_part     local part of address being delivered
-dbl_delivery_domain         domain part of address being delivered
-dbl_delivery_confirmation   SMTP confirmation message
-router_name                 name of router
-transport_name              name of transport
+tpda_delivery_ip             IP of host, which has accepted delivery
+tpda_delivery_port           Port of remote host which has accepted delivery
+tpda_delivery_fqdn           FQDN of host, which has accepted delivery
+tpda_delivery_local_part     local part of address being delivered
+tpda_delivery_domain         domain part of address being delivered
+tpda_delivery_confirmation   SMTP confirmation message
 
 In case of a deferral caused by a host-error:
 
 In case of a deferral caused by a host-error:
-dbl_defer_errno             Error number
-dbl_defer_errstr            Error string possibly containing more details
+tpda_defer_errno             Error number
+tpda_defer_errstr            Error string possibly containing more details
 
 
+The $router_name and $transport_name variables are also usable.
 
 
 
 
-To log successful deliveries, set the following option
+To take action after successful deliveries, set the following option
 on any transport of interest.
 
 on any transport of interest.
 
-dbl_delivery_query
+tpda_delivery_action
 
 An example might look like:
 
 
 An example might look like:
 
-dbl_delivery_query = \
+tpda_delivery_action = \
 ${lookup pgsql {SELECT * FROM record_Delivery( \
     '${quote_pgsql:$sender_address_domain}',\
     '${quote_pgsql:${lc:$sender_address_local_part}}', \
 ${lookup pgsql {SELECT * FROM record_Delivery( \
     '${quote_pgsql:$sender_address_domain}',\
     '${quote_pgsql:${lc:$sender_address_local_part}}', \
-    '${quote_pgsql:$dbl_delivery_domain}', \
-    '${quote_pgsql:${lc:$dbl_delivery_local_part}}', \
-    '${quote_pgsql:$dbl_delivery_ip}', \
-    '${quote_pgsql:${lc:$dbl_delivery_fqdn}}', \
+    '${quote_pgsql:$tpda_delivery_domain}', \
+    '${quote_pgsql:${lc:$tpda_delivery_local_part}}', \
+    '${quote_pgsql:$tpda_delivery_ip}', \
+    '${quote_pgsql:${lc:$tpda_delivery_fqdn}}', \
     '${quote_pgsql:$message_exim_id}')}}
 
 The string is expanded after the delivery completes and any
     '${quote_pgsql:$message_exim_id}')}}
 
 The string is expanded after the delivery completes and any
@@ -904,7 +903,7 @@ Note that for complex operations an ACL expansion can be used.
 In order to log host deferrals, add the following option to an SMTP
 transport:
 
 In order to log host deferrals, add the following option to an SMTP
 transport:
 
-dbl_host_defer_query
+tpda_host_defer_action
 
 This is a private option of the SMTP transport. It is intended to
 log failures of remote hosts. It is executed only when exim has
 
 This is a private option of the SMTP transport. It is intended to
 log failures of remote hosts. It is executed only when exim has
@@ -916,18 +915,18 @@ this is determined.
 
 Example:
 
 
 Example:
 
-dbl_host_defer_query = \
+tpda_host_defer_action = \
 ${lookup mysql {insert into delivlog set \
     msgid = '${quote_mysql:$message_exim_id}', \
     senderlp = '${quote_mysql:${lc:$sender_address_local_part}}', \
     senderdom = '${quote_mysql:$sender_address_domain}', \
 ${lookup mysql {insert into delivlog set \
     msgid = '${quote_mysql:$message_exim_id}', \
     senderlp = '${quote_mysql:${lc:$sender_address_local_part}}', \
     senderdom = '${quote_mysql:$sender_address_domain}', \
-    delivlp = '${quote_mysql:${lc:$dbl_delivery_local_part}}', \
-    delivdom = '${quote_mysql:$dbl_delivery_domain}', \
-    delivip = '${quote_mysql:$dbl_delivery_ip}', \
-    delivport = '${quote_mysql:$dbl_delivery_port}', \
-    delivfqdn = '${quote_mysql:$dbl_delivery_fqdn}', \
-    deliverrno = '${quote_mysql:$dbl_defer_errno}', \
-    deliverrstr = '${quote_mysql:$dbl_defer_errstr}' \
+    delivlp = '${quote_mysql:${lc:$tpda_delivery_local_part}}', \
+    delivdom = '${quote_mysql:$tpda_delivery_domain}', \
+    delivip = '${quote_mysql:$tpda_delivery_ip}', \
+    delivport = '${quote_mysql:$tpda_delivery_port}', \
+    delivfqdn = '${quote_mysql:$tpda_delivery_fqdn}', \
+    deliverrno = '${quote_mysql:$tpda_defer_errno}', \
+    deliverrstr = '${quote_mysql:$tpda_defer_errstr}' \
     }}
 
 --------------------------------------------------------------
     }}
 
 --------------------------------------------------------------
index 637256c7ddf518b330ce0cf2ab812c86c1f97852..1db70f7157a1506677337ff4c4e9ac8c563a80ac 100644 (file)
@@ -469,9 +469,9 @@ EXIM_MONITOR=eximon.bin
 # Uncomment the following line to add Per-Recipient-Data-Response support.
 # EXPERIMENTAL_PRDR=yes
 
 # Uncomment the following line to add Per-Recipient-Data-Response support.
 # EXPERIMENTAL_PRDR=yes
 
-# This feature allows to write log information about a completed
-#  delivery into a database
-# EXPERIMENTAL_DBL=yes
+# Uncomment the following line to support Transport post-delivery actions,
+# eg. for logging to a database.
+# EXPERIMENTAL_TPDA=yes
 
 
 ###############################################################################
 
 
 ###############################################################################
index bcbc70b389d9fc8d9a6aa4fee876bc29de8a5f13..bf7ac63fb917e91000fd2e4e62a635b26fe22ac8 100644 (file)
@@ -170,7 +170,7 @@ it's a default value. */
 #define EXPERIMENTAL_PRDR
 #define EXPERIMENTAL_SPF
 #define EXPERIMENTAL_SRS
 #define EXPERIMENTAL_PRDR
 #define EXPERIMENTAL_SPF
 #define EXPERIMENTAL_SRS
-#define EXPERIMENTAL_DBL
+#define EXPERIMENTAL_TPDA
 
 /* For developers */
 #define WANT_DEEPER_PRINTF_CHECKS
 
 /* For developers */
 #define WANT_DEEPER_PRINTF_CHECKS
index 5e4a2a1e17ddde8d719f5e442c070b960eda670c..a3030b5f023068d5b05a655194b107b69bf4fc77 100644 (file)
@@ -695,13 +695,13 @@ the log line, and reset the store afterwards. Remote deliveries should always
 have a pointer to the host item that succeeded; local deliveries can have a
 pointer to a single host item in their host list, for use by the transport. */
 
 have a pointer to the host item that succeeded; local deliveries can have a
 pointer to a single host item in their host list, for use by the transport. */
 
-#ifdef EXPERIMENTAL_DBL
-  dbl_delivery_ip = NULL;      /* presume no successful remote delivery */
-  dbl_delivery_port = 0;
-  dbl_delivery_fqdn = NULL;
-  dbl_delivery_local_part = NULL;
-  dbl_delivery_domain = NULL;
-  dbl_delivery_confirmation = NULL;
+#ifdef EXPERIMENTAL_TPDA
+  tpda_delivery_ip = NULL;     /* presume no successful remote delivery */
+  tpda_delivery_port = 0;
+  tpda_delivery_fqdn = NULL;
+  tpda_delivery_local_part = NULL;
+  tpda_delivery_domain = NULL;
+  tpda_delivery_confirmation = NULL;
 #endif
 
 s = reset_point = store_get(size);
 #endif
 
 s = reset_point = store_get(size);
@@ -752,8 +752,8 @@ if (addr->transport->info->local)
   if (addr->host_list != NULL)
     {
     s = string_append(s, &size, &ptr, 2, US" H=", addr->host_list->name);
   if (addr->host_list != NULL)
     {
     s = string_append(s, &size, &ptr, 2, US" H=", addr->host_list->name);
-    #ifdef EXPERIMENTAL_DBL
-      dbl_delivery_fqdn = addr->host_list->name;
+    #ifdef EXPERIMENTAL_TPDA
+      tpda_delivery_fqdn = addr->host_list->name;
     #endif
     }
   if (addr->shadow_message != NULL)
     #endif
     }
   if (addr->shadow_message != NULL)
@@ -775,13 +775,13 @@ else
     if (continue_sequence > 1)
       s = string_cat(s, &size, &ptr, US"*", 1);
 
     if (continue_sequence > 1)
       s = string_cat(s, &size, &ptr, US"*", 1);
 
-    #ifdef EXPERIMENTAL_DBL
-    dbl_delivery_ip =           addr->host_used->address;
-    dbl_delivery_port =         addr->host_used->port;
-    dbl_delivery_fqdn =         addr->host_used->name;
-    dbl_delivery_local_part =   addr->local_part;
-    dbl_delivery_domain =       addr->domain;
-    dbl_delivery_confirmation = addr->message;
+    #ifdef EXPERIMENTAL_TPDA
+    tpda_delivery_ip =           addr->host_used->address;
+    tpda_delivery_port =         addr->host_used->port;
+    tpda_delivery_fqdn =         addr->host_used->name;
+    tpda_delivery_local_part =   addr->local_part;
+    tpda_delivery_domain =       addr->domain;
+    tpda_delivery_confirmation = addr->message;
     #endif
     }
 
     #endif
     }
 
@@ -851,17 +851,16 @@ store we used to build the line after writing it. */
 s[ptr] = 0;
 log_write(0, flags, "%s", s);
 
 s[ptr] = 0;
 log_write(0, flags, "%s", s);
 
-#ifdef EXPERIMENTAL_DBL
-if (addr->transport->dbl_delivery_query)
+#ifdef EXPERIMENTAL_TPDA
+if (addr->transport->tpda_delivery_action)
   {
   DEBUG(D_deliver)
   {
   DEBUG(D_deliver)
-    {
-    debug_printf("  DBL(Delivery): dbl_delivery_query=|%s| dbl_delivery_IP=%s\n",
-      addr->transport->dbl_delivery_query, dbl_delivery_ip);
-    }
+    debug_printf("  TPDA(Delivery): tpda_deliver_action=|%s| tpda_delivery_IP=%s\n",
+      addr->transport->tpda_delivery_action, tpda_delivery_ip);
+
   router_name =    addr->router->name;
   transport_name = addr->transport->name;
   router_name =    addr->router->name;
   transport_name = addr->transport->name;
-  expand_string(addr->transport->dbl_delivery_query);
+  expand_string(addr->transport->tpda_delivery_action);
   router_name = NULL;
   transport_name = NULL;
   }
   router_name = NULL;
   transport_name = NULL;
   }
index 1d3d327232902d31ce9cd049910a4dcbd1e8890a..c5053ba7cecf6317ca4d8fb2c748cd4ff50cc823 100644 (file)
@@ -825,8 +825,8 @@ fprintf(f, "Support for:");
 #ifdef EXPERIMENTAL_PRDR
   fprintf(f, " Experimental_PRDR");
 #endif
 #ifdef EXPERIMENTAL_PRDR
   fprintf(f, " Experimental_PRDR");
 #endif
-#ifdef EXPERIMENTAL_DBL
-  fprintf(f, " Experimental_DBL");
+#ifdef EXPERIMENTAL_TPDA
+  fprintf(f, " Experimental_TPDA");
 #endif
 fprintf(f, "\n");
 
 #endif
 fprintf(f, "\n");
 
index d808d1bf3a90636930123f86586c917b28d0ce06..ec60082e1ebbef105e874595f5759c7772a2df2f 100644 (file)
@@ -431,16 +431,6 @@ static var_entry var_table[] = {
   { "compile_date",        vtype_stringptr,   &version_date },
   { "compile_number",      vtype_stringptr,   &version_cnumber },
   { "csa_status",          vtype_stringptr,   &csa_status },
   { "compile_date",        vtype_stringptr,   &version_date },
   { "compile_number",      vtype_stringptr,   &version_cnumber },
   { "csa_status",          vtype_stringptr,   &csa_status },
-#ifdef EXPERIMENTAL_DBL
-  { "dbl_defer_errno",     vtype_int,         &dbl_defer_errno },
-  { "dbl_defer_errstr",    vtype_stringptr,   &dbl_defer_errstr },
-  { "dbl_delivery_confirmation", vtype_stringptr,   &dbl_delivery_confirmation },
-  { "dbl_delivery_domain", vtype_stringptr,   &dbl_delivery_domain },
-  { "dbl_delivery_fqdn",   vtype_stringptr,   &dbl_delivery_fqdn },
-  { "dbl_delivery_ip",     vtype_stringptr,   &dbl_delivery_ip },
-  { "dbl_delivery_local_part",vtype_stringptr,&dbl_delivery_local_part },
-  { "dbl_delivery_port",   vtype_int,         &dbl_delivery_port },
-#endif
 #ifdef EXPERIMENTAL_DCC
   { "dcc_header",          vtype_stringptr,   &dcc_header },
   { "dcc_result",          vtype_stringptr,   &dcc_result },
 #ifdef EXPERIMENTAL_DCC
   { "dcc_header",          vtype_stringptr,   &dcc_header },
   { "dcc_result",          vtype_stringptr,   &dcc_result },
@@ -686,6 +676,16 @@ static var_entry var_table[] = {
   { "tod_logfile",         vtype_todlf,       NULL },
   { "tod_zone",            vtype_todzone,     NULL },
   { "tod_zulu",            vtype_todzulu,     NULL },
   { "tod_logfile",         vtype_todlf,       NULL },
   { "tod_zone",            vtype_todzone,     NULL },
   { "tod_zulu",            vtype_todzulu,     NULL },
+#ifdef EXPERIMENTAL_TPDA
+  { "tpda_defer_errno",     vtype_int,         &tpda_defer_errno },
+  { "tpda_defer_errstr",    vtype_stringptr,   &tpda_defer_errstr },
+  { "tpda_delivery_confirmation", vtype_stringptr,   &tpda_delivery_confirmation },
+  { "tpda_delivery_domain", vtype_stringptr,   &tpda_delivery_domain },
+  { "tpda_delivery_fqdn",   vtype_stringptr,   &tpda_delivery_fqdn },
+  { "tpda_delivery_ip",     vtype_stringptr,   &tpda_delivery_ip },
+  { "tpda_delivery_local_part",vtype_stringptr,&tpda_delivery_local_part },
+  { "tpda_delivery_port",   vtype_int,         &tpda_delivery_port },
+#endif
   { "transport_name",      vtype_stringptr,   &transport_name },
   { "value",               vtype_stringptr,   &lookup_value },
   { "version_number",      vtype_stringptr,   &version_string },
   { "transport_name",      vtype_stringptr,   &transport_name },
   { "value",               vtype_stringptr,   &lookup_value },
   { "version_number",      vtype_stringptr,   &version_string },
index 2345ac4e18642e086fa975492cb6ff34a0062082..38c1ac08b591767ea55fdaa062b3b01d2f34c8cf 100644 (file)
@@ -483,17 +483,6 @@ uschar *daemon_smtp_port       = US"smtp";
 int     daemon_startup_retries = 9;
 int     daemon_startup_sleep   = 30;
 
 int     daemon_startup_retries = 9;
 int     daemon_startup_sleep   = 30;
 
-#ifdef EXPERIMENTAL_DBL
-int     dbl_defer_errno        = 0;
-uschar *dbl_defer_errstr       = NULL;
-uschar *dbl_delivery_ip        = NULL;
-int     dbl_delivery_port      = 0;
-uschar *dbl_delivery_fqdn      = NULL;
-uschar *dbl_delivery_local_part= NULL;
-uschar *dbl_delivery_domain    = NULL;
-uschar *dbl_delivery_confirmation = NULL;
-#endif
-
 #ifdef EXPERIMENTAL_DCC
 BOOL    dcc_direct_add_header  = FALSE;
 uschar *dcc_header             = NULL;
 #ifdef EXPERIMENTAL_DCC
 BOOL    dcc_direct_add_header  = FALSE;
 uschar *dcc_header             = NULL;
@@ -1290,6 +1279,17 @@ int     thismessage_size_limit = 0;
 int     timeout_frozen_after   = 0;
 BOOL    timestamps_utc         = FALSE;
 
 int     timeout_frozen_after   = 0;
 BOOL    timestamps_utc         = FALSE;
 
+#ifdef EXPERIMENTAL_TPDA
+int     tpda_defer_errno        = 0;
+uschar *tpda_defer_errstr       = NULL;
+uschar *tpda_delivery_ip        = NULL;
+int     tpda_delivery_port      = 0;
+uschar *tpda_delivery_fqdn      = NULL;
+uschar *tpda_delivery_local_part= NULL;
+uschar *tpda_delivery_domain    = NULL;
+uschar *tpda_delivery_confirmation = NULL;
+#endif
+
 transport_instance  *transports = NULL;
 
 transport_instance  transport_defaults = {
 transport_instance  *transports = NULL;
 
 transport_instance  transport_defaults = {
index ad36bf79fafb5b1c0d077e475b05c47d4d06aaf9..f7d76992f536a4040b7783dc9489ad534b1fc164 100644 (file)
@@ -283,17 +283,6 @@ extern uschar *dccifd_address;         /* address of the dccifd daemon */
 extern uschar *dccifd_options;         /* options for the dccifd daemon */
 #endif
 
 extern uschar *dccifd_options;         /* options for the dccifd daemon */
 #endif
 
-#ifdef EXPERIMENTAL_DBL
-extern int     dbl_defer_errno;        /* error number set when a remote delivery is deferred with a host error */
-extern uschar *dbl_defer_errstr;       /* error string set when a remote delivery is deferred with a host error */
-extern uschar *dbl_delivery_ip;        /* IP of host, which has accepted delivery */
-extern int     dbl_delivery_port;       /* port of host, which has accepted delivery */
-extern uschar *dbl_delivery_fqdn;      /* FQDN of host, which has accepted delivery */
-extern uschar *dbl_delivery_local_part;/* local part of address being delivered */
-extern uschar *dbl_delivery_domain;    /* domain part of address being delivered */
-extern uschar *dbl_delivery_confirmation; /* SMTP confirmation message */
-#endif
-
 extern BOOL    debug_daemon;           /* Debug the daemon process only */
 extern int     debug_fd;               /* The fd for debug_file */
 extern FILE   *debug_file;             /* Where to write debugging info */
 extern BOOL    debug_daemon;           /* Debug the daemon process only */
 extern int     debug_fd;               /* The fd for debug_file */
 extern FILE   *debug_file;             /* Where to write debugging info */
@@ -844,6 +833,18 @@ extern int     test_harness_load_avg;  /* For use when testing */
 extern int     thismessage_size_limit; /* Limit for this message */
 extern int     timeout_frozen_after;   /* Max time to keep frozen messages */
 extern BOOL    timestamps_utc;         /* Use UTC for all times */
 extern int     thismessage_size_limit; /* Limit for this message */
 extern int     timeout_frozen_after;   /* Max time to keep frozen messages */
 extern BOOL    timestamps_utc;         /* Use UTC for all times */
+
+#ifdef EXPERIMENTAL_TPDA
+extern int     tpda_defer_errno;        /* error number set when a remote delivery is deferred with a host error */
+extern uschar *tpda_defer_errstr;       /* error string set when a remote delivery is deferred with a host error */
+extern uschar *tpda_delivery_ip;        /* IP of host, which has accepted delivery */
+extern int     tpda_delivery_port;       /* port of host, which has accepted delivery */
+extern uschar *tpda_delivery_fqdn;      /* FQDN of host, which has accepted delivery */
+extern uschar *tpda_delivery_local_part;/* local part of address being delivered */
+extern uschar *tpda_delivery_domain;    /* domain part of address being delivered */
+extern uschar *tpda_delivery_confirmation; /* SMTP confirmation message */
+#endif
+
 extern uschar *transport_name;         /* Name of transport last started */
 extern int     transport_count;        /* Count of bytes transported */
 extern int     transport_newlines;     /* Accurate count of number of newline chars transported */
 extern uschar *transport_name;         /* Name of transport last started */
 extern int     transport_count;        /* Count of bytes transported */
 extern int     transport_newlines;     /* Accurate count of number of newline chars transported */
index d7f01c3b4f76cc10f7497717c5a869705fc4c3c7..baf9a0f8574287c7979098720c3d57ee9289c5ee 100644 (file)
@@ -184,8 +184,8 @@ typedef struct transport_instance {
   BOOL    log_fail_output;
   BOOL    log_defer_output;
   BOOL    retry_use_local_part;   /* Defaults true for local, false for remote */
   BOOL    log_fail_output;
   BOOL    log_defer_output;
   BOOL    retry_use_local_part;   /* Defaults true for local, false for remote */
-#ifdef EXPERIMENTAL_DBL
-  uschar  *dbl_delivery_query;   /* String to expand on success */
+#ifdef EXPERIMENTAL_TPDA
+  uschar  *tpda_delivery_action;  /* String to expand on success */
 #endif
 } transport_instance;
 
 #endif
 } transport_instance;
 
index ef00fe275a5e3b691cc71734e39a636d4ccf04ca..d2540be620531df975b39f85a4150d2f1cfa408f 100644 (file)
@@ -56,10 +56,6 @@ optionlist optionlist_transports[] = {
                  (void *)offsetof(transport_instance, body_only) },
   { "current_directory", opt_stringptr|opt_public,
                  (void *)offsetof(transport_instance, current_dir) },
                  (void *)offsetof(transport_instance, body_only) },
   { "current_directory", opt_stringptr|opt_public,
                  (void *)offsetof(transport_instance, current_dir) },
-#ifdef EXPERIMENTAL_DBL
-  { "dbl_delivery_query",opt_stringptr | opt_public,
-                 (void *)offsetof(transport_instance, dbl_delivery_query) },
-#endif
   { "debug_print",      opt_stringptr | opt_public,
                  (void *)offsetof(transport_instance, debug_string) },
   { "delivery_date_add", opt_bool|opt_public,
   { "debug_print",      opt_stringptr | opt_public,
                  (void *)offsetof(transport_instance, debug_string) },
   { "delivery_date_add", opt_bool|opt_public,
@@ -98,6 +94,10 @@ optionlist optionlist_transports[] = {
                  (void *)offsetof(transport_instance, shadow_condition) },
   { "shadow_transport", opt_stringptr|opt_public,
                  (void *)offsetof(transport_instance, shadow) },
                  (void *)offsetof(transport_instance, shadow_condition) },
   { "shadow_transport", opt_stringptr|opt_public,
                  (void *)offsetof(transport_instance, shadow) },
+#ifdef EXPERIMENTAL_TPDA
+  { "tpda_delivery_action",opt_stringptr | opt_public,
+                 (void *)offsetof(transport_instance, tpda_delivery_action) },
+#endif
   { "transport_filter", opt_stringptr|opt_public,
                  (void *)offsetof(transport_instance, filter_command) },
   { "transport_filter_timeout", opt_time|opt_public,
   { "transport_filter", opt_stringptr|opt_public,
                  (void *)offsetof(transport_instance, filter_command) },
   { "transport_filter_timeout", opt_time|opt_public,
index ac24f5f09ab3a4a0e4b82ec49855f3551cd455b4..d37b2a3dca16eda508db38593a7c4022afafe40b 100644 (file)
@@ -35,10 +35,6 @@ optionlist smtp_transport_options[] = {
       (void *)offsetof(transport_instance, connection_max_messages) },
   { "data_timeout",         opt_time,
       (void *)offsetof(smtp_transport_options_block, data_timeout) },
       (void *)offsetof(transport_instance, connection_max_messages) },
   { "data_timeout",         opt_time,
       (void *)offsetof(smtp_transport_options_block, data_timeout) },
-#ifdef EXPERIMENTAL_DBL
-  { "dbl_host_defer_query",      opt_stringptr,
-         (void *)offsetof(smtp_transport_options_block, dbl_host_defer_query) },
-#endif
   { "delay_after_cutoff", opt_bool,
       (void *)offsetof(smtp_transport_options_block, delay_after_cutoff) },
 #ifndef DISABLE_DKIM
   { "delay_after_cutoff", opt_bool,
       (void *)offsetof(smtp_transport_options_block, delay_after_cutoff) },
 #ifndef DISABLE_DKIM
@@ -160,6 +156,10 @@ optionlist smtp_transport_options[] = {
   { "tls_verify_certificates", opt_stringptr,
       (void *)offsetof(smtp_transport_options_block, tls_verify_certificates) }
 #endif
   { "tls_verify_certificates", opt_stringptr,
       (void *)offsetof(smtp_transport_options_block, tls_verify_certificates) }
 #endif
+#ifdef EXPERIMENTAL_TPDA
+ ,{ "tpda_host_defer_action", opt_stringptr,
+         (void *)offsetof(smtp_transport_options_block, tpda_host_defer_action) },
+#endif
 };
 
 /* Size of the options list. An extern variable has to be used so that its
 };
 
 /* Size of the options list. An extern variable has to be used so that its
@@ -237,8 +237,8 @@ smtp_transport_options_block smtp_transport_option_defaults = {
   NULL,                /* dkim_sign_headers */
   NULL                 /* dkim_strict */
 #endif
   NULL,                /* dkim_sign_headers */
   NULL                 /* dkim_strict */
 #endif
-#ifdef EXPERIMENTAL_DBL
- ,NULL                 /* dbl_host_defer_query */
+#ifdef EXPERIMENTAL_TPDA
+ ,NULL                 /* tpda_host_defer_action */
 #endif
 };
 
 #endif
 };
 
@@ -584,16 +584,16 @@ else
 
 
 
 
 
 
-#ifdef EXPERIMENTAL_DBL
+#ifdef EXPERIMENTAL_TPDA
 /*************************************************
 /*************************************************
-*          Write error message to database log   *
+*   Post-defer action                            *
 *************************************************/
 
 /* This expands an arbitrary per-transport string.
    It might, for example, be used to write to the database log.
 
 Arguments:
 *************************************************/
 
 /* This expands an arbitrary per-transport string.
    It might, for example, be used to write to the database log.
 
 Arguments:
-  dbl_host_defer_query  dbl_host_defer_query from the transport options block
+  ob                    transport options block
   addr                  the address item containing error information
   host                  the current host
 
   addr                  the address item containing error information
   host                  the current host
 
@@ -601,33 +601,34 @@ Returns:   nothing
 */
 
 static void
 */
 
 static void
-dbl_write_defer_log(uschar *dbl_host_defer_query, address_item *addr, host_item *host)
+tpda_deferred(smtp_transport_options_block *ob, address_item *addr, host_item *host)
 {
 {
-if (dbl_host_defer_query == NULL)
+uschar *action = ob->tpda_host_defer_action;
+if (!action)
        return;
 
        return;
 
-dbl_delivery_ip = string_copy(host->address);
-dbl_delivery_port = (host->port == PORT_NONE)? 25 : host->port;
-dbl_delivery_fqdn = string_copy(host->name);
-dbl_delivery_local_part = string_copy(addr->local_part);
-dbl_delivery_domain = string_copy(addr->domain);
-dbl_defer_errno = addr->basic_errno;
-
-dbl_defer_errstr = (addr->message != NULL)
-  ? (addr->basic_errno > 0)
-  ? string_sprintf("%s: %s", addr->message, strerror(addr->basic_errno))
-  : string_copy(addr->message)
-  : (addr->basic_errno > 0)
-  ? string_copy(strerror(addr->basic_errno))
-  : NULL;
-
-DEBUG(D_transport) {
-       debug_printf("  DBL(host defer): dbl_host_defer_query=|%s| dbl_delivery_IP=%s\n", dbl_host_defer_query, dbl_delivery_ip);
-}
+tpda_delivery_ip =         string_copy(host->address);
+tpda_delivery_port =       (host->port == PORT_NONE)? 25 : host->port;
+tpda_delivery_fqdn =       string_copy(host->name);
+tpda_delivery_local_part = string_copy(addr->local_part);
+tpda_delivery_domain =     string_copy(addr->domain);
+tpda_defer_errno =         addr->basic_errno;
+
+tpda_defer_errstr = addr->message
+  ? addr->basic_errno > 0
+    ? string_sprintf("%s: %s", addr->message, strerror(addr->basic_errno))
+    : string_copy(addr->message)
+  : addr->basic_errno > 0
+    ? string_copy(strerror(addr->basic_errno))
+    : NULL;
+
+DEBUG(D_transport)
+  debug_printf("  TPDA(host defer): tpda_host_defer_action=|%s| tpda_delivery_IP=%s\n",
+    action, tpda_delivery_ip);
 
 router_name =    addr->router->name;
 transport_name = addr->transport->name;
 
 router_name =    addr->router->name;
 transport_name = addr->transport->name;
-expand_string(dbl_host_defer_query);
+expand_string(action);
 router_name = transport_name = NULL;
 }
 #endif
 router_name = transport_name = NULL;
 }
 #endif
@@ -1970,7 +1971,7 @@ if (!ok) ok = TRUE; else
     /* Set up confirmation if needed - applies only to SMTP */
 
     if (
     /* Set up confirmation if needed - applies only to SMTP */
 
     if (
-               #ifndef EXPERIMENTAL_DBL
+               #ifndef EXPERIMENTAL_TPDA
                        (log_extra_selector & LX_smtp_confirmation) != 0 &&
                #endif
                        !lmtp
                        (log_extra_selector & LX_smtp_confirmation) != 0 &&
                #endif
                        !lmtp
@@ -3113,9 +3114,9 @@ for (cutoff_retry = 0; expired &&
                          first_addr->basic_errno != ERRNO_TLSFAILURE)
         write_logs(first_addr, host);
 
                          first_addr->basic_errno != ERRNO_TLSFAILURE)
         write_logs(first_addr, host);
 
-      #ifdef EXPERIMENTAL_DBL
+      #ifdef EXPERIMENTAL_TPDA
       if (rc == DEFER)
       if (rc == DEFER)
-        dbl_write_defer_log(ob->dbl_host_defer_query, first_addr, host);
+        tpda_deferred(ob, first_addr, host);
       #endif
 
       /* If STARTTLS was accepted, but there was a failure in setting up the
       #endif
 
       /* If STARTTLS was accepted, but there was a failure in setting up the
@@ -3140,9 +3141,9 @@ for (cutoff_retry = 0; expired &&
           expanded_hosts != NULL, &message_defer, TRUE);
         if (rc == DEFER && first_addr->basic_errno != ERRNO_AUTHFAIL)
           write_logs(first_addr, host);
           expanded_hosts != NULL, &message_defer, TRUE);
         if (rc == DEFER && first_addr->basic_errno != ERRNO_AUTHFAIL)
           write_logs(first_addr, host);
-        #ifdef EXPERIMENTAL_DBL
+        #ifdef EXPERIMENTAL_TPDA
         if (rc == DEFER)
         if (rc == DEFER)
-          dbl_write_defer_log(ob->dbl_host_defer_query, first_addr, host);
+          tpda_deferred(ob, first_addr, host);
         #endif
         }
       #endif
         #endif
         }
       #endif
index 1768585256bf556b657fc086bdebf7d888121c33..0d88016473ef5f913231446df34f24ba808c72c0 100644 (file)
@@ -73,8 +73,8 @@ typedef struct {
   uschar *dkim_sign_headers;
   uschar *dkim_strict;
   #endif
   uschar *dkim_sign_headers;
   uschar *dkim_strict;
   #endif
-  #ifdef EXPERIMENTAL_DBL
-  uschar *dbl_host_defer_query;
+  #ifdef EXPERIMENTAL_TPDA
+  uschar *tpda_host_defer_action;
   #endif
 } smtp_transport_options_block;
 
   #endif
 } smtp_transport_options_block;
 
index 700b360a8cc6484f310d1788e0531d24722ad769..dec90620a0317e70ca21e6ae555131058d666384 100644 (file)
@@ -21,14 +21,14 @@ begin acl
 logger:
     accept logwrite = \
            $acl_arg1 \
 logger:
     accept logwrite = \
            $acl_arg1 \
-           ip <$dbl_delivery_ip> \
-           port <$dbl_delivery_port> \
-           fqdn <$dbl_delivery_fqdn> \
-           local_part <$dbl_delivery_local_part> \
-           domain <$dbl_delivery_domain> \
-           confirmation <$dbl_delivery_confirmation> \
-           errno <$dbl_defer_errno> \
-           errstr <$dbl_defer_errstr> \
+           ip <$tpda_delivery_ip> \
+           port <$tpda_delivery_port> \
+           fqdn <$tpda_delivery_fqdn> \
+           local_part <$tpda_delivery_local_part> \
+           domain <$tpda_delivery_domain> \
+           confirmation <$tpda_delivery_confirmation> \
+           errno <$tpda_defer_errno> \
+           errstr <$tpda_defer_errstr> \
            router <$router_name> \
            transport <$transport_name>
 
            router <$router_name> \
            transport <$transport_name>
 
@@ -54,7 +54,7 @@ smtp:
   port = PORT_S
   command_timeout = 1s
   final_timeout = 1s
   port = PORT_S
   command_timeout = 1s
   final_timeout = 1s
-  dbl_delivery_query =   ${acl {logger}{delivery}}
-  dbl_host_defer_query = ${acl {logger}{deferral}}
+  tpda_delivery_action =   ${acl {logger}{delivery}}
+  tpda_host_defer_action = ${acl {logger}{deferral}}
 
 # End
 
 # End
diff --git a/test/scripts/5700-deliv-log/5700 b/test/scripts/5700-deliv-log/5700
deleted file mode 100644 (file)
index dccf02c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# Arbtirary expansion after transport
-# (EXPERIMENTAL_BDL - database logging)
-#
-need_ipv4
-#
-exim -odq userx@domain1
-A deliverable message
-****
-server PORT_S
-220 ESMTP
-EHLO
-250-OK
-250 HELP
-MAIL
-250 OK
-RCPT
-250 OK
-DATA
-354 More...
-.
-250 OK
-QUIT
-220 OK
-****
-exim -qqf
-****
-#
-#
-#
-server PORT_S
-220 ESMTP
-EHLO
-*sleep 4
-****
-exim -odi userx@domain1.com
-A message which will hit a timeout
-.
-****
-
diff --git a/test/scripts/5700-deliv-log/REQUIRES b/test/scripts/5700-deliv-log/REQUIRES
deleted file mode 100644 (file)
index 338b556..0000000
+++ /dev/null
@@ -1 +0,0 @@
-support Experimental_DBL
diff --git a/test/scripts/5700-tpt-post-dlv-action/5700 b/test/scripts/5700-tpt-post-dlv-action/5700
new file mode 100644 (file)
index 0000000..dccf02c
--- /dev/null
@@ -0,0 +1,39 @@
+# Arbtirary expansion after transport
+# (EXPERIMENTAL_BDL - database logging)
+#
+need_ipv4
+#
+exim -odq userx@domain1
+A deliverable message
+****
+server PORT_S
+220 ESMTP
+EHLO
+250-OK
+250 HELP
+MAIL
+250 OK
+RCPT
+250 OK
+DATA
+354 More...
+.
+250 OK
+QUIT
+220 OK
+****
+exim -qqf
+****
+#
+#
+#
+server PORT_S
+220 ESMTP
+EHLO
+*sleep 4
+****
+exim -odi userx@domain1.com
+A message which will hit a timeout
+.
+****
+
diff --git a/test/scripts/5700-tpt-post-dlv-action/REQUIRES b/test/scripts/5700-tpt-post-dlv-action/REQUIRES
new file mode 100644 (file)
index 0000000..4444658
--- /dev/null
@@ -0,0 +1 @@
+support Experimental_TPDA
index a80e34c38b5eb6ed603e32323425ad873e72acaf..7bc9bf701808510cc208d2e489075b890e8996f3 100644 (file)
@@ -59,6 +59,7 @@ return_path =
 no_return_path_add
 shadow_condition = 
 shadow_transport = 
 no_return_path_add
 shadow_condition = 
 shadow_transport = 
+tpda_delivery_action = 
 transport_filter = 
 transport_filter_timeout = 5m
 user = 
 transport_filter = 
 transport_filter_timeout = 5m
 user = 
@@ -113,6 +114,7 @@ return_path =
 no_return_path_add
 shadow_condition = 
 shadow_transport = 
 no_return_path_add
 shadow_condition = 
 shadow_transport = 
+tpda_delivery_action = 
 transport_filter = 
 transport_filter_timeout = 5m
 user = 
 transport_filter = 
 transport_filter_timeout = 5m
 user =