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

Re: imap-send with gmail: curl_easy_perform() failed: URL using bad/illegal format or missing URL

From
Daniel Stenberg <daniel@haxx.se>
Date
Nov 30, 2017, 09:46 UTC
Message-ID
<alpine.DEB.2.20.1711301041250.30591@tvnag.unkk.fr>
In-Reply-To
<50fb321e-bbfc-adae-992d-eea1b818171e@suse.de>
On Thu, 30 Nov 2017, Nicolas Morey-Chaisemartin wrote:
Show 10 quoted lines
> This is due to the weird "[Gmail]" prefix in the folder.
> I tried manually replacing it with:
>         folder = %5BGmail%5D/Drafts
> in .git/config and it works.
>
> curl is doing some fancy handling with brackets and braces. It make sense 
> for multiple FTP downloads like ftp://ftp.numericals.com/file[1-100].txt, 
> not in our case. The curl command line has a --globoff argument to disable 
> this "regexp" support and it seems to fix the gmail case. However I couldn't 
> find a way to change this value through the API...

That's just a feature of the command line tool, "globbing" isn't a function provided by the library. libcurl actually "just" expects a plain old URL.

But with the risk of falling through the cracks into the rathole that is "what is a URL" (I've blogged about the topic several times in the past and I will surely do it again in the future):

A "legal" URL (as per RFC 3986) does not contain brackets, such symbols should be used URL encoded: %5B and %5D.

This said: I don't know exactly why brackets cause a problem in this case. It could still be worth digging into and see if libcurl could deal with them better here...

-- 
  / daniel.haxx.se
Previous: Nicolas Morey-ChaisemartinNext: Nicolas Morey-Chaisemartin
Message 7 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.