X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fserv_smtpclient.c;h=48c761dc4e84883b76b9e80e0548c97ea08d9daa;hp=fcf74e9ee67334a03f1dbfc66be22d722c074209;hb=684e3a06c4d2ab35e39760f328a0d354ad330622;hpb=da0b049809b9ad1459a4ac0467e79bfb5c5d2719 diff --git a/citadel/modules/smtp/serv_smtpclient.c b/citadel/modules/smtp/serv_smtpclient.c index fcf74e9ee..48c761dc4 100644 --- a/citadel/modules/smtp/serv_smtpclient.c +++ b/citadel/modules/smtp/serv_smtpclient.c @@ -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_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)); + 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