After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773419 - Age limit for offline message download
Age limit for offline message download
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
3.22.x (obsolete)
Other Linux
: Normal enhancement
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks: 776018
 
 
Reported: 2016-10-24 12:41 UTC by Emre Erenoglu
Modified: 2016-12-14 16:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Thunderbirds' Similar Function settings (76.36 KB, image/jpeg)
2016-10-24 12:41 UTC, Emre Erenoglu
Details

Description Emre Erenoglu 2016-10-24 12:41:27 UTC
Created attachment 338341 [details]
Thunderbirds' Similar Function settings

I have an IMAP server which I use for archiving purposes. It has folders for each year. In Windows, I set Outlook and Thunderbird to synchronize last 1 year of emails locally, so that I can access 1 year of history while I'm travelling or disconnected. I do not need to store older ones. 

I can see in Evolution 3.22.2 that there's an option to "synchronize email locally for offline operation" and folder settings which states "copy folder content for offline operation", but there is no setting to limit the age of synced items.

This feature, if implemented, shall be FIFO one, so messages older than set duration are purged from local cache, and new ones are synced in, as time moves.

Outlook and Thunderbird have similar functions. I'm attaching picture of the Thunderbird one for reference. In Thunderbird, you select this eetting per account. So can get one account with full sync and another with a time limit (days/months/years).

This feature shall also be useful in EWS accounts or other types, but I guess IMAP would be a good start.
Comment 1 Milan Crha 2016-12-12 21:29:15 UTC
Thanks for a bug report. I make it work for IMAPx, EWS and MAPI with the below commits. The option is located in Receiving Options tab, named:

   [x] Do not synchronize locally mails older than [ xxx ] [ unit ]

where the 'unit' is one of 'days', 'weeks', 'months' or 'years'. It applies to automatic download for offline usage only, not when users pick certain older message than this option is set to. It doesn't clean up local cache, though, because the local cache is treated by the time when the message had been downloaded or touched the last time, which is usually a very different date than the one when the message had been received.

Created commit_e62b124 in eds master (3.23.4+) [1]
Created commit_9e9e3c5 in evo master (3.23.4+) [2]
Created commit_4e784bb in ews master (3.23.4+) [3]
Created commit_325ac6e in ema master (3.23.4+) [4]

[1] https://git.gnome.org/browse/evolution-data-server/commit/?id=e62b124
[2] https://git.gnome.org/browse/evolution/commit/?id=9e9e3c5
[3] https://git.gnome.org/browse/evolution-ews/commit/?id=4e784bb
[4] https://git.gnome.org/browse/evolution-mapi/commit/?id=325ac6e
Comment 2 Emre Erenoglu 2016-12-13 07:05:35 UTC
Thanks Milan, great job. I'll test it asap. What about the local cache cleanup, does this mean the local cache will grow endlessly as time passes? ie each time I archive, the IMAP account will notice new messages and download them, keep the older ones until 1 year old, but what about the ones which are already downloaded but older than one year old?
Would there be a tidy-up clean-up process to clean cache from time to time?
Comment 3 Milan Crha 2016-12-13 09:09:04 UTC
The local cache will keep working as it works right now. Downloaded messages will be kept stored locally until they are removed from the server.

I tried to explain above that the age limit is (seems to me to be) harder to apply to locally cached messages. That's due to the way the local cache works. The message has two dates to compare, one is the Date header of the message, the other is the last usage date of the local cache file on the disk. It would be clearly wrong if you have set the limit to 3 weeks and you download a message 5 months old, which would be re-downloaded the next day, because its Date header shows that the message is older than the age limit is set to.

Hrm, maybe I'm wrong, maybe it would be enough to set the time limit for the local cache to the set age limit for the download and it'll be all good. I thought there's some catch up yesterday, but it looks like I was wrong. If you cannot think about anything wrong in this regard, then I'll make a follow up change.
Comment 4 Emre Erenoglu 2016-12-13 09:27:08 UTC
In my view, we shall not care about the "last usage date" of the local cache file. If a user clicks an email that's older than the limit, Evolution shall download, display it, and when user clicks something else, discard that email. An alternative maybe to put a timer to discard, ie discard when Evo is closed or after X hours, just in case the user clicks it again.

This would prevent piling up the local cache endlessly.

Maybe the option name can be changed to "Keep the Most Recent xxxx days/weeks/months/year in local cache" to be more precise, if such function of local cache cleanup is implemented.
Comment 5 Milan Crha 2016-12-14 14:21:56 UTC
I added the time limits for the local cache based on the settings. This change takes effect after full restart of the evolution (or when opening the folder for the first time). I didn't change wording of the option.

Created commit_2da11c1 in eds master (3.23.4+) [5]
Created commit_66ff51e in ews master (3.23.4+) [6]
Created commit_0c91f93 in ema master (3.23.4+) [7]

[5] https://git.gnome.org/browse/evolution-data-server/commit/?id=2da11c1
[6] https://git.gnome.org/browse/evolution-ews/commit/?id=66ff51e
[7] https://git.gnome.org/browse/evolution-mapi/commit/?id=0c91f93
Comment 6 Emre Erenoglu 2016-12-14 16:23:05 UTC
Thanks, I'll test once Arch updates Evo packages.