I'm trying to use Curl (actually libcurl) to list the emails in the Sent Mail directory of my gmail account.

The inbox directory works fine, however directories under [Gmail] don't, because square brackets aren't allowed in URLS. I've tried the -g flag, without any success.

.\curl.exe "imaps://imap.gmail.com:993/[Gmail]/Sent Mail" --cacert ".\cacert.pem" -u user:pass

Yields:

curl: (3) URL using bad/illegal format or missing URL

.\curl.exe "imaps://imap.gmail.com:993/[Gmail]/Sent Mail" --cacert ".\cacert.pem" -u user:pass -g

Yields:

curl: (3) [globbing] error: bad range specification after pos 29

Can anyone see how I'm going wrong?

有帮助吗?

解决方案 2

I provided this as a comment to my question, but I've managed to get it to work correctly now, and additionally percent encoding the space, by providing the -X flag for a custom IMAP request, to search for the email I was looking for.

其他提示

Switch off globbing if you want to use [] in the URL.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top