Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from Imap.ListSubscribed to Imap.MbxList

Provides instructions for replacing deprecated ListSubscribed method calls with MbxList.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

imap = chilkat2.Imap()

# ...
# ...

reference = ""
mbxPattern = "*"

# ------------------------------------------------------------------------
# The ListSubscribed method is deprecated:

# Lists only subscribed mailboxes.
# mboxesObj is a CkMailboxes
mboxesObj = imap.ListSubscribed(reference,mbxPattern)
if (imap.LastMethodSuccess == False):
    print(imap.LastErrorText)
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using MbxList.
# Your application creates a new, empty Mailboxes object which is passed 
# in the last argument and filled upon success.

# Lists only subscribed mailboxes.
subscribed = True

mboxes = chilkat2.Mailboxes()
success = imap.MbxList(subscribed,reference,mbxPattern,mboxes)
if (success == False):
    print(imap.LastErrorText)
    sys.exit()