How to create folder with curl using imap?

Viewed 32

There is possibility to send imap commmands with curl. How to send create folder with it?

I found so far curl “imap://username:password@in.example.com” -X ‘<COMMAND>’

Update: This command worked for me.

curl -v -k --ssl imap://mail.example.com --user "username:password" -X "CREATE <folder name>"
1 Answers

Curl can't issue IMAP commands in general, it can only access URLs. URLs locate resources uniformly. Note the boldface. IMAP commands do much more, and those that do other things than just locate resources don't have corresponding URLs.

For example, one of the things IMAP clients do most is move messages to another folder. That's an action, not a resource. A URL to do that would be a URL to change the URL of the resource that the URL locates, ie. it would be a URL that invalidates itself. A contradiction in terms.

Related