Name Description Size
ABQueryUtils.jsm This file contains helper methods for dealing with addressbook search URIs. 5538
components.conf 3026
converterWorker.js eslint-env mozilla/chrome-worker, node 17611
FolderLookupService.jsm This module implements the folder lookup service (nsIFolderLookupService). 4749
FolderUtils.jsm This file contains helper methods for dealing with nsIMsgFolders. 9426
HeaderReader.h HeaderReader parses mail headers from a buffer. The input is fed in via Parse(), and a callback function is invoked for each header encountered. General goals: - Incremental. Parse() can be called multiple times as a buffer grows. - Works in-place. Headers are returned as byte ranges within the data. - Works with a partial header block (e.g. sniffing the first N bytes of a message file). It won't mistakenly emit an incomplete header. - Track exact byte offsets for values, to support rewriting headers in place. This is needed to support X-Mozilla-Status et al. - Avoids copying data where possible. - Callback is inlined. - Callback can halt processing (by returning false). - Tolerant of real-world oddness in input data (for now, we just skip lines which don't make sense). Example usage: nsCString raw = "To: Alice\r\nFrom: Bob\r\n\r\n...Message body..."_ns; auto cb = [&](HeaderReader::Header const& hdr) { printf("-> '%s':'%s'\n", hdr.Name(raw), hdr.Value(raw)); return true; }; HeaderReader rdr; rdr.Parse(raw, cb); // -> 'To':'Alice' // -> 'From':'Bob' See TestHeaderReader.cpp for more examples. 10750
hostnameUtils.jsm Generic shared utility code for checking of IP and hostname validity. 11870
JsTreeSelection.jsm Partial nsITreeSelection implementation so that we can have nsMsgDBViews that exist only for message display but do not need to be backed by a full tree view widget. This could also hopefully be used for more xpcshell unit testing of the FolderDisplayWidget. It might also be useful for creating transient selections when right-click selection happens. Our current limitations: - We do not support any single selection modes. This is mainly because we need to look at the box object for that and we don't want to do it. - Timed selection. Our expected consumers don't use it. Our current laziness: - We aren't very precise about invalidation when it would be potentially complicated. The theory is that if there is a tree box object, it's probably native and the XPConnect overhead is probably a lot more than any potential savings, at least for now when the tree display is generally C++ XPCOM backed rather than JS XPCOM backed. Also, we aren't intended to actually be used with a real tree display; you should be using the C++ object in that case! If documentation is omitted for something, it is because we have little to add to the documentation of nsITreeSelection and really hope that our documentation tool will copy-down that documentation. This implementation attempts to mimic the behavior of nsTreeSelection. In a few cases, this leads to potentially confusing actions. I attempt to note when we are doing this and why we do it. Unit test is in mailnews/base/util/test_jsTreeSelection.js 22803
JXON.jsm Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ 4401
LineReader.h FirstLine() returns the first line of a span. The EOL sequence (CRLF or LF) is included in the returned line. If no lines are found an empty span is returned. 6477
LineReader.jsm For a single request, mail servers may return several multi-line responses. A definition of multi-line responses can be found at rfc3977#section-3.1.1. This class helps dealing with multi-line responses by: - Break up a response to lines - Join incomplete line from a previous response with the current response - Remove stuffed dot (.. at the beginning of a line) - Detect the end of the response (\r\n.\r\n) 2060
MailAuthenticator.jsm A base class for interfaces when authenticating a mail connection. 11192
MailCryptoUtils.jsm Converts a binary string into a Uint8Array. @param {BinaryString} str - The string to convert. @returns {Uint8Array}. 2078
MailNewsCommandLineHandler.jsm nsICommandLineHandler 5164
MailNewsDLF.cpp 2856
MailNewsDLF.h This factory is a thin wrapper around the text/html loader factory. All it does is convert message/rfc822 to text/html and delegate the rest of the work to the text/html factory. 998
MailnewsLoadContextInfo.cpp 1499
MailnewsLoadContextInfo.h 841
MailnewsMigrator.jsm Migrate profile (prefs and other files) from older versions of Mailnews to current. This should be run at startup. It migrates as needed: each migration function should be written to be a no-op when the value is already migrated or was never used in the old version. 11477
MailNotificationManager.jsm A module that listens to folder change events, and show notifications for new mails if necessary. 14597
MailNotificationService.jsm platform-independent code to count new and unread messages and pass the information to platform-specific notification modules Default logging is at the Warn level. Other possibly interesting messages are at Error, Info and Debug. To configure, set the preferences "mail.notification.loglevel" to the string indicating the level you want. 13023
MailServices.jsm 2686
mailstoreConverter.jsm Sets a server to use a different type of mailstore, converting all the existing data. @param {String} aMailstoreContractId - XPCOM id of new mailstore type. @param {nsIMsgServer} aServer - server to migrate. @param aEventTarget - if set, element to send progress events. @returns {Promise} - Resolves with a string containing the new root directory for the migrated server. Rejects with an error message. 11417
MailStringUtils.jsm Convert a ByteString to a Uint8Array. @param {ByteString} str - The input string. @returns {Uint8Array} The output Uint8Array. 2862
moz.build 4057
MsgAsyncPrompter.jsm 18138
MsgDBCacheManager.jsm Message DB Cache manager 5374
MsgIncomingServer.jsm When hostname/username changes, update the corresponding entry in nsILoginManager. @param {string} localStoreType - The store type of the current server. @param {string} oldHostname - The hostname before the change. @param {string} oldUsername - The username before the change. @param {string} newHostname - The hostname after the change. @param {string} newUsername - The username after the change. 32396
MsgKeySet.jsm A structure to represent a set of articles. This is usually for lines from the newsrc, which have article lists like 1-29627,29635,29658,32861-32863 so the data has these properties: - strictly increasing - large subsequences of monotonically increasing ranges - gaps in the set are usually small, but not always - consecutive ranges tend to be large 3384
nsCidProtocolHandler.cpp 2072
nsCidProtocolHandler.h nsCidProtocolHandler_h__ 778
nsCommonModule.cpp 3174
nsCopyMessageStreamListener.cpp request 3913
nsCopyMessageStreamListener.h 916
nsImapMoveCoalescer.cpp = false 6983
nsImapMoveCoalescer.h 2555
nsMailAuthModule.cpp A simple wrap of CreateInstance and Init of nsIAuthModule. 2780
nsMailAuthModule.h nsMailAuthModule_h__ 690
nsMailDirProvider.cpp 4957
nsMailDirProvider.h 1200
nsMailDirServiceDefs.h 1197
nsMessenger.cpp for access to docshell 97884
nsMessenger.h rhp - need this to drive message display 4473
nsMessengerBootstrap.cpp 3129
nsMessengerBootstrap.h 4a85a5d0-cddd-11d2-b7f6-00805f05ffa5 899
nsMessengerOSXIntegration.h 696
nsMessengerOSXIntegration.mm 1772
nsMessengerUnixIntegration.cpp This is only a placeholder for now, register it in components.conf later if needed. 832
nsMessengerUnixIntegration.h 673
nsMessengerWinIntegration.cpp cbSize 12062
nsMessengerWinIntegration.h 1265
nsMsgAccount.cpp 11335
nsMsgAccount.h 928
nsMsgAccountManager.cpp The account manager service - manages all accounts, servers, and identities 117624
nsMsgAccountManager.h Posts an event to update the summary totals and commit the db. We post the event to avoid committing each time we're called in a synchronous loop. 7481
nsMsgBiffManager.cpp 11410
nsMsgBiffManager.h 1428
nsMsgCompressIStream.cpp void close (); 6490
nsMsgCompressIStream.h 874
nsMsgCompressOStream.cpp void close (); 3884
nsMsgCompressOStream.h 681
nsMsgContentPolicy.cpp @returns true if the sender referenced by aMsgHdr is explicitly allowed to load remote images according to the PermissionManager 36282
nsMsgContentPolicy.h nsMsgContentPolicy enforces the specified content policy on images, js, plugins, etc. This is the class used to determine what elements in a message should be loaded. nsMsgCookiePolicy enforces our cookie policy for mail and RSS messages. **************************************************************************** 3692
nsMsgCopyService.cpp 20406
nsMsgCopyService.h 2777
nsMsgDBFolder.cpp mozilla::intl APIs require sizeable buffers. This class abstracts over the nsTArray. 189588
nsMsgDBFolder.h nsMsgDBFolder class derived from nsMsgFolder for those folders that use an nsIMsgDatabase 13460
nsMsgDBView.cpp 251912
nsMsgDBView.h 25874
nsMsgEnumerator.cpp Internal class to support iteration over nsBaseMsgEnumerator in javascript. 3897
nsMsgEnumerator.h A base implementation nsIMsgEnumerator for stepping over an ordered set of nsIMsgDBHdr objects. This provides the javascript iterable protocol (to support for...of constructs), but getNext() and hasMoreElements() must be implemented by derived classes. 1376
nsMsgFileStream.cpp From nsDebugImpl.cpp: 5525
nsMsgFileStream.h 1064
nsMsgFolderCache.cpp nsMsgFolderCacheElement Folders are given this to let them manipulate their cache data. 18631
nsMsgFolderCache.h nsMsgFolderCache implements the folder cache, which stores values which might be slow for the folder to calculate. It persists the cache data by dumping it out to a .json file when changes are made. To avoid huge numbers of writes, this autosaving is deferred - when a cached value is changed, it'll wait a minute or so before writing, to collect any other changes that occur during that time. If any changes are outstanding at destruction time, it'll perform an immediate save then. 1975
nsMsgFolderCompactor.cpp nsFolderCompactState is a helper class for nsFolderCompactor, which handles compacting the mbox for a single local folder. This class also patches X-Mozilla-* headers where required. Usually these headers are edited in-place without changing the overall size, but sometimes there's not enough room. So as compaction involves rewriting the whole file anyway, we take the opportunity to make some more space and correct those headers. NOTE (for future cleanups): This base class calls nsIMsgMessageService.copyMessages() to iterate through messages, passing itself in as a listener. Callbacks from both nsICopyMessageStreamListener and nsIStreamListener are invoked. nsOfflineStoreCompactState uses a different mechanism - see separate notes below. The way the service invokes the listener callbacks is pretty quirky and probably needs a good sorting out, but for now I'll just document what I've observed here: - The service calls OnStartRequest() at the start of the first message. - StartMessage() is called at the start of subsequent messages. - EndCopy() is called at the end of every message except the last one, where OnStopRequest() is invoked instead. - OnDataAvailable() is called to pass the message body of each message (in multiple calls if the message is big enough). - EndCopy() doesn't ever seem to be passed a failing error code from what I can see, and its own return code is ignored by upstream code. 47803
nsMsgFolderCompactor.h nsMsgFolderCompactor implements nsIMsgFolderCompactor, which allows the caller to kick off a batch of folder compactions (via compactFolders()). 1487
nsMsgFolderNotificationService.cpp destructor code 6438
nsMsgFolderNotificationService.h 1461
nsMsgGroupThread.cpp 23766
nsMsgGroupThread.h 3342
nsMsgGroupView.cpp 35806
nsMsgGroupView.h ensureListed 3754
nsMsgI18N.cpp 12977
nsMsgI18N.h Encode an input string into RFC 2047 form. @param header [IN] A header to encode. @param structured [IN] Specify the header is structured or non-structured field (See RFC-822). @param charset [IN] Charset name to convert. @param fieldnamelen [IN] Header field name length. (e.g. "From: " -> 6) @param usemime [IN] If false then apply charset conversion only no MIME encoding. @return Encoded buffer (in C string) or NULL in case of error. 5637
nsMsgIdentity.cpp accessors for pulling values directly out of preferences instead of member variables, etc 21548
nsMsgIdentity.h nsMsgIdentity_h___ 3681
nsMsgIncomingServer.cpp 69336
nsMsgIncomingServer.h base class for nsIMsgIncomingServer - derive your class from here if you want to get some free implementation this particular implementation is not meant to be used directly. 3271
nsMsgKeySet.cpp A compressed encoding for sets of article. This is usually for lines from the newsrc, which have article lists like 1-29627,29635,29658,32861-32863 so the data has these properties: - strictly increasing - large subsequences of monotonically increasing ranges - gaps in the set are usually small, but not always - consecutive ranges tend to be large The biggest win is to run-length encode the data, storing ranges as two numbers (start+length or start,end). We could also store each number as a delta from the previous number for further compression, but that gets kind of tricky, since there are no guarantees about the sizes of the gaps, and we'd have to store variable-length words. Current data format: DATA := SIZE [ CHUNK ]* CHUNK := [ RANGE | VALUE ] RANGE := -LENGTH START START := VALUE LENGTH := int32_t VALUE := a literal positive integer, for now it could also be an offset from the previous value. LENGTH could also perhaps be a less-than-32-bit quantity, at least most of the time. Lengths of CHUNKs are stored negative to distinguish the beginning of a chunk from a literal: negative means two-word sequence, positive means one-word sequence. 0 represents a literal 0, but should not occur, and should never occur except in the first position. A length of -1 won't occur either, except temporarily - a sequence of two elements is represented as two literals, since they take up the same space. Another optimization we make is to notice that we typically ask the question ``is N a member of the set'' for increasing values of N. So the set holds a cache of the last value asked for, and can simply resume the search from there. 37230
nsMsgKeySet.h MSG_NewsHost* host = NULL 3627
nsMsgLineBuffer.cpp always grow by a minimum of N bytes 12783
nsMsgLineBuffer.h nsMsgLineBuffer breaks up incoming data into lines. It accepts CRLF, CR or LF line endings. Data is fed in via BufferInput(). The virtual HandleLine() will be invoked for each line. The data passed to HandleLine() is verbatim, and will include whatever line endings were in the source data. Flush() should be called when the data is exhausted, to handle any leftover bytes in the buffer (e.g. if the data doesn't end with an EOL). 5020
nsMsgMailNewsUrl.cpp 35244
nsMsgMailNewsUrl.h 5084
nsMsgMailSession.cpp 23269
nsMsgMailSession.h / class nsMsgShutdownService : public nsIMsgShutdownService, public nsIUrlListener, public nsIObserver { public: nsMsgShutdownService(); NS_DECL_ISUPPORTS NS_DECL_NSIMSGSHUTDOWNSERVICE NS_DECL_NSIURLLISTENER NS_DECL_NSIOBSERVER protected: nsresult ProcessNextTask(); void AttemptShutdown(); private: virtual ~nsMsgShutdownService(); nsCOMArray<nsIMsgShutdownTask> mShutdownTasks; nsCOMPtr<nsIMsgProgress> mMsgProgress; uint32_t mTaskIndex; uint32_t mQuitMode; bool mProcessedShutdown; bool mQuitForced; bool mReadyToQuit; }; #endif /* nsMsgMailSession_h__ 3787
nsMsgOfflineManager.cpp The offline manager service - manages going online and offline, and synchronization 11481
nsMsgOfflineManager.h nsIMsgOfflineManager methods 2275
nsMsgProgress.cpp 8913
nsMsgProgress.h 1294
nsMsgProtocol.cpp 48380
nsMsgProtocol.h 11203
nsMsgPurgeService.cpp 19921
nsMsgPurgeService.h 1547
nsMsgQuickSearchDBView.cpp 30242
nsMsgQuickSearchDBView.h 5064
nsMsgReadStateTxn.cpp 1392
nsMsgReadStateTxn.h 121FCE4A-3EA1-455C-8161-839E1557D0CF 1491
nsMsgSearchDBView.cpp 48243
nsMsgSearchDBView.h 8613
nsMsgSpecialViews.cpp 5546
nsMsgSpecialViews.h DOING_CACHELESS_VIEW 3254
nsMsgStatusFeedback.cpp 9975
nsMsgStatusFeedback.h 1434
nsMsgTagService.cpp readonly attribute ACString key; 15983
nsMsgTagService.h 1246
nsMsgThreadedDBView.cpp member initializers and constructor code 32109
nsMsgThreadedDBView.h 2927
nsMsgTxn.cpp 8526
nsMsgTxn.h da621b30-1efc-11d3-abe4-00805f8ac968 2257
nsMsgUtils.cpp for logging to Error Console 62781
nsMsgUtils.h given a folder uri, return the path to folder in the user profile directory. @param aFolderURI uri of folder we want the path to, without the scheme @param[out] aPathString result path string @param aScheme scheme of the uri @param[optional] aIsNewsFolder is this a news folder? 18502
nsMsgWindow.cpp 15194
nsMsgWindow.h 1889
nsMsgXFViewThread.cpp 13785
nsMsgXFViewThread.h 1507
nsMsgXFVirtualFolderDBView.cpp ensureListed 17467
nsMsgXFVirtualFolderDBView.h 2996
nsNewMailnewsURI.cpp = nullptr 5500
nsNewMailnewsURI.h = nullptr 590
nsQuarantinedOutputStream.cpp 6712
nsQuarantinedOutputStream.h nsQuarantinedOutputStream layers on top of an existing target output stream. The idea is to let an OS virus checker quarantine individual messages _before_ they hit the mbox. You don't want entire mboxes embargoed if you can avoid it. It works by buffering all writes to a temporary file. When finish() is called the temporary file is closed, reopened, then copied into a pre-existing target stream. There's no special OS virus-checker integration - the assumption is that the checker will hook into the filesystem and prevent us from opening a file it has flagged as dodgy. Hence the temp file close/reopen before the final write. If the nsQuarantinedOutputStream is closed (or released) without calling finish(), the write is discarded (as per nsISafeOutputStream requirements). 2517
nsSpamSettings.cpp 27176
nsSpamSettings.h nsSpamSettings_h__ 2013
nsStatusBarBiffManager.cpp 8526
nsStatusBarBiffManager.h 1008
nsStopwatch.cpp This basis for the logic in this file comes from (will used to come from): (mozilla/)modules/libutil/public/stopwatch.cpp. It was no longer used in the mozilla tree, and is being migrated to comm-central where we actually have a need for it. ("Being" in the sense that it will not be removed immediately from mozilla-central.) Simplification and general clean-up has been performed and the fix for bug 96669 has been integrated. 4767
nsStopwatch.h 1449
nsSubscribableServer.cpp The basic structure for the tree of the implementation. These elements are stored in reverse alphabetical order. Each node owns its children and subsequent siblings. 23690
nsSubscribableServer.h 2004
nsUserInfo.h __nsUserInfo_h 541
nsUserInfoMac.mm 2027
nsUserInfoUnix.cpp 3054
nsUserInfoWin.cpp 2583
OAuth2.jsm Provides OAuth 2.0 authentication. @see RFC 6749 9180
OAuth2Module.jsm OAuth2Module is the glue layer that gives XPCOM access to an OAuth2 bearer token it can use to authenticate in SASL steps. It also takes care of persising the refreshToken for later usage. @implements {msgIOAuth2Module} 6580
OAuth2Providers.jsm Details of supported OAuth2 Providers. 6567
ServiceList.h 2091
Services.cpp 3427
Services.h 731
TemplateUtils.jsm Helper function to generate a localized "friendly" representation of time relative to the present. If the time input is "today", it returns a string corresponding to just the time. If it's yesterday, it returns "yesterday" (localized). If it's in the last week, it returns the day of the week. If it's before that, it returns the date. @param time {Date} the time (better be in the past!) @return {string} A "human-friendly" representation of that time relative to now. 3167
VirtualFolderWrapper.jsm Wrap everything about virtual folders. 9620
WinUnreadBadge.jsm Get an imgIContainer instance from a canvas element. @param {HTMLCanvasElement} canvas - The canvas element. @param {number} width - The width of the canvas to use. @param {number} height - The height of the canvas to use. @returns {imgIContainer} 7574