UTF8: mua_wrapper
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 21 Apr 2015 22:59:07 +0000 (23:59 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 21 Apr 2015 22:59:07 +0000 (23:59 +0100)
13 files changed:
src/src/deliver.c
src/src/exim.c
src/src/spool_in.c
src/src/spool_out.c
test/confs/4201
test/confs/4209 [new symlink]
test/log/4207
test/log/4208 [new file with mode: 0644]
test/log/4209 [new file with mode: 0644]
test/rejectlog/4208 [new file with mode: 0644]
test/scripts/4200-International/4208
test/scripts/4200-International/4209 [new file with mode: 0644]
test/stdout/4208 [new file with mode: 0644]

index 58b9d3a01f4ad4405abe03e4260bdd350f80ad8b..88936b5f987a0453a487b8a90931ebcab0246c73 100644 (file)
@@ -5606,8 +5606,11 @@ if (process_recipients != RECIP_IGNORE)
        {
        new->prop.utf8_downcvt =       message_utf8_downconvert == 1;
        new->prop.utf8_downcvt_maybe = message_utf8_downconvert == -1;
+       DEBUG(D_deliver) debug_printf("utf8, downconvert %s\n",
+         new->prop.utf8_downcvt ? "yes"
+         : new->prop.utf8_downcvt_maybe ? "ifneeded"
+         : "no");
        }
-      DEBUG(D_deliver) if (message_smtputf8) debug_printf("utf8\n");
 #endif
 
       if (r->pno >= 0)
index cae2964775ee8593f5774e9772d4b4c880f08d96..e328fb521f3152e330b4028d3e303a8a9c6df614 100644 (file)
@@ -5088,6 +5088,9 @@ if (mua_wrapper)
   deliver_drop_privilege = TRUE;
   queue_smtp = FALSE;
   queue_smtp_domains = NULL;
+#ifdef EXPERIMENTAL_INTERNATIONAL
+  message_utf8_downconvert = -1;       /* convert-if-needed */
+#endif
   }
 
 
index 558d955c1dfeff212f4b960bad5b90f4e2a21515..0780d58948fa7ed777c942f8792715d04d922300 100644 (file)
@@ -605,7 +605,7 @@ for (;;)
     case 'u':
     if (Ustrncmp(p, "tf8_downcvt", 11) == 0)
       message_utf8_downconvert = 1;
-    else if (Ustrncmp(p, "tf8_downcvt_opt", 15) == 0)
+    else if (Ustrncmp(p, "tf8_optdowncvt", 15) == 0)
       message_utf8_downconvert = -1;
     break;
 #endif
index 48f27a8c6951fe9e0e9aa57c243e085d9a3557d4..e8d2020335a4b9fa50949be91f27d61a27937f75 100644 (file)
@@ -250,7 +250,7 @@ if (message_smtputf8)
   {
   fprintf(f, "-smtputf8\n");
   if (message_utf8_downconvert)
-    fprintf(f, "-utf8_downcvt%s\n", message_utf8_downconvert < 0 ? "_opt" : "");
+    fprintf(f, "-utf8_%sdowncvt\n", message_utf8_downconvert < 0 ? "opt" : "");
   }
 #endif
 
index 4145325cc391fd6d0b5dedd67d0d94019ecfc3e8..6a16f4c6ff4f3d962b2870d428de33b5a05c7a1e 100644 (file)
@@ -4,6 +4,7 @@
 OPTION = *
 CONTROL =
 INSERT =
+SUB =
 
 exim_path = EXIM_PATH
 host_lookup_order = bydns
@@ -29,6 +30,8 @@ queue_run_in_order
 
 smtputf8_advertise_hosts = OPTION
 
+SUB
+
 
 # ----- ACL -----
 
diff --git a/test/confs/4209 b/test/confs/4209
new file mode 120000 (symlink)
index 0000000..73a348f
--- /dev/null
@@ -0,0 +1 @@
+4201
\ No newline at end of file
index e1dd4f732e68615babfc7c853042d0108a660cbe..f6171fd4558b198320ef2f1be9024de2b3b68b98 100644 (file)
@@ -1,7 +1,7 @@
 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 10HmaX-0005vi-00 <= 他们为什么不说中文@hebrew.למההםפשוטלאמדבריםעברית.com U=CALLER P=utf8local-esmtp S=sss for user.세계의모든사람들이한국어를이해한다면얼마나좋을까@test.ex
 1999-03-02 09:44:33 10HmaY-0005vi-00 <= xn--ihqwcrb4cv8a8dqg056pqjye@hebrew.xn--4dbcagdahymbxekheh6e0a7fei0b.com H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaX-0005vi-00@the.local.host.name for xn--user.-f99s29a80cg5i8xgv8fnb734dq4gv6av8eczab60f5jch09a5ea085a0marwd373e180hea90e@test.ex
-1999-03-02 09:44:33 10HmaX-0005vi-00 => xn--user.-f99s29a80cg5i8xgv8fnb734dq4gv6av8eczab60f5jch09a5ea085a0marwd373e180hea90e@xn--test.ex- <user.세계의모든사람들이한국어를이해한다면얼마나좋을까@test.ex> F=<xn--ihqwcrb4cv8a8dqg056pqjye@hebrew.xn--4dbcagdahymbxekheh6e0a7fei0b.com> R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmaY-0005vi-00"
+1999-03-02 09:44:33 10HmaX-0005vi-00 => xn--user.-f99s29a80cg5i8xgv8fnb734dq4gv6av8eczab60f5jch09a5ea085a0marwd373e180hea90e@test.ex <user.세계의모든사람들이한국어를이해한다면얼마나좋을까@test.ex> F=<xn--ihqwcrb4cv8a8dqg056pqjye@hebrew.xn--4dbcagdahymbxekheh6e0a7fei0b.com> R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmaY-0005vi-00"
 1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
 1999-03-02 09:44:33 Start queue run: pid=pppp -qqff
 1999-03-02 09:44:33 10HmaY-0005vi-00 => :blackhole: <xn--user.-f99s29a80cg5i8xgv8fnb734dq4gv6av8eczab60f5jch09a5ea085a0marwd373e180hea90e@test.ex> R=localuser
diff --git a/test/log/4208 b/test/log/4208
new file mode 100644 (file)
index 0000000..73e1863
--- /dev/null
@@ -0,0 +1,2 @@
+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 H=localhost (the.local.host.name) [127.0.0.1] F=<> rejected RCPT <the.local.host.name-dddddddd-testing@test.ex>: relay not permitted
diff --git a/test/log/4209 b/test/log/4209
new file mode 100644 (file)
index 0000000..0f42fec
--- /dev/null
@@ -0,0 +1,18 @@
+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 10HmaX-0005vi-00 <= 他们为什么不说中文@test1.com U=CALLER P=local S=sss for user.他们为什么不说中文@test.ex
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= 他们为什么不说中文@test1.com H=localhost (the.local.host.name) [127.0.0.1] P=utf8esmtp S=sss id=E10HmaX-0005vi-00@the.local.host.name for user.他们为什么不说中文@test.ex
+1999-03-02 09:44:33 10HmaX-0005vi-00 => user.他们为什么不说中文@test.ex F=<他们为什么不说中文@test1.com> R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmaY-0005vi-00"
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 Start queue run: pid=pppp -qqff
+1999-03-02 09:44:33 10HmaY-0005vi-00 => :blackhole: <user.他们为什么不说中文@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 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 <= 他们为什么不说中文@test1.com U=CALLER P=local S=sss for user.他们为什么不说中文@test.ex
+1999-03-02 09:44:33 10HmbA-0005vi-00 <= xn--ihqwcrb4cv8a8dqg056pqjye@test1.com H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaZ-0005vi-00@the.local.host.name for xn--user.-si1hohvdvf05c4gvj200y0o6f@test.ex
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => xn--user.-si1hohvdvf05c4gvj200y0o6f@test.ex <user.他们为什么不说中文@test.ex> F=<xn--ihqwcrb4cv8a8dqg056pqjye@test1.com> R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbA-0005vi-00"
+1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
+1999-03-02 09:44:33 Start queue run: pid=pppp -qqff
+1999-03-02 09:44:33 10HmbA-0005vi-00 => :blackhole: <xn--user.-si1hohvdvf05c4gvj200y0o6f@test.ex> R=localuser
+1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
+1999-03-02 09:44:33 End queue run: pid=pppp -qqff
diff --git a/test/rejectlog/4208 b/test/rejectlog/4208
new file mode 100644 (file)
index 0000000..2bbfb4f
--- /dev/null
@@ -0,0 +1 @@
+1999-03-02 09:44:33 H=localhost (the.local.host.name) [127.0.0.1] F=<> rejected RCPT <the.local.host.name-dddddddd-testing@test.ex>: relay not permitted
index 0fa719019884004bfe2ef1a245f34ce1f12d88e1..880298798b7375ac493ab0c39b3db8e65a61de95 100644 (file)
@@ -13,7 +13,7 @@ QUIT
 ****
 
 # Recipient+random verify callout, pass only due to downconvert
-exim -d+all -bs -odi -DINSERT="control=utf8_downconvert" -DCONTROL="verify=recipient/callout=random"
+exim -bs -odi -DINSERT="control=utf8_downconvert" -DCONTROL="verify=recipient/callout=random"
 EHLO client.ffail
 MAIL FROM: <CALLER@vietnamese.TạisaohọkhôngthểchỉnóitiếngViệt.local> SMTPUTF8
 RCPT TO: <userT@test.ex>
diff --git a/test/scripts/4200-International/4209 b/test/scripts/4200-International/4209
new file mode 100644 (file)
index 0000000..6531103
--- /dev/null
@@ -0,0 +1,40 @@
+# Internationalised mail: mua_wrapper
+# Exim test configuration 4209
+#
+# featurefull server
+exim -DSERVER=server -bd -oX PORT_D
+****
+#
+# commandline/stdin input, utf-8 rcpt & sender, forwarded
+# should not downconvert
+exim -DSUB=mua_wrapper -odi -f 他们为什么不说中文@test1.com user.他们为什么不说中文@test.ex
+Test message 1.
+.
+****
+#
+#
+killdaemon
+exim -DSERVER=server -qqff
+****
+#
+#
+#
+# featureless server
+exim -DSERVER=server -DOPTION="" -bd -oX PORT_D
+****
+#
+# commandline/stdin input, utf-8 rcpt & sender, forwarded
+# should downconvert
+exim -DSUB=mua_wrapper -odi -f 他们为什么不说中文@test1.com user.他们为什么不说中文@test.ex
+Test message 1.
+.
+****
+#
+#
+killdaemon
+exim -DSERVER=server -qqff
+****
+#
+#
+#
+no_msglog_check
diff --git a/test/stdout/4208 b/test/stdout/4208
new file mode 100644 (file)
index 0000000..b4bf772
--- /dev/null
@@ -0,0 +1,20 @@
+220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-the.local.host.name Hello CALLER at client.ffail\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250-SMTPUTF8\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+221 the.local.host.name closing connection\r
+220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-the.local.host.name Hello CALLER at client.ffail\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250-SMTPUTF8\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+221 the.local.host.name closing connection\r