Revision control

Copy as Markdown

Other Tools

[
{
"namespace": "manifest",
"types": [
{
"$extend": "OptionalPermission",
"choices": [
{
"type": "string",
"enum": [
"messagesDelete",
"messagesImport",
"messagesMove",
"messagesRead",
"messagesTags",
"messagesTagsList",
"messagesUpdate",
"messagesModifyPermanent",
"sensitiveDataUpload"
]
}
]
}
]
},
{
"namespace": "messages",
"permissions": ["messagesRead"],
"types": [
{
"id": "MessageId",
"type": "integer",
"minimum": 1,
"description": "A unique id representing a :ref:`messages.MessageHeader` and the associated message. This id doesn’t refer to the Message-ID email header. It is an internal tracking number that does not remain after a restart. Nor does it follow an email that has been moved to a different folder."
},
{
"id": "MessageHeader",
"type": "object",
"description": "Basic information about a message.",
"properties": {
"author": {
"type": "string"
},
"bccList": {
"description": "The Bcc recipients. Not populated for news/nntp messages.",
"type": "array",
"items": {
"type": "string"
}
},
"ccList": {
"description": "The Cc recipients. Not populated for news/nntp messages.",
"type": "array",
"items": {
"type": "string"
}
},
"date": {
"$ref": "extensionTypes.Date"
},
"external": {
"type": "boolean",
"description": "Whether this message is a real message or an external message (opened from a file or from an attachment)."
},
"flagged": {
"type": "boolean",
"description": "Whether this message is flagged (a.k.a. starred)."
},
"folder": {
"$ref": "folders.MailFolder",
"description": "The <permission>accountsRead</permission> permission is required for this property to be included. Not available for external or attached messages.",
"optional": true
},
"headerMessageId": {
"type": "string",
"description": "The message-id header of the message."
},
"headersOnly": {
"description": "Some account types (for example <value>pop3</value>) allow to download only the headers of the message, but not its body. The body of such messages will not be available.",
"type": "boolean"
},
"id": {
"$ref": "messages.MessageId"
},
"junk": {
"description": "Whether the message has been marked as junk. Always <value>false</value> for news/nntp messages and external messages.",
"type": "boolean"
},
"junkScore": {
"type": "integer",
"description": "The junk score associated with the message. Always <value>0</value> for news/nntp messages and external messages.",
"minimum": 0,
"maximum": 100
},
"read": {
"type": "boolean",
"optional": true,
"description": "Whether the message has been marked as read. Not available for external or attached messages."
},
"new": {
"type": "boolean",
"description": "Whether the message has been received recently and is marked as new."
},
"recipients": {
"description": "The To recipients. Not populated for news/nntp messages.",
"type": "array",
"items": {
"type": "string"
}
},
"size": {
"description": "The total size of the message in bytes.",
"type": "integer"
},
"subject": {
"type": "string",
"description": "The subject of the message."
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Tags associated with this message. For a list of available tags, use :ref:`messages.tags.list`."
}
}
},
{
"id": "MessageList",
"type": "object",
"description": "See :doc:`examples/messageLists` for more information.",
"properties": {
"id": {
"choices": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Id of the message list, to be used with :ref:`messages.continueList` or :ref:`messages.abortList`."
},
"messages": {
"type": "array",
"items": {
"$ref": "MessageHeader"
}
}
}
},
{
"id": "MessagePart",
"type": "object",
"description": "Represents an email message \"part\", which could be the whole message.",
"properties": {
"body": {
"type": "string",
"description": "The content of the part.",
"optional": true
},
"contentType": {
"type": "string",
"optional": true
},
"decryptionStatus": {
"type": "string",
"optional": true,
"description": "The decryption status, only available for the root part.",
"enum": ["none", "skipped", "success", "fail"]
},
"headers": {
"type": "object",
"description": "A <em>dictionary object</em> of part headers as <em>key-value</em> pairs, with the header name as <em>key</em>, and an array of headers as <em>value</em>.",
"optional": true,
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"name": {
"type": "string",
"description": "Name of the part, if it is a file.",
"optional": true
},
"partName": {
"type": "string",
"optional": true,
"description": "The identifier of this part, used in :ref:`messages.getAttachmentFile`."
},
"parts": {
"type": "array",
"items": {
"$ref": "MessagePart"
},
"description": "Any sub-parts of this part.",
"optional": true
},
"size": {
"type": "integer",
"optional": true,
"description": "The size of this part. The size of <em>message/*</em> parts is not the actual message size (on disc), but the total size of its decoded body parts, excluding headers."
}
}
},
{
"id": "MessageProperties",
"type": "object",
"description": "Message properties used in :ref:`messages.update` and :ref:`messages.import`. They can also be monitored by :ref:`messages.onUpdated`.",
"properties": {
"flagged": {
"type": "boolean",
"description": "Whether the message is flagged (a.k.a starred).",
"optional": true
},
"junk": {
"type": "boolean",
"optional": true,
"description": "Whether the message is marked as junk. Only supported in :ref:`messages.update`."
},
"new": {
"type": "boolean",
"description": "Whether the message is marked as new. Only supported in :ref:`messages.import`.",
"optional": true
},
"read": {
"type": "boolean",
"description": "Whether the message is marked as read.",
"optional": true
},
"tags": {
"type": "array",
"description": "Tags associated with this message. For a list of available tags, call the :ref:`messages.tags.list` method.",
"optional": true,
"items": {
"type": "string"
}
}
}
},
{
"id": "MessageAttachment",
"type": "object",
"description": "Represents an attachment in a message.",
"properties": {
"contentType": {
"type": "string",
"description": "The content type of the attachment. A value of <value>text/x-moz-deleted</value> indicates that the original attachment was permanently deleted and replaced by a placeholder text attachment with some meta information about the original attachment."
},
"name": {
"type": "string",
"description": "The name, as displayed to the user, of this attachment. This is usually but not always the filename of the attached file."
},
"partName": {
"type": "string",
"description": "Identifies the MIME part of the message associated with this attachment."
},
"size": {
"type": "integer",
"description": "The size in bytes of this attachment."
},
"message": {
"$ref": "messages.MessageHeader",
"optional": true,
"description": "A MessageHeader, if this attachment is a message."
}
}
},
{
"id": "QueryRange",
"type": "object",
"description": "An object defining a range.",
"properties": {
"min": {
"type": "integer",
"optional": true,
"description": "The minimum value required to match the query."
},
"max": {
"type": "integer",
"optional": true,
"description": "The maximum value required to match the query."
}
}
}
],
"events": [
{
"name": "onUpdated",
"type": "function",
"description": "Fired when one or more properties of a message have been updated.",
"parameters": [
{
"name": "message",
"$ref": "messages.MessageHeader"
},
{
"name": "changedProperties",
"$ref": "messages.MessageProperties"
}
]
},
{
"name": "onMoved",
"type": "function",
"description": "Fired when messages have been moved.",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "originalMessages",
"$ref": "messages.MessageList"
},
{
"name": "movedMessages",
"$ref": "messages.MessageList"
}
]
},
{
"name": "onCopied",
"type": "function",
"description": "Fired when messages have been copied.",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "originalMessages",
"$ref": "messages.MessageList"
},
{
"name": "copiedMessages",
"$ref": "messages.MessageList"
}
]
},
{
"name": "onDeleted",
"type": "function",
"description": "Fired when messages have been permanently deleted.",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "messages",
"$ref": "messages.MessageList"
}
]
},
{
"name": "onNewMailReceived",
"type": "function",
"description": "Fired when a new message is received, and has been through junk classification and message filters.",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "folder",
"$ref": "folders.MailFolder"
},
{
"name": "messages",
"$ref": "messages.MessageList"
}
],
"extraParameters": [
{
"name": "monitorAllFolders",
"description": "Monitor all folders (including all special use folders as defined by :ref:`folders.MailFolderSpecialUse`) instead of just inbox folders and normal folders.",
"type": "boolean",
"optional": true
}
]
}
],
"functions": [
{
"name": "list",
"type": "function",
"min_manifest_version": 3,
"description": "Gets all messages in a folder.",
"async": "callback",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "folderId",
"$ref": "folders.MailFolderId"
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "messages.MessageList"
}
]
}
]
},
{
"name": "list",
"type": "function",
"max_manifest_version": 2,
"description": "Gets all messages in a folder.",
"async": "callback",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "folder",
"choices": [
{
"$ref": "folders.MailFolderId"
},
{
"deprecated": "Support deprecated since Thunderbird 121 and removed in Manifest V3: messages.list() requires to specify a MailFolderId instead of a full MailFolder object.",
"$ref": "folders.MailFolder"
}
]
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "messages.MessageList"
}
]
}
]
},
{
"name": "continueList",
"type": "function",
"description": "Returns the next chunk of messages in a list. See :doc:`examples/messageLists` for more information.",
"async": "callback",
"parameters": [
{
"name": "messageListId",
"type": "string"
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "messages.MessageList"
}
]
}
]
},
{
"name": "abortList",
"type": "function",
"description": "Finalizes the specified list and terminates any process currently still adding messages.",
"async": true,
"parameters": [
{
"name": "messageListId",
"type": "string"
}
]
},
{
"name": "get",
"type": "function",
"description": "Returns the specified message.",
"async": "callback",
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "MessageHeader"
}
]
}
]
},
{
"name": "getFull",
"type": "function",
"description": "Returns the specified message, including all headers and MIME parts. Throws if the message could not be read, for example due to network issues.",
"async": "callback",
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"name": "options",
"type": "object",
"properties": {
"decrypt": {
"type": "boolean",
"description": "Whether the message should be decrypted. If the message could not be decrypted, its parts are omitted. Defaults to true.",
"optional": true
}
},
"optional": true
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "MessagePart"
}
]
}
]
},
{
"name": "getRaw",
"type": "function",
"description": "Returns the unmodified source of a message. Throws if the message could not be read, for example due to network issues.",
"async": "callback",
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"name": "options",
"type": "object",
"properties": {
"decrypt": {
"type": "boolean",
"description": "Whether the message should be decrypted. Throws, if the message could not be decrypted.",
"optional": true
},
"data_format": {
"choices": [
{
"max_manifest_version": 2,
"description": "The message can either be returned as a DOM File or as a `binary string <|link-binary-string|>`__. The historic default is to return a binary string (kept for backward compatibility). However, it is now recommended to use the ``File`` format, because the DOM File object can be used as-is with the downloads API and has useful methods to access the content, like `File.text() <|link-DOMFile-text|>`__ and `File.arrayBuffer() <|link-DOMFile-arrayBuffer|>`__. Working with binary strings is error prone and needs special handling: <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude> (see MDN for `supported input encodings <|link-input-encoding|>`__).",
"type": "string",
"enum": ["File", "BinaryString"]
},
{
"min_manifest_version": 3,
"description": "The message can either be returned as a DOM File (default) or as a `binary string <|link-binary-string|>`__. It is recommended to use the ``File`` format, because the DOM File object can be used as-is with the downloads API and has useful methods to access the content, like `File.text() <|link-DOMFile-text|>`__ and `File.arrayBuffer() <|link-DOMFile-arrayBuffer|>`__. Working with binary strings is error prone and needs special handling: <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude> (see MDN for `supported input encodings <|link-input-encoding|>`__).",
"type": "string",
"enum": ["File", "BinaryString"]
}
],
"optional": true
}
},
"optional": true
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"choices": [
{
"type": "string"
},
{
"type": "object",
"isInstanceOf": "File",
"additionalProperties": true
}
]
}
]
}
]
},
{
"name": "listAttachments",
"type": "function",
"description": "Lists the attachments of a message.",
"async": "callback",
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "array",
"items": {
"$ref": "MessageAttachment"
}
}
]
}
]
},
{
"name": "getAttachmentFile",
"type": "function",
"description": "Gets the content of a :ref:`messages.MessageAttachment` as a |File| object.",
"async": "callback",
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"name": "partName",
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "object",
"isInstanceOf": "File",
"additionalProperties": true
}
]
}
]
},
{
"name": "deleteAttachments",
"type": "function",
"description": "Deletes the specified attachments and replaces them by placeholder text attachments with meta information about the original attachments and a <value>text/x-moz-deleted</value> content type. This permanently modifies the message.",
"permissions": ["messagesModifyPermanent"],
"async": true,
"parameters": [
{
"name": "messageId",
"type": "integer"
},
{
"name": "partNames",
"type": "array",
"description": "An array of attachments, identifying the to be deleted attachments by their <value>partName</value>.",
"items": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
"minItems": 1
}
]
},
{
"name": "openAttachment",
"type": "function",
"description": "Opens the specified attachment.",
"async": true,
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"name": "partName",
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
{
"name": "tabId",
"type": "integer",
"description": "The ID of the tab associated with the message opening."
}
]
},
{
"name": "query",
"type": "function",
"description": "Gets all messages that have the specified properties, or all messages if no properties are specified. Messages of unified mailbox folders are not included by default (as that could double the amount of returned messages), but explicitly specifying a unified mailbox folder is supported.",
"async": "callback",
"parameters": [
{
"type": "object",
"name": "queryInfo",
"optional": true,
"default": {},
"properties": {
"accountId": {
"$ref": "accounts.MailAccountId",
"description": "Limits the search to folders of the account with the specified id.",
"optional": true
},
"attachment": {
"choices": [
{
"type": "boolean"
},
{
"$ref": "QueryRange"
}
],
"optional": true,
"description": "Whether the message has attachments, or not. Supports to specify a :ref:`messages.QueryRange` (min/max) instead of a simple boolean value (none/some)."
},
"author": {
"type": "string",
"optional": true,
"description": "Returns only messages with this value matching the author. The search value is a single email address, a name or a combination (e.g.: <value>Name <user@domain.org></value>). The address part of the search value (if provided) must match the author's address completely. The name part of the search value (if provided) must match the author's name partially. All matches are done case-insensitive."
},
"body": {
"type": "string",
"optional": true,
"description": "Returns only messages with this value in the body of the mail."
},
"flagged": {
"type": "boolean",
"optional": true,
"description": "Returns only flagged (or unflagged if false) messages."
},
"folderId": {
"$ref": "folders.MailFolderId",
"optional": true,
"description": "Returns only messages from the folder with the specified id. The <permission>accountsRead</permission> permission is required."
},
"folder": {
"$ref": "folders.MailFolder",
"max_manifest_version": 2,
"deprecated": "Support deprecated since Thunderbird 121 and removed in Manifest V3: messages.queryInfo.folder has been replaced by messages.queryInfo.folderId.",
"optional": true,
"description": "Returns only messages from the specified folder. The <permission>accountsRead</permission> permission is required."
},
"fromDate": {
"$ref": "extensionTypes.Date",
"optional": true,
"description": "Returns only messages with a date after this value."
},
"fromMe": {
"type": "boolean",
"optional": true,
"description": "Returns only messages with the author's address matching any configured identity."
},
"fullText": {
"type": "string",
"optional": true,
"description": "Returns only messages with this value somewhere in the mail (subject, body or author)."
},
"headerMessageId": {
"type": "string",
"optional": true,
"description": "Returns only messages with a Message-ID header matching this value."
},
"includeSubFolders": {
"type": "boolean",
"optional": true,
"description": "Search the specified folder recursively."
},
"recipients": {
"type": "string",
"optional": true,
"description": "Returns only messages whose recipients match all specified addresses. The search value is a semicolon separated list of email addresses, names or combinations (e.g.: <value>Name <user@domain.org></value>). For a match, all specified addresses must equal a recipient's address completely and all specified names must match a recipient's name partially. All matches are done case-insensitive."
},
"size": {
"$ref": "QueryRange",
"optional": true,
"description": "Returns only messages with a size in the specified byte range."
},
"subject": {
"type": "string",
"optional": true,
"description": "Returns only messages whose subject contains the provided string."
},
"tags": {
"$ref": "messages.tags.TagsDetail",
"optional": true,
"description": "Returns only messages with the specified tags. For a list of available tags, call the :ref:`messages.tags.list` method."
},
"toDate": {
"$ref": "extensionTypes.Date",
"optional": true,
"description": "Returns only messages with a date before this value."
},
"toMe": {
"type": "boolean",
"optional": true,
"description": "Returns only messages with at least one recipient address matching any configured identity."
},
"junk": {
"type": "boolean",
"optional": true,
"description": "Returns only messages whith the specified junk state."
},
"junkScore": {
"$ref": "QueryRange",
"optional": true,
"description": "Returns only messages with a junk score in the specified range."
},
"new": {
"type": "boolean",
"optional": true,
"description": "Returns only messages with the specified new state."
},
"unread": {
"type": "boolean",
"optional": true,
"max_manifest_version": 2,
"description": "Returns only unread (or read if false) messages."
},
"read": {
"type": "boolean",
"optional": true,
"description": "Returns only messages with the specified read state.",
"min_manifest_version": 3
},
"autoPaginationTimeout": {
"type": "integer",
"optional": true,
"description": "Set the timeout in ms after which results should be returned, even if the nominal number of messages-per-page has not yet been reached. Defaults to <value>1000</value> ms. Setting it to <value>0</value> will disable auto-pagination."
},
"messagesPerPage": {
"type": "integer",
"optional": true,
"description": "Set the nominal number of messages-per-page for this query. Defaults to <value>100</value> messages."
},
"returnMessageListId": {
"type": "boolean",
"optional": true,
"description": "The <em>messageListId</em> is usually returned together with the first page, after some messages have been found. Enabling this option will change the return value of this function and return the <em>messageListId</em> directly."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"choices": [
{
"$ref": "messages.MessageList"
},
{
"type": "string"
}
]
}
]
}
]
},
{
"name": "update",
"type": "function",
"description": "Updates message properties and tags. Updating external messages will throw an <em>ExtensionError</em>.",
"async": true,
"permissions": ["messagesUpdate"],
"parameters": [
{
"name": "messageId",
"$ref": "messages.MessageId"
},
{
"name": "newProperties",
"$ref": "MessageProperties"
}
]
},
{
"name": "move",
"type": "function",
"max_manifest_version": 2,
"description": "Moves messages to a specified folder. If the messages cannot be removed from the source folder, they will be copied instead of moved. Moving external messages will throw an <em>ExtensionError</em>.",
"async": true,
"permissions": ["accountsRead", "messagesMove"],
"parameters": [
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages to move.",
"items": {
"$ref": "messages.MessageId"
}
},
{
"name": "destination",
"choices": [
{
"$ref": "folders.MailFolderId"
},
{
"deprecated": "Support deprecated since Thunderbird 121 and removed in Manifest V3: messages.move() requires to specify a MailFolderId instead of a full MailFolder object.",
"$ref": "folders.MailFolder"
}
],
"description": "The folder to move the messages to."
}
]
},
{
"name": "move",
"type": "function",
"min_manifest_version": 3,
"description": "Moves messages to a specified folder. If the messages cannot be removed from the source folder, they will be copied instead of moved. Moving external messages will throw an <em>ExtensionError</em>.",
"async": true,
"permissions": ["accountsRead", "messagesMove"],
"parameters": [
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages to move.",
"items": {
"$ref": "messages.MessageId"
}
},
{
"name": "folderId",
"$ref": "folders.MailFolderId",
"description": "The folder to move the messages to."
}
]
},
{
"name": "copy",
"type": "function",
"max_manifest_version": 2,
"description": "Copies messages to a specified folder.",
"async": true,
"permissions": ["accountsRead", "messagesMove"],
"parameters": [
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages to copy.",
"items": {
"$ref": "messages.MessageId"
}
},
{
"name": "destination",
"choices": [
{
"$ref": "folders.MailFolderId"
},
{
"deprecated": "Support deprecated since Thunderbird 121 and removed in Manifest V3: messages.copy() requires to specify a MailFolderId instead of a full MailFolder object.",
"$ref": "folders.MailFolder"
}
],
"description": "The folder to copy the messages to."
}
]
},
{
"name": "copy",
"type": "function",
"min_manifest_version": 3,
"description": "Copies messages to a specified folder.",
"async": true,
"permissions": ["accountsRead", "messagesMove"],
"parameters": [
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages to copy.",
"items": {
"$ref": "messages.MessageId"
}
},
{
"name": "folderId",
"$ref": "folders.MailFolderId",
"description": "The folder to copy the messages to."
}
]
},
{
"name": "delete",
"type": "function",
"description": "Deletes messages permanently, or moves them to the trash folder (honoring the account's deletion behavior settings). Deleting external messages will throw an <em>ExtensionError</em>. The ``skipTrash`` parameter allows immediate permanent deletion, bypassing the trash folder.",
"async": true,
"permissions": ["messagesDelete"],
"parameters": [
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages to delete.",
"items": {
"$ref": "messages.MessageId"
}
},
{
"name": "skipTrash",
"type": "boolean",
"description": "If true, the message will be deleted permanently, regardless of the account's deletion behavior settings.",
"optional": true
}
]
},
{
"name": "import",
"type": "function",
"max_manifest_version": 2,
"description": "Imports a message into a local Thunderbird folder. To import a message into an IMAP folder, add it to a local folder first and then move it to the IMAP folder.",
"async": "callback",
"permissions": ["accountsRead", "messagesImport"],
"parameters": [
{
"name": "file",
"type": "object",
"isInstanceOf": "File",
"additionalProperties": true
},
{
"name": "destination",
"choices": [
{
"$ref": "folders.MailFolderId"
},
{
"deprecated": "Support deprecated since Thunderbird 121 and removed in Manifest V3: messages.import() requires to specify a MailFolderId instead of a full MailFolder object.",
"$ref": "folders.MailFolder"
}
],
"description": "The folder to import the messages into."
},
{
"name": "properties",
"$ref": "messages.MessageProperties",
"optional": true
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "messages.MessageHeader"
}
]
}
]
},
{
"name": "import",
"type": "function",
"min_manifest_version": 3,
"description": "Imports a message into a local Thunderbird folder. To import a message into an IMAP folder, add it to a local folder first and then move it to the IMAP folder.",
"async": "callback",
"permissions": ["accountsRead", "messagesImport"],
"parameters": [
{
"name": "file",
"type": "object",
"isInstanceOf": "File",
"additionalProperties": true
},
{
"name": "folderId",
"$ref": "folders.MailFolderId",
"description": "The folder to import the messages into."
},
{
"name": "properties",
"$ref": "messages.MessageProperties",
"optional": true
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "messages.MessageHeader"
}
]
}
]
},
{
"name": "archive",
"type": "function",
"description": "Archives messages using the current settings. Archiving external messages will throw an <em>ExtensionError</em>.",
"async": true,
"permissions": ["messagesMove"],
"parameters": [
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages to archive.",
"items": {
"$ref": "messages.MessageId"
}
}
]
},
{
"name": "listTags",
"type": "function",
"description": "Returns a list of tags that can be set on messages, and their human-friendly name, colour, and sort order.",
"async": "callback",
"max_manifest_version": 2,
"deprecated": "Deprecated since Thunderbird 121 and removed in Manifest V3: messages.listTags() is now available as messages.tags.list().",
"parameters": [
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "array",
"items": {
"$ref": "messages.tags.MessageTag"
}
}
]
}
]
},
{
"name": "createTag",
"type": "function",
"description": "Creates a new message tag. Tagging a message will store the tag's key in the user's message. Throws if the specified tag key is used already.",
"async": true,
"permissions": ["messagesTags"],
"max_manifest_version": 2,
"deprecated": "Deprecated since Thunderbird 121 and removed in Manifest V3: messages.createTag() is now available as messages.tags.create().",
"parameters": [
{
"type": "string",
"name": "key",
"description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
"pattern": "^[^ ()/{%*<>\"]+$"
},
{
"type": "string",
"name": "tag",
"description": "Human-readable tag name."
},
{
"type": "string",
"name": "color",
"description": "Tag color in hex format (i.e.: <value>#000080</value> for navy blue). Value will be stored as upper case.",
"pattern": "^#[0-9a-fA-F]{6}"
}
]
},
{
"name": "updateTag",
"type": "function",
"description": "Updates a message tag. Throws if the specified tag key does not exist.",
"async": true,
"permissions": ["messagesTags"],
"max_manifest_version": 2,
"deprecated": "Deprecated since Thunderbird 121 and removed in Manifest V3: messages.updateTag() is now available as messages.tags.update().",
"parameters": [
{
"type": "string",
"name": "key",
"description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
"pattern": "^[^ ()/{%*<>\"]+$"
},
{
"type": "object",
"name": "updateProperties",
"properties": {
"tag": {
"type": "string",
"optional": true,
"description": "Human-readable tag name."
},
"color": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}",
"description": "Tag color in hex format (i.e.: #000080 for navy blue). Value will be stored as upper case.",
"optional": true
}
}
}
]
},
{
"name": "deleteTag",
"type": "function",
"description": "Deletes a message tag, removing it from the list of known tags. Its key will not be removed from tagged messages, but they will appear untagged. Recreating a deleted tag, will make all former tagged messages appear tagged again.",
"async": true,
"permissions": ["messagesTags"],
"max_manifest_version": 2,
"deprecated": "Deprecated since Thunderbird 121 and removed in Manifest V3: messages.deleteTag() is now available as messages.tags.delete().",
"parameters": [
{
"type": "string",
"name": "key",
"description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
"pattern": "^[^ ()/{%*<>\"]+$"
}
]
}
]
},
{
"namespace": "messages.tags",
"types": [
{
"id": "MessageTag",
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "Unique tag identifier."
},
"tag": {
"type": "string",
"description": "Human-readable tag name."
},
"color": {
"type": "string",
"description": "Tag color."
},
"ordinal": {
"type": "string",
"description": "Custom sort string (usually empty)."
}
}
},
{
"id": "TagsDetail",
"type": "object",
"description": "Used for filtering messages by tag in various methods. Note that functions using this type may have a partial implementation.",
"properties": {
"tags": {
"type": "object",
"description": "A <em>dictionary object</em> with one or more filter condition as <em>key-value</em> pairs, the <em>key</em> being the tag to filter on, and the <em>value</em> being a boolean expression, requesting whether a message must include (<value>true</value>) or exclude (<value>false</value>) the tag. For a list of available tags, call the :ref:`messages.tags.list` method.",
"patternProperties": {
".*": {
"type": "boolean"
}
}
},
"mode": {
"type": "string",
"description": "Whether all of the tag filters must apply, or any of them.",
"enum": ["all", "any"]
}
}
}
],
"functions": [
{
"name": "list",
"type": "function",
"description": "Returns a list of tags that can be set on messages, and their human-friendly name, colour, and sort order.",
"async": "callback",
"permissions": ["messagesTagsList"],
"parameters": [
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "array",
"items": {
"$ref": "messages.tags.MessageTag"
}
}
]
}
]
},
{
"name": "create",
"type": "function",
"description": "Creates a new message tag. Tagging a message will store the tag's key in the user's message. Throws if the specified tag key is used already.",
"async": true,
"permissions": ["messagesTags"],
"parameters": [
{
"type": "string",
"name": "key",
"description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
"pattern": "^[^ ()/{%*<>\"]+$"
},
{
"type": "string",
"name": "tag",
"description": "Human-readable tag name."
},
{
"type": "string",
"name": "color",
"description": "Tag color in hex format (i.e.: #000080 for navy blue). Value will be stored as upper case.",
"pattern": "^#[0-9a-fA-F]{6}"
}
]
},
{
"name": "update",
"type": "function",
"description": "Updates a message tag. Throws if the specified tag key does not exist.",
"async": true,
"permissions": ["messagesTags"],
"parameters": [
{
"type": "string",
"name": "key",
"description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
"pattern": "^[^ ()/{%*<>\"]+$"
},
{
"type": "object",
"name": "updateProperties",
"properties": {
"tag": {
"type": "string",
"optional": true,
"description": "Human-readable tag name."
},
"color": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}",
"description": "Tag color in hex format (i.e.: #000080 for navy blue). Value will be stored as upper case.",
"optional": true
}
}
}
]
},
{
"name": "delete",
"type": "function",
"description": "Deletes a message tag, removing it from the list of known tags. Its key will not be removed from tagged messages, but they will appear untagged. Recreating a deleted tag, will make all former tagged messages appear tagged again.",
"async": true,
"permissions": ["messagesTags"],
"parameters": [
{
"type": "string",
"name": "key",
"description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
"pattern": "^[^ ()/{%*<>\"]+$"
}
]
}
]
}
]