[PATCH v4] Re: make maxage use UIDs to avoid timezone issues

Abdó Roig-Maranges abdo.roig at gmail.com
Mon Apr 6 15:40:43 BST 2015



> My previous attempt at this was very wrong. Try #2.
>
> The one thing that's still not done with this is the unceremoniously
> commented out bit about mtimes.
>
> def syncmessagesto_labels(self, dstfolder, statusfolder):
> <...>	
>    for i, uid in enumerate(uidlist):
>    <...>
> #       mtime = dstfolder.getmessagemtime(uid)
> #       mtimes[uid] = mtime
>        labels[uid] = selflabels
>
> #            statusfolder.savemessagesmtimebulk(mtimes)
>
> If dstfolder is another IMAP folder, then getmessagemtime isn't
> implemented, so this throws an error. What should this be, if anything?

Hi,

I have not followed the entire thread... so sorry if I'm missing something. I
have two things to say here:


1. I assume the issue is trying to sync Gmail to IMAP, isn't it? Then the right
minimal thing to do is, I guess, make syncmessageto_labels do nothing if target
folder does not support labels (i.e. if it is anything different from
GmailMaildir).

When I wrote this, I used mtime very ad-hoc for the GmailMaildir folder. I
didn't have other folders in mind, nor I thought about Gmail - Gmail syncs
either. I should fix this at some point, I guess...


2. Now, I think that we could give 'mtime' a global meaning. On Maildir could
mean unix modification time, and on IMAP mean the internal date. Then have a
unified 'time' field in all cache messages, statusfolder, etc.

I mention this since it seems in the maxage ongoing work you are making use a
lot of use of internal dates...


Abdó.




More information about the OfflineIMAP-project mailing list