Compiler quietening
[exim.git] / src / src / transports / smtp.c
index 6d34922952ae6f0575c33f0f00b11e450506e231..b932a87c49daddbd93f3a077da9d5f6051696398 100644 (file)
@@ -277,7 +277,7 @@ smtp_transport_options_block smtp_transport_option_defaults = {
 static int     rf_list[] = {rf_notify_never, rf_notify_success,
                             rf_notify_failure, rf_notify_delay };
 
-static uschar *rf_names[] = { "NEVER", "SUCCESS", "FAILURE", "DELAY" };
+static uschar *rf_names[] = { US"NEVER", US"SUCCESS", US"FAILURE", US"DELAY" };
 #endif
 
 
@@ -640,7 +640,7 @@ msglog_line(host_item * host, uschar * message)
 
 
 
-#ifdef EXPERIMENTAL_TPDA
+#ifdef EXPERIMENTAL_EVENT
 /*************************************************
 *   Post-defer action                            *
 *************************************************/
@@ -656,9 +656,9 @@ Returns:   nothing
 */
 
 static void
-tpda_deferred(address_item *addr, host_item *host)
+deferred_event_raise(address_item *addr, host_item *host)
 {
-uschar * action = addr->transport->tpda_event_action;
+uschar * action = addr->transport->event_action;
 uschar * save_domain;
 uschar * save_local;
 
@@ -670,15 +670,15 @@ save_local = deliver_localpart;
 
 /*XXX would ip & port already be set up? */
 deliver_host_address = string_copy(host->address);
-deliver_host_port =    (host->port == PORT_NONE)? 25 : host->port;
-tpda_defer_errno =     addr->basic_errno;
+deliver_host_port =    host->port == PORT_NONE ? 25 : host->port;
+event_defer_errno =    addr->basic_errno;
 
 router_name =    addr->router->name;
 transport_name = addr->transport->name;
 deliver_domain = addr->domain;
 deliver_localpart = addr->local_part;
 
-(void) tpda_raise_event(action, US"msg:host:defer",
+(void) event_raise(action, US"msg:host:defer",
     addr->message
       ? addr->basic_errno > 0
        ? string_sprintf("%s: %s", addr->message, strerror(addr->basic_errno))
@@ -1356,8 +1356,8 @@ if (continue_hostname == NULL)
   inblock.sock = outblock.sock =
     smtp_connect(host, host_af, port, interface, ob->connect_timeout,
                  ob->keepalive, ob->dscp
-#ifdef EXPERIMENTAL_TPDA
-                 , tblock->tpda_event_action
+#ifdef EXPERIMENTAL_EVENT
+                 , tblock->event_action
 #endif
                );
 
@@ -1413,15 +1413,21 @@ if (continue_hostname == NULL)
     if (!smtp_read_response(&inblock, buffer, sizeof(buffer), '2',
       ob->command_timeout)) goto RESPONSE_FAILED;
 
-#ifdef EXPERIMENTAL_TPDA
-    if (tpda_raise_event(tblock->tpda_event_action, US"smtp:connect", buffer)
-       == DEFER)
+#ifdef EXPERIMENTAL_EVENT
+      {
+      uschar * s;
+      lookup_dnssec_authenticated = host->dnssec==DS_YES ? US"yes"
+       : host->dnssec==DS_NO ? US"no" : NULL;
+      s = event_raise(tblock->event_action, US"smtp:connect", buffer);
+      if (s)
        {
-       uschar *message = US"deferred by smtp:connect event expansion";
-       set_errno(addrlist, 0, message, DEFER, FALSE, NULL);
+       set_errno(addrlist, 0,
+         string_sprintf("deferred by smtp:connect event expansion: %s", s),
+         DEFER, FALSE, NULL);
        yield = DEFER;
        goto SEND_QUIT;
        }
+      }
 #endif
 
     /* Now check if the helo_data expansion went well, and sign off cleanly if
@@ -1865,12 +1871,12 @@ if ((smtp_use_dsn) && (dsn_all_lasthop == FALSE))
   {
   if (dsn_ret == dsn_ret_hdrs)
     {
-    strcpy(p, " RET=HDRS");
+    Ustrcpy(p, " RET=HDRS");
     while (*p) p++;
     }
   else if (dsn_ret == dsn_ret_full)
     {
-    strcpy(p, " RET=FULL");
+    Ustrcpy(p, " RET=FULL");
     while (*p) p++;
     }
   if (dsn_envid != NULL)
@@ -1967,14 +1973,14 @@ for (addr = first_addr;
       {
       int i;
       BOOL first = TRUE;
-      strcpy(p, " NOTIFY=");
+      Ustrcpy(p, " NOTIFY=");
       while (*p) p++;
       for (i = 0; i < 4; i++)
         if ((addr->dsn_flags & rf_list[i]) != 0)
           {
           if (!first) *p++ = ',';
           first = FALSE;
-          strcpy(p, rf_names[i]);
+          Ustrcpy(p, rf_names[i]);
           while (*p) p++;
           }
       }
@@ -2218,7 +2224,7 @@ if (!ok) ok = TRUE; else
     /* Set up confirmation if needed - applies only to SMTP */
 
     if (
-#ifndef EXPERIMENTAL_TPDA
+#ifndef EXPERIMENTAL_EVENT
           (log_extra_selector & LX_smtp_confirmation) != 0 &&
 #endif
           !lmtp
@@ -2659,8 +2665,8 @@ case continue_more won't get set. */
 
 (void)close(inblock.sock);
 
-#ifdef EXPERIMENTAL_TPDA
-(void) tpda_raise_event(tblock->tpda_event_action, US"tcp:close", NULL);
+#ifdef EXPERIMENTAL_EVENT
+(void) event_raise(tblock->event_action, US"tcp:close", NULL);
 #endif
 
 continue_transport = NULL;
@@ -3370,9 +3376,9 @@ for (cutoff_retry = 0; expired &&
                          first_addr->basic_errno != ERRNO_TLSFAILURE)
         write_logs(first_addr, host);
 
-#ifdef EXPERIMENTAL_TPDA
+#ifdef EXPERIMENTAL_EVENT
       if (rc == DEFER)
-        tpda_deferred(first_addr, host);
+        deferred_event_raise(first_addr, host);
 #endif
 
       /* If STARTTLS was accepted, but there was a failure in setting up the
@@ -3399,9 +3405,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);
-# ifdef EXPERIMENTAL_TPDA
+# ifdef EXPERIMENTAL_EVENT
         if (rc == DEFER)
-          tpda_deferred(first_addr, host);
+          deferred_event_raise(first_addr, host);
 # endif
         }
 #endif /*SUPPORT_TLS*/