summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-10-03 00:57:56 +0100
committerCarl Hetherington <cth@carlh.net>2016-10-03 00:57:56 +0100
commit1afaf82bba9e865fd1e0d536f44585a0ed98bb20 (patch)
treed3a510db8fb24fa16d492d14a20cc4d20157d1a5
parent3b7bd046435ea9b5b5a5dac6515e0ef2f1ff9645 (diff)
Speculative fix for sending KDM emails via port 465.
-rw-r--r--src/lib/emailer.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/emailer.cc b/src/lib/emailer.cc
index ceb26caf6..fe6eb5294 100644
--- a/src/lib/emailer.cc
+++ b/src/lib/emailer.cc
@@ -177,7 +177,12 @@ Emailer::send (string server, int port, string user, string password)
throw NetworkError ("Could not initialise libcurl");
}
- curl_easy_setopt (curl, CURLOPT_URL, String::compose ("smtp://%1:%2", server.c_str(), port).c_str());
+ if (port == 465) {
+ /* "Implicit TLS"; I think curl wants us to use smtps here */
+ curl_easy_setopt (curl, CURLOPT_URL, String::compose ("smtps://%1:465", server).c_str());
+ } else {
+ curl_easy_setopt (curl, CURLOPT_URL, String::compose ("smtp://%1:%2", server, port).c_str());
+ }
if (!user.empty ()) {
curl_easy_setopt (curl, CURLOPT_USERNAME, user.c_str ());