summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Anders Kaseorg <andersk@mit.edu>2016-08-17 14:58:58 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-08-17 12:46:10 -0700
commitd2d07ab8613ef283ceda6fdaa05fa6976dc1206f (patch)
tree3258631de448060708adad4fd2952fab75636110
parentGit 2.8.4 (diff)
downloadtgif-d2d07ab8613ef283ceda6fdaa05fa6976dc1206f.tar.xz
imap-send: Tell cURL to use imap:// or imaps://
Right now the imap:// or imaps:// part of imap.host is not being passed on to cURL. Perhaps it was able to guess correctly under some circumstances, but I was not able to find one; it was just trying to make HTTP requests for me. It’s better to be explicit in any case. Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--imap-send.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c
index 938c691585..7dd5acf9a9 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1410,6 +1410,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
+ strbuf_addstr(&path, server.use_ssl ? "imaps://" : "imap://");
strbuf_addstr(&path, server.host);
if (!path.len || path.buf[path.len - 1] != '/')
strbuf_addch(&path, '/');