Skip to content

Commit

Permalink
imap-send: Tell cURL to use imap:// or imaps://
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andersk authored and gitster committed Aug 17, 2016
1 parent 0b65a8d commit d2d07ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/');
Expand Down

0 comments on commit d2d07ab

Please sign in to comment.