Dovecot gzip u.files on sdboxes

Jose Celestino japc at
Wed Feb 1 12:07:47 UTC 2023


I was wondering if it's possible to lighten the process of converting
sdbox mailboxes to zlib by, instead of using dsync (that brings much more io, 
copying from alt - and copying of unneeded data as we have many mails already 
compressed from activating zlib a couble of years ago) just compressing each
of the u files.

By compression of the u files I mean opening the uncompressed u file for 
reading, a u.temp file for writting and:

1. copy the dbox message header from u to u.tmp

2. compress the plain message and write it to u.tmp

3. fix the message_size_hex on the u.tmp dbox message header to the new, 
   compressed size

4. copy the dbox metadata from u to u.tmp with Zphysical_size added

5. copy the u stat times to u.tmp

6. replace u with u.tmp

Is the message_size_hex stored anywhere else (indexes) that may cause this to
not work?

Thank you.

More information about the dovecot mailing list