Using folder and message types

The built-in schema define some common objects that you may wish to return, namely MailFolder, MessageHeader, and MessageList.

To use these types, interact with the folderManager or messageManager objects which are members of the context.extension object passed to getAPI:

// Get an nsIMsgFolder from a MailFolder:
let realFolder = context.extension.folderManager.get(accountId, path);

// Get a MailFolder from an nsIMsgFolder:

// Get an nsIMsgDBHdr from a MessageHeader:
let realMessage = context.extension.messageManager.get(messageId);

// Get a MessageHeader from an nsIMsgDBHdr:

// Start a MessageList from an array or enumerator of nsIMsgDBHdr: