[exim-cvs] UTF8: mua_wrapper

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] UTF8: mua_wrapper
Gitweb: http://git.exim.org/exim.git/commitdiff/0ec7e94825af4ec45b9ab92f9a2d22cf59952600
Commit:     0ec7e94825af4ec45b9ab92f9a2d22cf59952600
Parent:     921dfc1193791b722844341c3ec97be158042c17
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Apr 21 23:59:07 2015 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Apr 21 23:59:07 2015 +0100


    UTF8: mua_wrapper
---
 src/src/deliver.c                    |    5 +++-
 src/src/exim.c                       |    3 ++
 src/src/spool_in.c                   |    2 +-
 src/src/spool_out.c                  |    2 +-
 test/confs/4201                      |    3 ++
 test/confs/4209                      |    1 +
 test/log/4207                        |    2 +-
 test/log/4208                        |    2 +
 test/log/4209                        |   18 +++++++++++++++
 test/rejectlog/4208                  |    1 +
 test/scripts/4200-International/4208 |    2 +-
 test/scripts/4200-International/4209 |   40 ++++++++++++++++++++++++++++++++++
 test/stdout/4208                     |   20 +++++++++++++++++
 13 files changed, 96 insertions(+), 5 deletions(-)


diff --git a/src/src/deliver.c b/src/src/deliver.c
index 58b9d3a..88936b5 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -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)
diff --git a/src/src/exim.c b/src/src/exim.c
index cae2964..e328fb5 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -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
   }



diff --git a/src/src/spool_in.c b/src/src/spool_in.c
index 558d955..0780d58 100644
--- a/src/src/spool_in.c
+++ b/src/src/spool_in.c
@@ -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
diff --git a/src/src/spool_out.c b/src/src/spool_out.c
index 48f27a8..e8d2020 100644
--- a/src/src/spool_out.c
+++ b/src/src/spool_out.c
@@ -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


diff --git a/test/confs/4201 b/test/confs/4201
index 4145325..6a16f4c 100644
--- a/test/confs/4201
+++ b/test/confs/4201
@@ -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
index 0000000..73a348f
--- /dev/null
+++ b/test/confs/4209
@@ -0,0 +1 @@
+4201
\ No newline at end of file
diff --git a/test/log/4207 b/test/log/4207
index e1dd4f7..f6171fd 100644
--- a/test/log/4207
+++ b/test/log/4207
@@ -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@??? H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaX-0005vi-00@??? for xn--user.-f99s29a80cg5i8xgv8fnb734dq4gv6av8eczab60f5jch09a5ea085a0marwd373e180hea90e@???
-1999-03-02 09:44:33 10HmaX-0005vi-00 => xn--user.-f99s29a80cg5i8xgv8fnb734dq4gv6av8eczab60f5jch09a5ea085a0marwd373e180hea90e@???- <user.세계의모든사람들이한국어를이해한다면얼마나좋을까@test.ex> F=<xn--ihqwcrb4cv8a8dqg056pqjye@???> 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@??? <user.세계의모든사람들이한국어를이해한다면얼마나좋을까@test.ex> F=<xn--ihqwcrb4cv8a8dqg056pqjye@???> 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@???> R=localuser
diff --git a/test/log/4208 b/test/log/4208
new file mode 100644
index 0000000..73e1863
--- /dev/null
+++ b/test/log/4208
@@ -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@???>: relay not permitted
diff --git a/test/log/4209 b/test/log/4209
new file mode 100644
index 0000000..0f42fec
--- /dev/null
+++ b/test/log/4209
@@ -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@??? 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@??? H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaZ-0005vi-00@??? for xn--user.-si1hohvdvf05c4gvj200y0o6f@???
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => xn--user.-si1hohvdvf05c4gvj200y0o6f@??? <user.他们为什么不说中文@test.ex> F=<xn--ihqwcrb4cv8a8dqg056pqjye@???> 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@???> 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
index 0000000..2bbfb4f
--- /dev/null
+++ b/test/rejectlog/4208
@@ -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@???>: relay not permitted
diff --git a/test/scripts/4200-International/4208 b/test/scripts/4200-International/4208
index 0fa7190..8802987 100644
--- a/test/scripts/4200-International/4208
+++ b/test/scripts/4200-International/4208
@@ -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@???ạisaohọkhôngthểchỉnóitiếngViệt.local> SMTPUTF8
RCPT TO: <userT@???>
diff --git a/test/scripts/4200-International/4209 b/test/scripts/4200-International/4209
new file mode 100644
index 0000000..6531103
--- /dev/null
+++ b/test/scripts/4200-International/4209
@@ -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
index 0000000..b4bf772
--- /dev/null
+++ b/test/stdout/4208
@@ -0,0 +1,20 @@
+220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250-the.local.host.name Hello CALLER at client.ffail
+250-SIZE 52428800
+250-8BITMIME
+250-PIPELINING
+250-SMTPUTF8
+250 HELP
+250 OK
+250 Accepted
+221 the.local.host.name closing connection
+220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250-the.local.host.name Hello CALLER at client.ffail
+250-SIZE 52428800
+250-8BITMIME
+250-PIPELINING
+250-SMTPUTF8
+250 HELP
+250 OK
+250 Accepted
+221 the.local.host.name closing connection