I18N: Fix protocol recorded for a multi-SMTPUTF8-message connection. Bug 2287
[users/heiko/exim.git] / src / src / smtp_in.c
index 0afb97ca67a4aa77c926d19ffb6e600a1f5cc886..6e2c45a8cb37e304277b3946d2bff9814cfe42c8 100644 (file)
@@ -4671,13 +4671,15 @@ while (done <= 0)
         case ENV_MAIL_OPT_UTF8:
          if (smtputf8_advertised)
            {
-           int old_pool = store_pool;
-
            DEBUG(D_receive) debug_printf("smtputf8 requested\n");
            message_smtputf8 = allow_utf8_domains = TRUE;
-           store_pool = POOL_PERM;
-           received_protocol = string_sprintf("utf8%s", received_protocol);
-           store_pool = old_pool;
+           if (Ustrncmp(received_protocol, US"utf8", 4) != 0)
+             {
+             int old_pool = store_pool;
+             store_pool = POOL_PERM;
+             received_protocol = string_sprintf("utf8%s", received_protocol);
+             store_pool = old_pool;
+             }
            }
          break;
 #endif