Some users want us to automatically sync the offline store for a folder when it's opened or checked for new mail (really what's wanted is to silently sync in the background, but this approach is going to be a lot easier in the short term). So I'm going to add a new per server pref, autosync_offline_stores, and if you set it to true, we will sync the offline store when you open the folder, or check it for new mail. The latter will only happen if you set the hidden pref "mail.imap.use_status_for_biff" to false, so that we'll call UpdateFolder to check for new messages, and download headers and bodies, instead of just using the IMAP status command. Patch upcoming.
Created attachment 190759 [details] [diff] [review] fix for testing This implements what I described. One caveat: it ignores whether you've configured the folder for offline use - I can go either way on that. Ignoring that flag makes it consistent with the download_bodies_on_get_new_mail pref, and moves us to a world where you don't need to configure every folder for offline use. But it could be a drag as well, for example, if you click on a large folder like your sent folder.
cc'ing Mike, who wanted to try this out.
Comment on attachment 190759 [details] [diff] [review] fix for testing this is turned off by default, but it would be nice to have for people to turn on if they want.
Shaver might be interested in this. Setting the per server pref "autosync_offline_stores" to true will make us download for offline use all msgs in any imap folder on that server when you open the folder. It's not ideal, but it does allow you to skip the go offline process before shutting down. It is currently all or nothing, so this pref ignores whether the folder is configured for offline use. It's basically a big switch that says I want all messages in all folders stored for offline use.