]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
smtp: Detect server support for the UTF-8 extension as defined in RFC-6531
authorSteve Holme <steve_holme@hotmail.com>
Fri, 7 Feb 2020 19:57:15 +0000 (19:57 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Wed, 26 Feb 2020 14:04:37 +0000 (14:04 +0000)
lib/smtp.c
lib/smtp.h

index 3c3dfcbd94ff363608b1c256b209587eae1aab89..6a87849bbb6e8bf70f3d9f507d18d85b459c7a9d 100644 (file)
@@ -29,6 +29,7 @@
  * RFC5321 SMTP protocol
  * RFC5890 Internationalized Domain Names for Applications (IDNA)
  * RFC6531 SMTP Extension for Internationalized Email
+ * RFC6532 Internationalized Email Headers
  * RFC6749 OAuth 2.0 Authorization Framework
  * RFC8314 Use of TLS for Email Submission and Access
  * Draft   SMTP URL Interface   <draft-earhart-url-smtp-00.txt>
@@ -802,6 +803,10 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode,
     else if(len >= 4 && !memcmp(line, "SIZE", 4))
       smtpc->size_supported = TRUE;
 
+    /* Does the server support the UTF-8 capability? */
+    else if(len >= 8 && !memcmp(line, "SMTPUTF8", 8))
+      smtpc->utf8_supported = TRUE;
+
     /* Does the server support authentication? */
     else if(len >= 5 && !memcmp(line, "AUTH ", 5)) {
       smtpc->auth_supported = TRUE;
index 0865d91e7eb0db035aac4e2b111a8657612b08c1..164a175d759c030c845af25dcd0fce880d030dc8 100644 (file)
@@ -74,6 +74,8 @@ struct smtp_conn {
   bool tls_supported;      /* StartTLS capability supported by server */
   bool size_supported;     /* If server supports SIZE extension according to
                               RFC 1870 */
+  bool utf8_supported;     /* If server supports SMTPUTF8 extension according
+                              to RFC 6531 */
   bool auth_supported;     /* AUTH capability supported by server */
 };