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.

Parameters

parentFolder

childName

(string)

Required permissions

  • accountsFolders

rename(folder, newName)

Renames a folder.

Parameters

folder

newName

(string)

Required permissions

  • accountsFolders

delete(folder)

Deletes a folder.

Parameters

folder

Required permissions

  • accountsFolders

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.

[subFolders]

(array of MailFolder)

– [Added in TB 74]

[type]

(string)

The type of folder, for several common types.

Supported values:

inbox

drafts

sent

trash

templates

archives

junk

outbox