Copyright year updates (things touched in 2016)
[exim.git] / src / src / transports / smtp.c
index 66d632fad7803767b010a65ebea6484bef1bb802..7bf11b83024dadf700bb6cc687180e52f4c6a188 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2015 */
+/* Copyright (c) University of Cambridge 1995 - 2016 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 #include "../exim.h"
@@ -159,7 +159,7 @@ optionlist smtp_transport_options[] = {
       (void *)offsetof(smtp_transport_options_block, serialize_hosts) },
   { "size_addition",        opt_int,
       (void *)offsetof(smtp_transport_options_block, size_addition) }
-#ifdef EXPERIMENTAL_SOCKS
+#ifdef SUPPORT_SOCKS
  ,{ "socks_proxy",          opt_stringptr,
       (void *)offsetof(smtp_transport_options_block, socks_proxy) }
 #endif
@@ -249,7 +249,7 @@ smtp_transport_options_block smtp_transport_option_defaults = {
   FALSE,               /* lmtp_ignore_quota */
   NULL,                       /* expand_retry_include_ip_address */
   TRUE                 /* retry_include_ip_address */
-#ifdef EXPERIMENTAL_SOCKS
+#ifdef SUPPORT_SOCKS
  ,NULL                 /* socks_proxy */
 #endif
 #ifdef SUPPORT_TLS
@@ -596,7 +596,7 @@ if (*errno_value == ERRNO_WRITEINCOMPLETE)
   return FALSE;
   }
 
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
 /* Handle lack of advertised SMTPUTF8, for international message */
 if (*errno_value == ERRNO_UTF8_FWD)
   {
@@ -668,22 +668,22 @@ if (addr->message)
   }
 else
   {
-  log_write(0, LOG_MAIN, "%s %s", message, strerror(addr->basic_errno));
-  deliver_msglog("%s %s %s\n", tod_stamp(tod_log), message,
-               strerror(addr->basic_errno));
+  const uschar * s = exim_errstr(addr->basic_errno);
+  log_write(0, LOG_MAIN, "%s %s", message, s);
+  deliver_msglog("%s %s %s\n", tod_stamp(tod_log), message, s);
   }
 }
 
 static void
 msglog_line(host_item * host, uschar * message)
 {
-  deliver_msglog("%s H=%s [%s] %s\n", tod_stamp(tod_log),
-    host->name, host->address, message);
+deliver_msglog("%s H=%s [%s] %s\n", tod_stamp(tod_log),
+  host->name, host->address, message);
 }
 
 
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 /*************************************************
 *   Post-defer action                            *
 *************************************************/
@@ -919,7 +919,7 @@ while (count-- > 0)
       addr->basic_errno = ERRNO_RCPT4XX;
       addr->more_errno |= ((buffer[1] - '0')*10 + buffer[2] - '0') << 8;
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
       event_defer_errno = addr->more_errno;
       msg_event_raise(US"msg:rcpt:host:defer", addr);
 #endif
@@ -930,7 +930,7 @@ while (count-- > 0)
       if (host->next)
        log_write(0, LOG_MAIN, "H=%s [%s]: %s", host->name, host->address, addr->message);
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
       else
        msg_event_raise(US"msg:rcpt:defer", addr);
 #endif
@@ -1403,7 +1403,7 @@ BOOL pass_message = FALSE;
 BOOL prdr_offered = FALSE;
 BOOL prdr_active;
 #endif
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
 BOOL utf8_needed = FALSE;
 BOOL utf8_offered = FALSE;
 #endif
@@ -1535,7 +1535,7 @@ if (continue_hostname == NULL)
   delayed till here so that $sending_interface and $sending_port are set. */
 
   helo_data = expand_string(ob->helo_data);
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
   if (helo_data)
     {
     uschar * errstr = NULL;
@@ -1562,7 +1562,7 @@ if (continue_hostname == NULL)
 #endif
     if (!good_response) goto RESPONSE_FAILED;
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
       {
       uschar * s;
       lookup_dnssec_authenticated = host->dnssec==DS_YES ? US"yes"
@@ -1709,7 +1709,7 @@ goto SEND_QUIT;
     {DEBUG(D_transport) debug_printf("PRDR usable\n");}
 #endif
 
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
   if (addrlist->prop.utf8_msg)
     {
     utf8_needed =  !addrlist->prop.utf8_downcvt
@@ -1950,7 +1950,7 @@ if (continue_hostname == NULL
     {DEBUG(D_transport) debug_printf("PRDR usable\n");}
 #endif
 
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
   if (addrlist->prop.utf8_msg)
     utf8_offered = esmtp
       && pcre_exec(regex_UTF8, NULL, CS buffer, Ustrlen(buffer), 0,
@@ -1983,7 +1983,7 @@ message-specific. */
 
 setting_up = FALSE;
 
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
 /* If this is an international message we need the host to speak SMTPUTF8 */
 if (utf8_needed && !utf8_offered)
   {
@@ -2068,7 +2068,7 @@ if (prdr_offered)
   }
 #endif
 
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
 if (addrlist->prop.utf8_msg && !addrlist->prop.utf8_downcvt && utf8_offered)
   sprintf(CS p, " SMTPUTF8"), p += 9;
 #endif
@@ -2128,7 +2128,7 @@ pending_MAIL = TRUE;     /* The block starts with MAIL */
 
   {
   uschar * s = return_path;
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
   uschar * errstr = NULL;
 
   /* If we must downconvert, do the from-address here.  Remember we had to
@@ -2239,7 +2239,7 @@ for (addr = first_addr;
 
   rcpt_addr = transport_rcpt_address(addr, tblock->rcpt_include_affixes);
 
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
   {
   uschar * dummy_errstr;
   if (  testflag(addrlist, af_utf8_downcvt)
@@ -2458,7 +2458,7 @@ if (!ok) ok = TRUE; else
     /* Set up confirmation if needed - applies only to SMTP */
 
     if (
-#ifndef EXPERIMENTAL_EVENT
+#ifdef DISABLE_EVENT
           LOGGING(smtp_confirmation) &&
 #endif
           !lmtp
@@ -2679,7 +2679,7 @@ if (!ok)
 
     switch(save_errno)
       {
-#ifdef EXPERIMENTAL_INTERNATIONAL
+#ifdef SUPPORT_I18N
       case ERRNO_UTF8_FWD:
         code = '5';
       /*FALLTHROUGH*/
@@ -2930,7 +2930,7 @@ case continue_more won't get set. */
 
 (void)close(inblock.sock);
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 (void) event_raise(tblock->event_action, US"tcp:close", NULL);
 #endif
 
@@ -3663,7 +3663,7 @@ for (cutoff_retry = 0; expired &&
                          first_addr->basic_errno != ERRNO_TLSFAILURE)
         write_logs(first_addr, host);
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
       if (rc == DEFER)
         deferred_event_raise(first_addr, host);
 #endif
@@ -3691,7 +3691,7 @@ for (cutoff_retry = 0; expired &&
           &message_defer, TRUE);
         if (rc == DEFER && first_addr->basic_errno != ERRNO_AUTHFAIL)
           write_logs(first_addr, host);
-# ifdef EXPERIMENTAL_EVENT
+# ifndef DISABLE_EVENT
         if (rc == DEFER)
           deferred_event_raise(first_addr, host);
 # endif