X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fserv_smtpclient.c;h=a7fb3052e54f3525d0983934d84f9f939a83059b;hb=fda2c2c69ee42e3113004e6598387e07cc69ef9a;hp=fcf74e9ee67334a03f1dbfc66be22d722c074209;hpb=da0b049809b9ad1459a4ac0467e79bfb5c5d2719;p=citadel.git diff --git a/citadel/modules/smtp/serv_smtpclient.c b/citadel/modules/smtp/serv_smtpclient.c index fcf74e9ee..a7fb3052e 100644 --- a/citadel/modules/smtp/serv_smtpclient.c +++ b/citadel/modules/smtp/serv_smtpclient.c @@ -79,7 +79,7 @@ void smtp_init_spoolout(void) { /* * Make sure it's set to be a "system room" so it doesn't show up - * in the nown rooms list for Aides. + * in the nown rooms list for administrators. */ if (CtdlGetRoomLock(&qrbuf, SMTP_SPOOLOUT_ROOM) == 0) { qrbuf.QRflags2 |= QR2_SYSTEM; @@ -236,9 +236,18 @@ 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 @@ -252,7 +261,9 @@ int smtp_attempt_delivery(long msgid, char *recp, char *envelope_from) response_code = 421; } - curl_slist_free_all(recipients); + if (recipients != NULL) { + curl_slist_free_all(recipients); + } curl_easy_cleanup(curl); } } @@ -277,7 +288,7 @@ void smtp_process_one_msg(long qmsgnum) long deletes[2]; int delete_this_queue = 0; - syslog(LOG_DEBUG, "smtpclient: smtp_process_one_msg(%ld)", qmsgnum); + syslog(LOG_DEBUG, "smtpclient: processing queue entry %ld", qmsgnum); msg = CtdlFetchMessage(qmsgnum, 1, 1); if (msg == NULL) { @@ -307,16 +318,6 @@ void smtp_process_one_msg(long qmsgnum) char *bounceto = NULL; char *envelope_from = NULL; - // Example queue instructions - // - // msgid|3978 - // submitted|1489343934 - // bounceto|IGnatius T Foobar@dev - // attempted|1489344257 - // remote|unreachable@example.com|4|Timeout while connecting example.com [93.184.216.34]:25 - // remote|unreachable@example.org|4|Timeout while connecting example.org [93.184.216.34]:25 - // remote|unreachable@example.gov|0|1) A-lookup example.gov - Domain name not found; 2) AAAA-lookup example.gov - Domain name not found; - char cfgline[SIZ]; for (i=0; i