[exim-cvs] client helo

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] client helo
Gitweb: http://git.exim.org/exim.git/commitdiff/810d16ad4b7f172163ed4bb8adc45a3d7183659a
Commit:     810d16ad4b7f172163ed4bb8adc45a3d7183659a
Parent:     8ecb706aed8a3946654fc4419bfd6a3e93e5438b
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Apr 12 18:47:03 2015 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Apr 12 23:36:49 2015 +0100


    client helo
---
 TODO                              |    4 ++--
 doc/doc-txt/experimental-spec.txt |   19 +++++++++++++++++--
 src/src/transports/smtp.c         |   13 +++++++++++++
 src/src/utf8.c                    |    1 +
 4 files changed, 33 insertions(+), 4 deletions(-)


diff --git a/TODO b/TODO
index 4445d0f..19c7ce7 100644
--- a/TODO
+++ b/TODO
@@ -14,8 +14,8 @@ destination supports the SMTPUTF8 extension

======================

-to-Alabel convert of helo name
-- smtp transport
+++ to-Alabel convert of helo name
+++ - smtp transport

++ An "international" flag on the message?
++ An is-international expansion condition?
diff --git a/doc/doc-txt/experimental-spec.txt b/doc/doc-txt/experimental-spec.txt
index 3dbf13f..c22288b 100644
--- a/doc/doc-txt/experimental-spec.txt
+++ b/doc/doc-txt/experimental-spec.txt
@@ -1278,7 +1278,7 @@ RFCs 6530, 6533, 5890

Compile with EXPERIMENTAL_INTERNATIONAL and libidn.

-Main config option smtputf8_advertise_hosts, default '*',
+New main config option smtputf8_advertise_hosts, default '*',
a host list. If this matches the sending host and
accept_8bitmime is true (the default) then the ESMTP option
SMTPUTF8 will be advertised.
@@ -1291,15 +1291,30 @@ The option allow_utf8_domains is set to true for this
message. All DNS lookups are converted to a-label form
whatever the setting of allow_utf8_domains.

+Both localparts and domain are maintained as the original
+utf8 form internally; any matching or regex use will
+require appropriate care. Filenames created, eg. by
+the appendfile transport, will have utf8 name.
+
+Helo names sent by the smtp transport will have any utf8
+components expanded to a-label form.
+
Log lines and Received-by: header lines will aquire a "utf8"
prefix on the protocol element, eg. utf8esmtp.

-Expansion operators:
+New expansion operators:
     ${utf8_domain_to_alabel:str}
     ${utf8_domain_from_alabel:str}
     ${utf8_localpart_to_alabel:str}
     ${utf8_localpart_from_alabel:str}


+Known issues:
+ - Currently LMTP is not supported.
+ - DSN unitext handling is not present
+ - no provision for converting logging from UTF-8
+ - VRFY and EXPN not handled
+ - non-smtp input not handled (!)
+ - MSA mode not handled (!)

--------------------------------------------------------------
End of file
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 0ca6b4e..65bb1de 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -1486,6 +1486,19 @@ if (continue_hostname == NULL)
delayed till here so that $sending_interface and $sending_port are set. */

   helo_data = expand_string(ob->helo_data);
+#ifdef EXPERIMENTAL_INTERNATIONAL
+  if (helo_data)
+    {
+    uschar * errstr = NULL;
+    if ((helo_data = string_domain_utf8_to_alabel(helo_data, &errstr)), errstr)
+      {
+      errstr = string_sprintf("failed to expand helo_data: %s", errstr);
+      set_errno(addrlist, ERRNO_EXPANDFAIL, errstr, DEFER, FALSE, NULL);
+      yield = DEFER;
+      goto SEND_QUIT;
+      }
+    }
+#endif


   /* The first thing is to wait for an initial OK response. The dreaded "goto"
   is nevertheless a reasonably clean way of programming this kind of logic,
diff --git a/src/src/utf8.c b/src/src/utf8.c
index 6d0c502..6bc0c2e 100644
--- a/src/src/utf8.c
+++ b/src/src/utf8.c
@@ -54,6 +54,7 @@ string_domain_alabel_to_utf8(const uschar * alabel, uschar ** err)
 uschar * s1;
 uschar * s;
 int rc;
+
 if (  (rc = idna_to_unicode_8z8z(CCS alabel, CSS &s1, IDNA_USE_STD3_ASCII_RULES))
    != IDNA_SUCCESS)
   {