I18N: Fix protocol recorded for a multi-SMTPUTF8-message connection. Bug 2287
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 18 Jul 2018 21:16:38 +0000 (22:16 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 18 Jul 2018 21:24:40 +0000 (22:24 +0100)
doc/doc-txt/ChangeLog
src/src/smtp_in.c
test/log/4201
test/scripts/4200-International/4201
test/stdout/4201

index 754f48b15253ba0fcbab9fb0cb0cdd49d4aed202..fbca09fb3190bc2149f7a745c19409201f39fadd 100644 (file)
@@ -77,6 +77,10 @@ JH/16 Fix ARC verification to do AS checks in reverse order.
 
 JH/17 Support a "tls" option on the ${readsocket } expansion item.
 
 
 JH/17 Support a "tls" option on the ${readsocket } expansion item.
 
+JH/18 Bug 2287: Fix the protocol name (eg utf8esmtp) for multiple messages
+      using the SMTPUTF8 option on their MAIL FROM commands, in one connection.
+      Previously the "utf8" would be re-prepended for every additional message.
+
 
 Exim version 4.91
 -----------------
 
 Exim version 4.91
 -----------------
index 0afb97ca67a4aa77c926d19ffb6e600a1f5cc886..6e2c45a8cb37e304277b3946d2bff9814cfe42c8 100644 (file)
@@ -4671,13 +4671,15 @@ while (done <= 0)
         case ENV_MAIL_OPT_UTF8:
          if (smtputf8_advertised)
            {
         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;
            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
            }
          break;
 #endif
index 2643dd9ec7b33c32c53bf4224142ea0ae48b303d..6b7c6ac970f00fa2aedaeaf0033c2eec35bc3a05 100644 (file)
@@ -6,12 +6,15 @@
 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
 1999-03-02 09:44:33 10HmaZ-0005vi-00 <= someone@some.domain H=(client) [127.0.0.1] P=utf8esmtp S=sss for userx@test.ex
 1999-03-02 09:44:33 10HmbA-0005vi-00 <= ليهمابتكلموشعربي؟@czech.Pročprostěnemluvíčesky.com H=(client) [127.0.0.1] P=utf8esmtp S=sss for userx@test.ex
 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
 1999-03-02 09:44:33 10HmaZ-0005vi-00 <= someone@some.domain H=(client) [127.0.0.1] P=utf8esmtp S=sss for userx@test.ex
 1999-03-02 09:44:33 10HmbA-0005vi-00 <= ليهمابتكلموشعربي؟@czech.Pročprostěnemluvíčesky.com H=(client) [127.0.0.1] P=utf8esmtp S=sss for userx@test.ex
+1999-03-02 09:44:33 10HmbB-0005vi-00 <= ليهمابتكلموشعربي؟@czech.Pročprostěnemluvíčesky.com H=(client) [127.0.0.1] P=utf8esmtp S=sss for usery@test.ex
 1999-03-02 09:44:33 10HmaY-0005vi-00 <= 他们为什么不说中文@hebrew.למההםפשוטלאמדבריםעברית.com H=localhost (the.local.host.name) [127.0.0.1] P=utf8esmtp S=sss id=E10HmaX-0005vi-00@the.local.host.name for usery@test.ex
 1999-03-02 09:44:33 Start queue run: pid=pppp -qqff
 1999-03-02 09:44:33 10HmaZ-0005vi-00 => :blackhole: <userx@test.ex> R=localuser
 1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
 1999-03-02 09:44:33 10HmbA-0005vi-00 => :blackhole: <userx@test.ex> R=localuser
 1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
 1999-03-02 09:44:33 10HmaY-0005vi-00 <= 他们为什么不说中文@hebrew.למההםפשוטלאמדבריםעברית.com H=localhost (the.local.host.name) [127.0.0.1] P=utf8esmtp S=sss id=E10HmaX-0005vi-00@the.local.host.name for usery@test.ex
 1999-03-02 09:44:33 Start queue run: pid=pppp -qqff
 1999-03-02 09:44:33 10HmaZ-0005vi-00 => :blackhole: <userx@test.ex> R=localuser
 1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
 1999-03-02 09:44:33 10HmbA-0005vi-00 => :blackhole: <userx@test.ex> R=localuser
 1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
+1999-03-02 09:44:33 10HmbB-0005vi-00 => :blackhole: <usery@test.ex> R=localuser
+1999-03-02 09:44:33 10HmbB-0005vi-00 Completed
 1999-03-02 09:44:33 10HmaY-0005vi-00 => :blackhole: <usery@test.ex> R=localuser
 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
 1999-03-02 09:44:33 End queue run: pid=pppp -qqff
 1999-03-02 09:44:33 10HmaY-0005vi-00 => :blackhole: <usery@test.ex> R=localuser
 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
 1999-03-02 09:44:33 End queue run: pid=pppp -qqff
index 29e51a9dbc028578f35872e0a3dd79bf20feaab5..fc9a50741745236a74c0a1dce024774c48b6f754 100644 (file)
@@ -31,7 +31,7 @@ QUIT
 ****
 #
 #
 ****
 #
 #
-# utf-8 from, Basic smtp input, no delivery
+# utf-8 from, Basic smtp input, no delivery.  Two messages in a connection.
 client 127.0.0.1 PORT_D
 ??? 220
 EHLO client
 client 127.0.0.1 PORT_D
 ??? 220
 EHLO client
@@ -49,6 +49,17 @@ DATA
 ??? 354
 Subject: test
 
 ??? 354
 Subject: test
 
+body
+.
+??? 250
+MAIL FROM: <ليهمابتكلموشعربي؟@czech.Pročprostěnemluvíčesky.com> SMTPUTF8
+??? 250
+RCPT TO: <usery@test.ex>
+??? 250
+DATA
+??? 354
+Subject: test
+
 body
 .
 ??? 250
 body
 .
 ??? 250
index 5a110f292e78042ef1b3b6c2ac3b3732528ea134..08f6f114528242ca9dd70771f8f4d6681bfa05b4 100644 (file)
@@ -64,6 +64,21 @@ Connecting to 127.0.0.1 port 1225 ... connected
 >>> .
 ??? 250
 <<< 250 OK id=10HmbA-0005vi-00
 >>> .
 ??? 250
 <<< 250 OK id=10HmbA-0005vi-00
+>>> MAIL FROM: <ليهمابتكلموشعربي؟@czech.Pročprostěnemluvíčesky.com> SMTPUTF8
+??? 250
+<<< 250 OK
+>>> RCPT TO: <usery@test.ex>
+??? 250
+<<< 250 Accepted
+>>> DATA
+??? 354
+<<< 354 Enter message, ending with "." on a line by itself
+>>> Subject: test
+>>> 
+>>> body
+>>> .
+??? 250
+<<< 250 OK id=10HmbB-0005vi-00
 >>> QUIT
 ??? 221
 <<< 221 the.local.host.name closing connection
 >>> QUIT
 ??? 221
 <<< 221 the.local.host.name closing connection