New config option 'c_smtpclient_try_starttls' if nonzero outbound SMTP attempts START...
authorArt Cancro <ajc@citadel.org>
Wed, 12 Jul 2017 22:11:39 +0000 (18:11 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 12 Jul 2017 22:11:39 +0000 (18:11 -0400)
citadel/modules/smtp/serv_smtpclient.c

index 372dddbc49e8abdcbde463560a18c7dada792538..937367943e446fd65e3ea607ac899371132e983f 100644 (file)
@@ -237,7 +237,9 @@ int smtp_attempt_delivery(long msgid, char *recp, char *envelope_from)
                        curl_easy_setopt(curl, CURLOPT_READDATA, &s);
                        curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);                                              // tell libcurl we are uploading
                        curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L);                                           // Time out after 20 seconds
-                       // curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY); athos-mn
+                       if (CtdlGetConfigInt("c_smtpclient_try_starttls") != 0) {
+                               curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);                        // Attempt STARTTLS if offered
+                       }
                        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
                        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
                        // curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_error_buffer);