[Dovecot] Renaming maildir files, UIDs and mail clients

2011-05-09 Thread Helge Milde

Hi!

First a little background:

I'm thinking of compressing my Maildir's using dovecot's zlib support, and have 
run into a couple of problems.

First of all, my files use the following formats:
1. 1260386673.02.mbox:2,S
2. 1304920966.M241434P17342.mail,W=3152:2,S

As you can see, both lack the S=size basename flag, but the latter does 
have W=.
Reading http://wiki.dovecot.org/Plugins/Zlib, I get the impression that I really need S= 
in the filenames (.. otherwise there will be problems with quota calculation as 
well as other potential random failures.).

I have made a script that compresses my files, adds S=size if it's missing (using 
wc -c before gzip), and appends the Z flag. As I understand it, adding S=size will 
change the UID of the email, while appending Z won't.

Now for my questions:
1. How crucial is it to have the S= in the basename when using zlib?
The wiki page mentions quota problems, which we're not using, but also random 
failures...

2. Would W= suffice in this regard?
I.e. would I be able to compress files of the latter format safely, without 
adding S= (only appending the Z flag)?

3. If S=size *is* needed, is there a way to minimize the effect from the mail 
client's perspective?
From my testruns, it seems Mutt have no problems after I rename the basename, 
but Thunderbird will refetch the emails, and not delete the old ones, showing 
duplicate emails.
Refetching emails is not a big problem, I think, but only if the email clients 
understand that the old ones doesn't exist anymore.

And if anyone has ideas on how to convert to using zlib without the users 
knowing, I would be glad to hear it!

--
Helge Milde
www.monsternett.no




Re: [Dovecot] Renaming maildir files, UIDs and mail clients

2011-05-09 Thread Timo Sirainen
On Mon, 2011-05-09 at 09:44 +0200, Helge Milde wrote:

 Now for my questions:
 1. How crucial is it to have the S= in the basename when using zlib?
 The wiki page mentions quota problems, which we're not using, but also 
 random failures...

I'm not entirely sure if there is something in the code that relies on
it being correct.

 2. Would W= suffice in this regard?

No.

 3. If S=size *is* needed, is there a way to minimize the effect from the 
 mail client's perspective?

Yes. Add the ,S=size to the dovecot-uidlist files as well, so the UID
doesn't change. If you're using POP3 with UIDLs based on filename you
can also add POP3 UIDLs to dovecot-uidlist with new enough Dovecot
versions.