folders

The folders API first appeared in Thunderbird 68 (see bug 1531591) as a part of the accounts API. They were later moved here.

Permissions

  • accountsFolders “Create, rename, or delete your mail account folders”

Note

The permission accountsFolders is required to use folders.

Functions

create(parentFolder, childName)

Creates a new subfolder of parentFolder.

rename(folder, newName)

Renames a folder.

delete(folder)

Deletes a folder.

Types

MailFolder

A folder object, as returned by the list and get methods. Use the accountId and path properties to refer to a folder.

object

  • accountId (string) The account this folder belongs to.
  • path (string) Path to this folder in the account. Although paths look predictable, never guess a folder’s path, as there are a number of reasons why it may not be what you think it is.
  • [name] (string) The human-friendly name of this folder.
  • [type] (string) The type of folder, for several common types.

Values for type:

  • inbox
  • drafts
  • sent
  • trash
  • templates
  • archives
  • junk
  • outbox