On Thu, Dec 29, 2011 at 03:48:05PM +0200, Timo Sirainen wrote: > > > > Can't I trust that no mails with timestamp before I enabled compression > > are uncompressed? Or will dovecot compress old messages keeping old > > timestamp when copying messages between folders, or something like that? > > It's possible that a user saves a mail with an old IMAP INTERNALDATE (=file's > mtime), which is already compressed. You could use ctime, but that could skip > mails whose flags have been changed since compression.
Ok, if ctime is safer I think I'll use that and not worry too much about missing some messages. > > > I want to avoid reading every file to check if it's compressed > > already, as that will add ages to an already slow process.. > > You could use mtime, and just before compressing the mail check if it's > already compressed. That won't add much overhead. Ah, right.. I'll have to read the messages from disk anyway, so checking if they're compressed or not doesn't add much. So mtime + compression-check is what I'll need to do then. -jf