accounts API
The accounts API first appeared in Thunderbird 66.
Permissions
See your mail accounts, their identities and their folders
Functions
list([includeFolders])
Returns all mail accounts.
Parameters
[includeFolders
]
(boolean, optional)
– [Added in TB 91]
Specifies whether the returned MailAccount objects should included their account’s folders. Defaults to true.
Return type (Promise)
array of MailAccount
Required permissions
get(accountId, [includeFolders])
Returns details of the requested account, or null if it doesn’t exist.
Parameters
accountId
(string)
[includeFolders
]
(boolean, optional)
– [Added in TB 91]
Specifies whether the returned MailAccount object should included the account’s folders. Defaults to true.
Return type (Promise)
Required permissions
getDefault([includeFolders])
– [Added in TB 85, backported to TB 78.7.0]
Returns the default account, or null if it is not defined.
Parameters
[includeFolders
]
(boolean, optional)
– [Added in TB 91]
Specifies whether the returned MailAccount object should included the account’s folders. Defaults to true.
Return type (Promise)
Required permissions
setDefaultIdentity(accountId, identityId)
– [Added in TB 76]
Sets the default identity for an account.
Parameters
accountId
(string)
identityId
(string)
Required permissions
getDefaultIdentity(accountId)
– [Added in TB 85, backported to TB 78.7.0]
Returns the default identity for an account, or null if it is not defined.
Parameters
accountId
(string)
Return type (Promise)
Required permissions
Types
MailAccount
An object describing a mail account, as returned for example by the list([includeFolders]) and get(accountId, [includeFolders]) methods. The folders
property is only included if requested.
object
id
(string)
A unique identifier for this account.
The identities associated with this account. The default identity is listed first, others in no particular order.
name
(string)
The human-friendly name of this account.
type
(string)
What sort of account this is, e.g. imap, nntp, or pop3.
The folders for this account are only included if requested.