The cleanest (though not necessarily simplest) way to go about this would be to use dsync to create a new maildir and incrementally direct traffic to a separate Dovecot instance.
Unless you have a legacy application that relies on maildir, switching to mdbox would be a good idea too.
I expect that with Dovecot compression is something that can "just be turned on", but for fear of any possible issue, I chose to migrate mailboxes in batches with the way mentioned above.
On Dec 24, 2011, at 7:20 AM, Jan-Frode Myklebust wrote:
I've just enabled zlib for our users, and am looking at how to compress the existing files. The routine for doing this at http://wiki2.dovecot.org/Plugins/Zlib seems a bit complicated. What do you think about simply doing:
find /var/vmail -type f -name "*,S=*" -mtime +1 -exec gzip -S Z -6 '{}' +
I.e. find all maildir-files:
- with size in the name ("*,S=*")
- modified before I enabled zlib plugin
- compress them
- add the Z suffix
- keep timestamps (gzip does that by default)
It's of course racy without the maildirlock, but are there any other problems with this approach ?
-jf