Re: mailfolders

Michael Leupold <[email protected]> Thu, 27 Apr 2006 10:31:30 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Hi Chris,

Am Donnerstag, 27. April 2006 08:48 schrieb chris harward:
> Is there any way of retrieving from a mailstorage a list of the mailfolders
> it contains.

Yes, I think there is. I found the following:
int mailsession_list_folders(mailsession * session, char * mb, struct 
mail_list ** result);

So you should be able to do the following:
---
struct mailstorage * mystorage;
struct mail_list * result;
int r;
/* do the connection-stuff */
r = mailsession_list_folders(mystorage->sto_session, "", &result);
/* examine the result */
mail_list_free(result);
---

Please note, that mailsession_list_folders is marked as deprecated. No idea 
what it is replaced by. Also note, that by definition it returns a list of 
child-mailboxes of mb, though on some drivers child-mailboxes of "" are all 
mailboxes. Of course the function is only available on session-drivers that 
implement it. I actually did a quick test with the imapdriver and it worked 
just fine.

Regards,
Michael


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642