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>
Anders Kaseorg committed
Aug 17, 2016 at 14:58 UTC
d2d07ab8613ef283ceda6fdaa05fa6976dc1206f
1 file changed
+1
imap-send.c
+1
@@ -1410,6 +1410,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
1410
curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
1411
curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
1412
1413
+ strbuf_addstr(&path, server.use_ssl ? "imaps://" : "imap://");
1414
strbuf_addstr(&path, server.host);
1415
if (!path.len || path.buf[path.len - 1] != '/')
1416
strbuf_addch(&path, '/');