On Fri, 2010-09-03 at 12:07 -0500, Mike Abbott wrote:
When might deduplication of attachments work with maildir?
I was planning on never. :) But here's a quick design idea:
- Save normal mail data without attachments, similar to dbox
- In maildir filename keep S= and W= the same as if the attachments were there, just like with zlib plugin
Then one of:
a) Among cur/ new/ tmp/ directories create meta/ directory that contains maildir metadata files. Each file has the same base filename as in cur/ directory. Contents could be similar to dbox metadata, most importantly the attachment metadata.
b) Trust that dovecot-uidlist won't get deleted/corrupted and put the attachment metadata into it.
c) Combine a+b so that b) is used but when something goes wrong it fallbacks to reloading metadata from a). Still more disk I/O when saving/deleting mails because of the creation/deletion of the metadata file.
Possibly also something else is missing that I can't think of right now.
Hmm. This reminds me, it might be nice to be able to copy messages with attachments in sdbox without temporarily duplicating the attachment..