Rename substructure for ease of debugging
[exim.git] / src / src / transports / smtp.c
index ffba14662538687b7385f640967c7cdcff772ce0..0ca6b4e42de57d9482f042371982f0b2807a91d0 100644 (file)
@@ -570,6 +570,16 @@ if (*errno_value == ERRNO_WRITEINCOMPLETE)
   return FALSE;
   }
 
+#ifdef EXPERIMENTAL_INTERNATIONAL
+/* Handle lack of advertised SMTPUTF8, for international message */
+if (*errno_value == ERRNO_UTF8_FWD)
+  {
+  *message = US string_sprintf("utf8 support required but not offered for forwarding");
+  DEBUG(D_deliver|D_transport) debug_printf("%s\n", *message);
+  return TRUE;
+  }
+#endif
+
 /* Handle error responses from the remote mailer. */
 
 if (buffer[0] != 0)
@@ -1620,7 +1630,7 @@ goto SEND_QUIT;
 
 #ifdef EXPERIMENTAL_INTERNATIONAL
   utf8_offered = esmtp
-    && addrlist->p.utf8
+    && addrlist->prop.utf8
     && pcre_exec(regex_UTF8, NULL, CS buffer, Ustrlen(buffer), 0,
                  PCRE_EOPT, NULL, 0) >= 0;
 #endif
@@ -1840,7 +1850,7 @@ if (continue_hostname == NULL
 
 #ifdef EXPERIMENTAL_INTERNATIONAL
   utf8_offered = esmtp
-    && addrlist->p.utf8
+    && addrlist->prop.utf8
     && pcre_exec(regex_UTF8, NULL, CS buffer, Ustrlen(buffer), 0,
                  PCRE_EOPT, NULL, 0) >= 0;
 #endif
@@ -1873,7 +1883,7 @@ setting_up = FALSE;
 
 #ifdef EXPERIMENTAL_INTERNATIONAL
 /* If this is an international message we need the host to speak SMTPUTF8 */
-if (addrlist->p.utf8 && !utf8_offered)
+if (addrlist->prop.utf8 && !utf8_offered)
   {
   errno = ERRNO_UTF8_FWD;
   goto RESPONSE_FAILED;
@@ -1957,7 +1967,7 @@ if (prdr_offered)
 #endif
 
 #ifdef EXPERIMENTAL_INTERNATIONAL
-if (addrlist->p.utf8)
+if (addrlist->prop.utf8)
   sprintf(CS p, " SMTPUTF8"), p += 9;
 #endif
 
@@ -2524,24 +2534,29 @@ if (!ok)
 
     switch(save_errno)
       {
+#ifdef EXPERIMENTAL_INTERNATIONAL
+      case ERRNO_UTF8_FWD:
+        code = '5';
+      /*FALLTHROUGH*/
+#endif
       case 0:
       case ERRNO_MAIL4XX:
       case ERRNO_DATA4XX:
-      message_error = TRUE;
-      break;
+       message_error = TRUE;
+       break;
 
       case ETIMEDOUT:
-      message_error = Ustrncmp(smtp_command,"MAIL",4) == 0 ||
-                      Ustrncmp(smtp_command,"end ",4) == 0;
-      break;
+       message_error = Ustrncmp(smtp_command,"MAIL",4) == 0 ||
+                       Ustrncmp(smtp_command,"end ",4) == 0;
+       break;
 
       case ERRNO_SMTPCLOSED:
-      message_error = Ustrncmp(smtp_command,"end ",4) == 0;
-      break;
+       message_error = Ustrncmp(smtp_command,"end ",4) == 0;
+       break;
 
       default:
-      message_error = FALSE;
-      break;
+       message_error = FALSE;
+       break;
       }
 
     /* Handle the cases that are treated as message errors. These are:
@@ -2549,6 +2564,7 @@ if (!ok)
       (a) negative response or timeout after MAIL
       (b) negative response after DATA
       (c) negative response or timeout or dropped connection after "."
+      (d) utf8 support required and not offered
 
     It won't be a negative response or timeout after RCPT, as that is dealt
     with separately above. The action in all cases is to set an appropriate