If the administrator specifies a smart-host as an smtp:// or smtps:// URI, allow...
authorArt Cancro <ajc@citadel.org>
Fri, 24 Mar 2017 01:15:22 +0000 (21:15 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 24 Mar 2017 01:15:22 +0000 (21:15 -0400)
citadel/modules/rssclient/serv_rssclient.c
citadel/modules/smtp/serv_smtpclient.c

index b7cd89ef339c8a8744bcd333cba6ec322e217457..72ce11ed280f8164cdaa538ce73b0bf6994d7529 100644 (file)
@@ -350,6 +350,8 @@ void rss_pull_one_feed(struct rssurl *url)
        Downloaded = NewStrBuf();
 
        curl_easy_setopt(curl, CURLOPT_URL, url->url);
        Downloaded = NewStrBuf();
 
        curl_easy_setopt(curl, CURLOPT_URL, url->url);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);                     // Follow redirects
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlFillStrBuf_callback); // What to do with downloaded data
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, Downloaded);                  // Give it our StrBuf to work with
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);                     // Follow redirects
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlFillStrBuf_callback); // What to do with downloaded data
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, Downloaded);                  // Give it our StrBuf to work with
index fcf74e9ee67334a03f1dbfc66be22d722c074209..48c761dc4e84883b76b9e80e0548c97ea08d9daa 100644 (file)
@@ -236,9 +236,19 @@ 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_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_SSL_VERIFYPEER, 0L);
+                       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
 
                        strcpy(try_this_mx, "smtp://");
                        extract_token(&try_this_mx[7], mxes, i, '|', (sizeof try_this_mx - 7));
 
                        strcpy(try_this_mx, "smtp://");
                        extract_token(&try_this_mx[7], mxes, i, '|', (sizeof try_this_mx - 7));
+                       if (
+                               (!strncasecmp(try_this_mx, HKEY("smtp://smtp://")))                             // This can happen if the administrator
+                               || (!strncasecmp(try_this_mx, HKEY("smtp://smtps://")))                         // puts a full smtp[s] URI as the smart-host
+                       ) {
+                               strcpy(try_this_mx, &try_this_mx[7]);
+                       }
+
+
                        curl_easy_setopt(curl, CURLOPT_URL, try_this_mx);
 
                        syslog(LOG_DEBUG, "smtpclient: trying %s", try_this_mx);                        // send the message
                        curl_easy_setopt(curl, CURLOPT_URL, try_this_mx);
 
                        syslog(LOG_DEBUG, "smtpclient: trying %s", try_this_mx);                        // send the message