Name Description Size
components.conf 3008
ImapChannel.sys.mjs A channel to interact with IMAP server. @implements {nsIChannel} @implements {nsIRequest} @implements {nsICacheEntryOpenCallback} 8386
ImapClient.sys.mjs A class to interact with IMAP server. 57623
ImapFolderContentHandler.sys.mjs A service for handling content type x-application-imapfolder; that is, opening IMAP folder URLs. Set mailnews.imap.jsmodule to true to use this module. @implements {nsIContentHandler} 2411
ImapIncomingServer.sys.mjs @extends {MsgIncomingServer} @implements {nsIImapServerSink} @implements {nsIImapIncomingServer} @implements {nsIMsgIncomingServer} @implements {nsIUrlListener} @implements {nsISupportsWeakReference} @implements {nsISubscribableServer} 21785
ImapMessageService.sys.mjs @implements {nsIMsgMessageService} 8208
ImapModuleLoader.sys.mjs Determine whether to use nsImapService.cpp or ImapService.sys.mjs. When `mailnews.imap.jsmodule` is `true`, use ImapService.sys.mjs. 3728
ImapProtocolHandler.sys.mjs @implements {nsIProtocolHandler} 1084
ImapProtocolInfo.sys.mjs @implements {nsIMsgProtocolInfo} 1196
ImapResponse.sys.mjs A structure to represent a server response. 14383
ImapService.sys.mjs Set mailnews.imap.jsmodule to true to use this module. @implements {nsIImapService} 15396
ImapUtils.sys.mjs The purpose here is not to convert all capabilities to flag number, but to interact with nsImapMailFolder through nsIImapIncomingServer.getCapability interface. @see nsImapCore.h 6028
moz.build 1365
nsAutoSyncManager.cpp 50K 50829
nsAutoSyncManager.h Auto-Sync Background: it works only with offline imap folders. "autosync_offline_stores" pref enables/disables auto-sync mechanism. Note that setting "autosync_offline_stores" to false, or setting folder to not-offline doesn't stop synchronization process for already queued folders. Auto-Sync policy: o It kicks in during system idle time, and tries to download as much messages as possible based on given folder and message prioritization strategies/rules. Default folder prioritization strategy dictates to sort the folders based on the following order: INBOX > DRAFTS > SUBFOLDERS > TRASH. Similarly, default message prioritization strategy dictates to download the most recent and smallest message first. Also, by sorting the messages by size in the queue, it tries to maximize the number of messages downloaded. o It downloads the messages in groups. Default groups size is defined by |kDefaultGroupSize|. o It downloads the messages larger than the group size one-by-one. o If new messages arrive when not idle, it downloads the messages that do fit into |kFirstGroupSizeLimit| size limit immediately, without waiting for idle time, unless there is a sibling (a folder owned by the same imap server) in stDownloadInProgress state in the q o If new messages arrive when idle, it downloads all the messages without any restriction. o If new messages arrive into a folder while auto-sync is downloading other messages of the same folder, it simply puts the new messages into the folder's download queue, and re-prioritize the messages. That behavior makes sure that the high priority (defined by the message strategy) get downloaded first always. o If new messages arrive into a folder while auto-sync is downloading messages of a lower priority folder, auto-sync switches the folders in the queue and starts downloading the messages of the higher priority folder next time it downloads a message group. o Currently there is no way to stop/pause/cancel a message download. The smallest granularity is the message group size. o Auto-Sync manager periodically (kAutoSyncFreq) checks folder for existing messages w/o bodies. It persists the last time the folder is checked in the local database of the folder. We call this process 'Discovery'. This process is asynchronous and processes |kNumberOfHeadersToProcess| number of headers at each cycle. Since it works on local data, it doesn't consume lots of system resources, it does its job fast. o Discovery is necessary especially when the user makes a transition from not-offline to offline mode. o Update frequency is defined by nsMsgIncomingServer::BiffMinutes. Error Handling: o if the user moves/deletes/filters all messages of a folder already queued, auto-sync deals with that situation by skipping the folder in question, and continuing with the next in chain. o If the message size is zero, auto-sync ignores the message. o If the download of the message group fails for some reason, auto-sync tries to download the same group |kGroupRetryCount| times. If it still fails, continues with the next group of messages. Download Model: Parallel model should be used with the imap servers that do not have any "max number of sessions per IP" limit, and when the bandwidth is significantly large. How it really works: The AutoSyncManager gets an idle notification. First it processes any folders in the discovery queue (which means it schedules message download for any messages it previously determined it should download). Then it sets a timer, and in the timer callback, it processes the update q, by calling InitiateAutoSync on the first folder in the update q. See additional info near the bottom of this file. 11855
nsAutoSyncState.cpp @return True if the elements are equals; false otherwise. 26673
nsAutoSyncState.h An adaptor class to make msg strategy nsTArray.Sort() compatible. 3123
nsImapBodyShell.cpp Create a nsImapBodyShell from a full BODYSTRUCUTRE response from the parser. The body shell represents a single, top-level object, the message. The message body might be treated as either a container or a leaf (just like any arbitrary part). Steps for creating a part: 1. Pull out the paren grouping for the part 2. Create a generic part object with that buffer 3. The factory will return either a leaf or container, depending on what it really is. 4. It is responsible for parsing its children, if there are any 39118
nsImapBodyShell.h nsImapBodyShell and associated classes 15442
nsImapCore.h imap message flags 9051
nsImapFlagAndUidState.cpp amount to expand for imap entry flags when we need more 10245
nsImapFlagAndUidState.h 1826
nsImapGenericParser.cpp 14500
nsImapGenericParser.h nsImapGenericParser is the base parser class used by the server parser and body shell parser 2401
nsImapHostSessionList.cpp "accessing-hostlist-monitor" 22447
nsImapHostSessionList.h 7495
nsImapIncomingServer.cpp 100344
nsImapIncomingServer.h get some implementation from nsMsgIncomingServer 6052
nsImapMailFolder.cpp 2B79AC51-1459-11d3-8097-006008128C4E 342989
nsImapMailFolder.h 25670
nsImapNamespace.cpp 17669
nsImapNamespace.h 3624
nsImapOfflineSync.cpp Leaves m_currentServer at the next imap or local mail "server" that might have offline events to playback, and m_folderQueue holding a (reversed) list of all the folders to consider for that server. If no more servers, m_currentServer will be left at nullptr and the function returns false. 43311
nsImapOfflineSync.h 3282
nsImapProtocol.cpp 383593
nsImapProtocol.h 33428
nsImapSearchResults.cpp 2130
nsImapSearchResults.h 1145
nsImapServerResponseParser.cpp 97946
nsImapServerResponseParser.h 9866
nsImapService.cpp 117740
nsImapService.h nsImapService implements the IMAP protocol. So, whenever someone opens an "imap://" url, the resultant nsIChannel is created here (via newChannel()). It also provides a bunch of methods to provide more egonomic ways to initiate IMAP operations, rather than manually composing an "imap://..." URL. See nsIImapService for these. 5238
nsImapStringBundle.cpp 1339
nsImapStringBundle.h _nsImapStringBundle_H__ 506
nsImapUndoTxn.cpp 25272
nsImapUndoTxn.h 2951
nsImapUrl.cpp 45467
nsImapUrl.h nsImapUrl_h___ 4592
nsImapUtils.cpp parses ImapMessageURI 11518
nsImapUtils.h 2590
nsSyncRunnableHelpers.cpp 23163
nsSyncRunnableHelpers.h 4053