git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] imap-send: Tell cURL to use imap:// or imaps://

From
Anders Kaseorg <andersk@mit.edu>
Date
Aug 17, 2016, 18:58 UTC
Message-ID
<alpine.DEB.2.10.1608171449371.57685@howe-and-ser-moving.mit.edu>

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>
---
 imap-send.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/imap-send.c b/imap-send.c
index 938c691..7dd5acf 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, '/');
-- 
2.10.0.rc0
Message 1 of 1 in “imap-send: Tell cURL to use imap:// or imaps://”
  1. imap-send: Tell cURL to use imap:// or imaps://Anders Kaseorg, Aug 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.