Archived Forum Post

Index of archived forum posts


Identify the type of the mailbox received CkoMailboxes listMailboxes

Jul 20 '14 at 18:50


I am fetching the mailboxes using :

  CkoMailboxes *mailBoxes = [[CkoMailboxes alloc]init];
  mailBoxes = [imap ListMailboxes:@"" wildcardedMailbox:@"*"];

Is there any way to identify the mailbox type.

For eg: Inbox folder should not get deleted. Thus while checkin that, when i try to delete INBOX folder, i get the following error log.

ChilkatLog: DeleteMailbox:

Failed to delete mailbox...
imapDeleteResponse: aaaj NO [CANNOT] Internal folder cannot be deleted. (Failure)



This log mentions INBOX is an Internal folder.

So, are there any more types which we can get with mailbox to differentiate between Primary mailboxes like: Inbox, Drafts, Sent, Trash and other custom folders. Accordingly we have to reflect on UI when user wants to edit mailboxes.



See the API for the Mailboxes class:

Examine the flags of each mailbox...


Hi.. thanks for your response. But its still unclear to me. I checked the GetFlags method on the CKoMailboxes received. And for a gmail account i am receiving following flags:

INBOX: HasNoChildren

*Madhura123: HasChildren Madhura123/Madhura1234: HasNoChildren*

Notes: HasNoChildren

Personal: HasNoChildren

Receipts: HasNoChildren

Travel: HasNoChildren

[Gmail]/All Mail: HasNoChildren,All

[Gmail]/Drafts: HasNoChildren,Drafts

[Gmail]/Important: HasNoChildren,Important

[Gmail]/Sent Mail: HasNoChildren,Sent

[Gmail]/Spam: HasNoChildren,Junk

[Gmail]/Starred: HasNoChildren,Flagged

[Gmail]/Trash: HasNoChildren,Trash

From this log its still not clear, which are the primary folders and which are custom made by the user. Like for eg: Madhura123: HasChildren

Madhura123/Madhura1234: HasNoChildren only specifies whether the mailbox contains any subfolders or not.

So is there any way to get the type of the folder.

Thanks again in advance for any help.. !