cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [imap] imap: Return folder listing if empty URL content is given.

From: Ben Greear <greearb_at_candelatech.com>
Date: Thu, 01 Apr 2010 12:13:02 -0700

On 03/30/2010 02:08 PM, Daniel Stenberg wrote:
> On Tue, 30 Mar 2010, Ben Greear wrote:
>
>> It seems that in general the imap code and perhaps pingpong logic
>> isn't well suited for handling imap stuff, where the data and headers
>> are all mixed up.
>
> I agree that IMAP is a bit ugly in that regard and yes it makes things a
> bit quirky within libcurl. But I'm convinced that we can work something
> out that ends up decent!

Well, I don't know about decent..but I have at least some functionality
working now. The attached patch is full of debugging code and needs
more testing, so this is just for comment unless you are feeling
very brave.

I am afraid I abused the pingpong logic quite a bit. There is probably
a cleaner way, but not sure what that would be.

This patch is against a recent upstream pull..it includes all of my
previous curl imap patches.

Some things that should work with this patch:

* Enable header CURLOPT and mail headers will be requested and
   saved to the read callback.

* Select inbox and download two email messages with specified IDs:
    imap://tester:passwd_at_mail.candelatech.com/INBOX/;uid=2,1

   NOTE: All headers come first, then body...this needs more work.

* Get one message from INBOX:
   imap://tester:passwd_at_mail.candelatech.com/INBOX/;uid=2

* Get a listing of all folders:
   imap://tester:afk987_at_mail.candelatech.com/
   imap://tester:afk987_at_mail.candelatech.com

Still working on getting search working properly.

Thanks,
Ben

-- 
Ben Greear <greearb_at_candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2010-04-01