[Dovecot] dsync, hard-links and refcounts

Timo Sirainen tss at iki.fi
Wed Feb 15 05:46:35 EET 2012

On 13.2.2012, at 16.40, Timo Sirainen wrote:

> On 13.2.2012, at 16.16, Christoph Bußenius wrote:
>> when creating a copy of a mail, dovecot provides a feature that will store its contents only once.  In maildir, this is done by means of hard links, while mdbox has some special refcounting mechanism.
>> My question is, how can we convert mails from maildir to mdbox without duplicating these copies?  It seems that dsync does not detect the hard links.  Even if the hard-linked mails have the same GUID listed in dovecot-uidlist, dsync creates multiple instances of the text.
>> - Is there some way to make dsync notice the hard links? (I used
>>   dovecot 2.0.17)
> It should deduplicate when GUIDs are the same.. I guess I'll have to look into why it's not working.

It worked when the GUID already existed somewhere in destination, but not if it was added only during the same session. The attached patch fixes it. I'll commit it to v2.1 hg after I'll release v2.1.0..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: application/octet-stream
Size: 2890 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20120215/60ff033d/attachment-0004.obj>

More information about the dovecot mailing list