From: Jonathan Nieder Date: Mon, 18 Dec 2017 22:19:45 GMT Subject: Re: [PATCH v3] imap-send: URI encode server folder Message-ID: <20171218221945.GC7854@aiede.mtv.corp.google.com> In-Reply-To: <20171218191113.18600-1-kaartic.sivaraam@gmail.com> Kaartic Sivaraam wrote: > From: Nicolas Morey-Chaisemartin > > 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 > Signed-off-by: Nicolas Morey-Chaisemartin > Signed-off-by: Kaartic Sivaraam > --- > imap-send.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) Thanks! Reviewed-by: Jonathan Nieder Is there a straightforward way to check that this behavior gets preserved in tests? Sincerely, Jonathan