Refine local storage management
Geary's local storage management currently doesn't remove old messages beyond the per-account storage pref, and duplicates storing MIME attachment parts both in the database, and on the filesystem. This results in a lot of resource overhead.
The download pref should be honoured by the garbage collector (i.e. messages older than the date should be cleared locally), and attachment parts should be automatically downloaded but added to a LRU cache, then deleted when removed from the cache. Attachment parts not in the cache can then be downloaded on demand as needed.
-
Remove old messages beyond the per-account storage pref -
Fetch and save IMAP BODYSTRUCTURE
for each new message -
Download only inline parts by default and a limited number of bytes of attachment parts sufficient for content sniffing (32 bytes?) -
Display attachments based on BODYSTRUCTURE
and declared/sniffed MIME type -
Convert "open attachment" into a "save then open" action behind the scenes -
Add a LRU cache for attachment parts, eviction based on storage use (256MB per account?) -
Download attachment parts for new messages in the background (during the sync process?) -
Download attachment parts in the foreground when saved/opened and not in the cache, providing progress feedback for each -
Enable drag and drop of downloaded attachments -
Ensure preview generation uses correct MIME part for generation (see bgo 777118)
While here, may as well fix previews
Edited by Michael Gratton