Name Description Size
AccountConfig.sys.mjs This file creates the class AccountConfig, which is a JS object that holds a configuration for a certain account. It is *not* created in the backend yet (use aw-createAccount.js for that), and it may be incomplete. Several AccountConfig objects may co-exist, e.g. for autoconfig. One AccountConfig object is used to prefill and read the widgets in the Wizard UI. When we autoconfigure, we autoconfig writes the values into a new object and returns that, and the caller can copy these values into the object used by the UI. See also <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat> for values stored. 16848
AccountCreationUtils.sys.mjs Some common, generic functions 9861
ConfigVerifier.sys.mjs @implements {nsIUrlListener} @implements {nsIInterfaceRequestor} 12913
CreateInBackend.sys.mjs Takes an |AccountConfig| JS object and creates that account in the Thunderbird backend (which also writes it to prefs). @param {AccountConfig} config - The account to create. @returns {nsIMsgAccount} - The newly created account. 15774
ExchangeAutoDiscover.sys.mjs Initiates a fetch of the given URL, using either OAuth2 or Basic authentication. OAuth2 will be tried first, before falling back onto Basic auth if either: - we do not have an OAuth2 configuration for this provider, or - we failed to get an OAuth2 access token to use in the fetch (e.g., because the user cancelled the interactive login process). A deep copy of `callArgs` is always done before modifying it, so it can be reused between calls. @param {string} url - The URL to fetch. @param {string} username - The username to use for Basic auth and OAuth2. @param {string} password - The password to use for Basic auth. @param {object} callArgs - The arguments to use when calling fetchHTTP. This object is not expected to include any authentication parameters or headers. @returns {any} The response body from the target URL, probably an object. 27706
FetchConfig.sys.mjs Tries to find a configuration for this ISP on the local harddisk, in the application install directory's "isp" subdirectory. @param {string} domain - The domain part of the user's email address. @param {AbortSignal} abortSignal - Abort signal that should cancel the operation. @returns {AccountConfig} The account config. @throws {Error} If no config is found. 10014
FetchHTTP.sys.mjs This is a small wrapper around XMLHttpRequest, which solves various inadequacies of the API, e.g. error handling. It is entirely generic and can be used for purposes outside of even mail. It does not provide download progress, but assumes that the fetched resource is so small (<1 10 KB) that the roundtrip and response generation is far more significant than the download time of the response. In other words, it's fine for RPC, but not for bigger file downloads. 8945
FindConfig.sys.mjs Finds and returns an AccountConfig, including incoming exchange exchange alternatives, from a domain and email address. If autoconfig or autodiscovery finds nothing, returns null. This is an async generator function, as we need to pause the function in case we need to wait for confirmation to continue with autodiscovery if the domain is hosted by a 3rd party. @generator @param {string} domain - The domain of the emailAddress used for discovery. @param {string} emailAddress - The emailAddress used for discovery. @param {AbortSignal} abortSignal @param {string} [password] - Password if available, used for exchange. @param {string} [exchangeUsername] - Separate username to authenticate exchange autodiscovery lookups with. @yields {object} - May yield object saying redirect is required with host. @returns {?AccountConfig} @see AccountConfig.sys.mjs 9619
GuessConfig.sys.mjs Try to guess the config, by: - guessing hostnames (pop3.<domain>, pop.<domain>, imap.<domain>, mail.<domain> etc.) - probing known ports (for IMAP, POP3 etc., with SSL, STARTTLS etc.) - opening a connection via the right protocol and checking the protocol-specific CAPABILITIES like that the server returns. Final verification is not done here, but in verifyConfig(). This function is async. @param {string} domain - The domain part of the email address. @param {function(string,string,integer,nsMsgSocketType,boolean):void} progressCallback - A function: {function(type, hostname, port, socketType, done)} Called when we try a new hostname/port. - type {String-enum} @see AccountConfig type - "imap", "pop3", "smtp" - hostname {String} - port {Integer} - socketType {nsMsgSocketType} @see MailNewsTypes2.idl 0 = plain, 2 = STARTTLS, 3 = SSL - done {Boolean} - false, if we start probing this host/port, true if we're done and the host is good. (there is no notification when a host is bad, we'll just tell about the next host tried) @param {AccountConfig} [resultConfig] - A config which may be partially filled in. If so, it will be used as base for the guess. @param {"incoming"|"outgoing"|"both"} [which="both"] - Whether to guess only the incoming or outgoing server. @param {AbortSignal} abortSignal 41235
LDAPDirectoryUtils.sys.mjs @typedef {LDAPCredentials} LDAPStateData @property {number} maxResults - The max results for the LDAP Directory. @property {number} scope - The scope (number value) of the LDAP Directory. @property {string} loginMethod - The login method of the LDAP directory. @property {string} searchFilter - The search filter on the LDAP Directory. @property {boolean} isAdvanced - Boolean to determine if state is advanced. 2826
readFromXML.sys.mjs Takes an XML snipplet (as JXON) and reads the values into a new AccountConfig object. It does so securely (or tries to), by trying to avoid remote execution and similar holes which can appear when reading too naively. Of course it cannot tell whether the actual values are correct, e.g. it can't tell whether the host name is a good server. The XML format is documented at <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat> @param {object} clientConfigXML - The <clientConfig> node as JXON. @param {string} subSource - Used for the subSource field of AccountConfig. @returns {AccountConfig} AccountConfig object filled with the data from XML. 10419
RemoteAddressBookUtils.sys.mjs Maintains a list of CardDAV address book URIs. Lazily initialized and updated. 6689
Sanitizer.sys.mjs This is a generic input validation lib. Use it when you process data from the network. Just a few functions which verify, for security purposes, that the input variables (strings, if nothing else is noted) are of the expected type and syntax. The functions take a string (unless noted otherwise) and return the expected datatype in JS types. If the value is not as expected, they throw exceptions. 7781