cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Listing and moving mails in IMAP Inbox

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Mon, 9 Dec 2013 22:35:02 +0000

On Sun, 8 Dec 2013, No One wrote:

> I'm using curl 7.29.0 (i686-pc-linux-gnu) on Xubuntu
> 13.04. I tried to fetch a listing of my mails in my IMAP
> inbox using the following command:

There is only limited support for IMAP in curl prior to v7.30.0.

> > curl -u 'user:password' -X "EXAMINE INBOX" --url
> > 'imaps://mymailserver.com:993/INBOX'
>
> I got the command from this thread
> http://curl.haxx.se/mail/lib-2013-03/0104.html

Yep - that's a pretty good list of commands that I drew up just after the
IMAP command set was extended. As such it's not the full list of supported
IMAP commands :(

Whilst I have now added most commands to the test suite I haven't had chance
to document them yet - plus there is the question of where to document them.

However, In order to use that example you will need curl v7.30.0 or above -
I would recommend the very latest due to some changes and fixes in 7.31.0
and 7.33.0

> Another question is whether it is possible to move a mail from
> one folder to another.

Yes - although I believe you have to perform a copy and then a delete, but I
could be wrong as my understanding of IMAP is still a little limited :(

Try the following:

--url imap://mail.example.com/Inbox -X 'COPY 123 Curl-Users' and
--url imap://mail.example.com/Inbox -X 'STORE 123 +Flags \Deleted'

As you can see these need to be issued as two separate calls to curl,
although, this is something I am hoping to address after the release of
v7.34.0.

I trust this helps.

Kind Regards

Steve
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-12-09