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: Tue, 30 Mar 2010 14:05:30 -0700

On 03/30/2010 01:44 PM, Daniel Stenberg wrote:
> On Tue, 30 Mar 2010, Ben Greear wrote:
>
>> More work is needed to make imap useful, including parsing URLs to
>> grab folder and/or email ID. Folder list format might need to be
>> changed as well..it's pretty raw at the moment.
>
> Allow me to throw in some early feedback:
>
> I really approve of and like the idea, much like POP3 and FTP we can
> return listings when the URL ends with a trailing slash == no mailbox is
> given.
>
> Also, this is another perfect example where provide a set of test cases
> will be golden. Not the least to verify that the error cases still work
> out as they should.

Thanks for the feedback. I'm working on getting search and proper
URL parsing done..will try to incorporate all of this into a larger
patch.

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.

>> + /* Something like this comes "* LIST (\Flags) "/" "INBOX" */
>> + t2 = strstr(ptr, "* LIST ");
>
> This seems a bit strange to me. If you know that the string may in the
> buffer, shouldn't it then always start from the beginning? Why would you
> need to scan for it with strstr() ? If it doesn't always start the
> buffer, what other junk are you intending to pass?

I was having a hard time understanding things, and probably
made that code more careful than it needed to be. Further
hacking makes it seem like the header is always one line,
ending in '\r', so I can just remove that paranoid logic.

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-03-30