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

Re: [PATCH v3] imap-send: URI encode server folder

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 18, 2017, 22:19 UTC
Message-ID
<20171218221945.GC7854@aiede.mtv.corp.google.com>
In-Reply-To
<20171218191113.18600-1-kaartic.sivaraam@gmail.com>
Kaartic Sivaraam wrote:
Show 29 quoted lines
> From: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
>
> When trying to send a patch using 'imap-send' with 'curl' and the
> following configuration:
>
> [imap]
> 	folder = "[Gmail]/Drafts"
> 	host = imaps://imap.gmail.com
> 	port = 993
> 	sslverify = false
>
> results in the following error,
>
>     curl_easy_perform() failed: URL using bad/illegal format or missing URL
>
> This is a consequence of not URI-encoding the folder portion of
> the URL which contains characters such as '[' which are not
> allowed in a URI. According to RFC3986, these characters should be
> URI-encoded.
>
> So, URI-encode the folder before adding it to the URI to ensure it doesn't
> contain characters that aren't allowed in a URI.
>
> Reported-by: Doron Behar <doron.behar@gmail.com>
> Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
> Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
> ---
>  imap-send.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
Thanks!
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Is there a straightforward way to check that this behavior gets preserved in tests?

Sincerely, Jonathan

Previous: Kaartic SivaraamNext: Junio C Hamano
Message 16 of 17 in “imap-send with gmail: curl_easy_perform() failed: URL using bad/illegal format or missing URL”
  1. Doron BeharNov 29, 2017
  2. Jonathan NiederNov 30, 2017
  3. Jeff KingNov 30, 2017
  4. Jeff KingNov 30, 2017
  5. Nicolas Morey-ChaisemartinNov 30, 2017
  6. Nicolas Morey-ChaisemartinNov 30, 2017
  7. Daniel StenbergNov 30, 2017
  8. Nicolas Morey-ChaisemartinNov 30, 2017
  9. Daniel StenbergNov 30, 2017
  10. imap-send: URI encode server folderNicolas Morey-Chaisemartin, Nov 30, 2017
  11. Eric SunshineNov 30, 2017
  12. Junio C HamanoDec 5, 2017
  13. imap-send: URI encode server folderKaartic Sivaraam, Dec 18, 2017
  14. Eric SunshineDec 18, 2017
  15. imap-send: URI encode server folderKaartic Sivaraam, Dec 18, 2017
  16. Jonathan NiederDec 18, 2017
  17. Junio C HamanoDec 18, 2017

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.