Patch for maxage and maxsize options
Dear All, Attached is the patch that I have developed to provide maxage and maxsize options. You can thus sync only the last x days of messages and exclude large messages. All details in the attached git file. Regards, -Mike -- Attached file included as plaintext by Ecartis -- -- File: submit From 04fead2b46a79675a5b29de6f2b4088b9c9448e5 Mon Sep 17 00:00:00 2001 From: mike <mike@mikelaptop.(none)> Date: Sun, 16 Aug 2009 17:00:49 +0430 Subject: [PATCH] Patch to provide maxage and maxsize account options to exclude old/large messages This is designed to make offlineimap even better for low bandwidth connections. maxage allows you to specify a number of days and only messages within that range will be considered by offlineimap for the sync. This can be useful if you would like to start using offlineimap with a large existing account and do not want to import large archives of mail. maxsize allows you to specify the maximum size of a message to consider so that you can exclude messages with large attachments etc. In both cases the cachemessagelist function of the folder was modified to ignore messages that do not meet the criteria. If the criteria are not specified then the existing code will be executed the same as before. If a message does not meet the criteria it will be as though this message does not exist - offlineimap will completely ignore it. It will not have flags updated, it will not be deleted, it will not be considered at all. When operating against an IMAP repository a server side search function is used. This of course requires support for server side search. I have tested this with either option, no options etc. against IMAP, Maildir and Gmail. I have run variations of this patch here for the last 3 weeks or so syncing about 4 accounts normally.
This commit is contained in:

committed by
John Goerzen

parent
312b91a1a5
commit
cde94e5047
@ -195,6 +195,30 @@ remoterepository = RemoteExample
|
||||
# You can also specify parameters to the commands
|
||||
# presynchook = imapfilter -c someotherconfig.lua
|
||||
|
||||
# If you have a limited amount of bandwidth available you can exclude larger
|
||||
# messages (e.g. those with large attachments etc). If you do this it
|
||||
# will appear to offlineimap that these messages do not exist at all. They
|
||||
# will not be copied, have flags changed etc. For this to work on an IMAP
|
||||
# server the server must have server side search enabled. This works with gmail
|
||||
# and most imap servers (e.g. cyrus etc)
|
||||
# The maximum size should be specified in bytes - e.g. 2000000 for approx 2MB
|
||||
|
||||
# maxsize = 2000000
|
||||
|
||||
|
||||
# When you are starting to sync an already existing account yuo can tell offlineimap
|
||||
# to sync messages from only the last x days. When you do this messages older than x
|
||||
# days will be completely ignored. This can be useful for importing existing accounts
|
||||
# when you do not want to download large amounts of archive email.
|
||||
|
||||
# Messages older than maxage days will not be synced, their flags will
|
||||
# not be changed, they will not be deleted etc. For offlineimap it will be like these
|
||||
# messages do not exist. This will perform an IMAP search in the case of IMAP or Gmail
|
||||
# and therefor requires that the server support server side searching. This will
|
||||
# calculate the earliest day that would be included in the search and include all
|
||||
# messages from that day until today. e.g. maxage = 3 to sync only the last 3 days mail
|
||||
|
||||
# maxage = 3
|
||||
|
||||
[Repository LocalExample]
|
||||
|
||||
|
Reference in New Issue
Block a user