Re: mailimap_lsub problem

DINH Viet Hoa <[email protected]> Sun, 2 Apr 2006 11:28:34 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.442f9942.3ff67af4.1ef1@utopia>
Marko Ivancic wrote :

> I use mailimap_lsub to retrive mail folders from IMAP server like this:
> 
> mailimap_lsub(imap, "", "*",&list);  // (the  same way as etpan does)
> 
> But in the result list there are folders that can not be connected for 
> example:
> 
> mail/
> mail
> mail/sent/
> mail/inbox
> 
> The folder: mail/ and mail (is the same folder) can not be connected. 
> Is  there any way to find out which folder can be connected and which not.

struct mailimap_mailbox_list {
  struct mailimap_mbx_list_flags * mb_flag; /* can be NULL */
  char mb_delimiter;
  char * mb_name; /* != NULL */
};


enum {
  MAILIMAP_MBX_LIST_SFLAG_ERROR,
  MAILIMAP_MBX_LIST_SFLAG_MARKED,
  MAILIMAP_MBX_LIST_SFLAG_NOSELECT,
  MAILIMAP_MBX_LIST_SFLAG_UNMARKED
};

struct mailimap_mbx_list_flags {
  int mbf_type;
  clist * mbf_oflags; /* list of
                         (struct mailimap_mbx_list_oflag *), != NULL */
  int mbf_sflag;
};

if mbf_type is MAILIMAP_MBX_LIST_FLAGS_SFLAG and mbf_sflag is 
MAILIMAP_MBX_LIST_SFLAG_NOSELECT, then the folder is not connectable.

look at etpan-imap.c in etpan-ng to see an example of use.

-- 
DINH V. Hoa,

"c'est un peu comme les crampons au foot au début t'as des ampoules
    et après non" -- sunZ
signature.asc (application/pgp-signature, 0 B)