Indy icon indicating copy to clipboard operation
Indy copied to clipboard

TIdIMAP4: RFC 6154: Add a version of ListMailboxes that return also the mailbox' flags

Open infpmandin opened this issue 1 year ago • 1 comments

TIdIMAP4 ListMailboxes only return the list of mailboxes in the account.

The IMAP4 LIST command used parses the result and only return the mailbox names. Could be useful to have an extended version that also gives back the flags (i.e. sent, draft, trash, etc) set to each mailbox.

Currently the only workaround would be to SelectMailbox() each one of these to get the flags.

infpmandin avatar Jul 12 '24 09:07 infpmandin

Funny, there is already a TODO in the code for this very feature:

//Todo: Get mail box attributes here
{CC2: Could put mailbox attributes in AMBList's Objects property?}

That comment has existed since Indy 9. It was just never implemented yet.

Obviously, using the caller's TStrings.Objects property for output would not be a good idea. Will probably have to define a new TCollection class for this purpose, similar to TIdImapMessageParts used in various Retreive methods.

Whatever solution is created should also be applied to ListInferiorMailBoxes() and ListSubscribedMailBoxes() as well.

rlebeau avatar Jul 12 '24 19:07 rlebeau