The strategies of AutoSync provide a great deal of flexibility in how
IMAP messages are downloaded. But there is no such capability with the
current implementation of "Download/Sync Now" leading to inconsistent
The behaviour I want is that Thunderbird only downloads large IMAP
messages when they are specifically requested by the user, e.g. they are
selected for read or for download using 'Get Selected Messages' and 'Get
Starred Messages'. Using nsIAutoSyncMsgStrategy I can exclude messages
larger than 100KB being downloaded by AutoSync, but if I want to
manually sync using 'Download/Sync Now' I get the traditional offline
behaviour i.e. all messages in offline folders are downloaded.
I see a number of ways to implement the desired behaviour:
1. Ideally modify nsImapOfflineDownloader/nsAutoSyncManager to run on
2. Modify nsImapMailFolder::GetBodysToDownload() to provide limited
support to strategies using nsIAutoSyncMsgStrategy::IsExcluded()
3. Least desirable modify nsImapMailFolder::DownloadAllForOffline() to
use nsIAutoSyncState::ProcessExistingHeaders(). But how would you know
when it has finished?
The background for this is that I am currently living in Nepal and I am
trying to write an extension for use in low bandwidth conditions.