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_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);
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);