Name Description Size
components.conf 3008
ImapChannel.sys.mjs A channel to interact with IMAP server. @implements {nsIChannel} @implements {nsIRequest} @implements {nsICacheEntryOpenCallback} 8860
ImapClient.sys.mjs A class to interact with IMAP server. 57254
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 @augments {MsgIncomingServer} @implements {nsIImapServerSink} @implements {nsIImapIncomingServer} @implements {nsIMsgIncomingServer} @implements {nsIUrlListener} @implements {nsISupportsWeakReference} @implements {nsISubscribableServer} 21780
ImapMessageService.sys.mjs @implements {nsIMsgMessageService} 10875
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. 14380
ImapService.sys.mjs Set mailnews.imap.jsmodule to true to use this module. @implements {nsIImapService} 13967
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 50821
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
nsImapCore.h imap message flags 9095
nsImapFlagAndUidState.cpp amount to expand for imap entry flags when we need more 10245
nsImapFlagAndUidState.h 1825
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" 22209
nsImapHostSessionList.h 7494
nsImapIncomingServer.cpp 99419
nsImapIncomingServer.h get some implementation from nsMsgIncomingServer 6224
nsImapMailFolder.cpp 2B79AC51-1459-11d3-8097-006008128C4E 342230
nsImapMailFolder.h 25628
nsImapNamespace.cpp 17561
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. 43536
nsImapOfflineSync.h 3282
nsImapProtocol.cpp 386590
nsImapProtocol.h 33405
nsImapSearchResults.cpp 2130
nsImapSearchResults.h 1145
nsImapServerResponseParser.cpp 98330
nsImapServerResponseParser.h 9866
nsImapService.cpp 115520
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. 5600
nsImapStringBundle.cpp 1339
nsImapStringBundle.h _nsImapStringBundle_H__ 506
nsImapUndoTxn.cpp 25312
nsImapUndoTxn.h 3023
nsImapUrl.cpp 45229
nsImapUrl.h nsImapUrl_h___ 4545
nsImapUtils.cpp parses ImapMessageURI 11518
nsImapUtils.h 2589
nsSyncRunnableHelpers.cpp 23337
nsSyncRunnableHelpers.h 4171