On Fri, 2009-08-14 at 14:18 -0500, Eric Jon Rostetter wrote:
Quoting Timo Sirainen <tss@iki.fi>:
- When writing the data, extract the attachments and write them to different files. Add pointers to those files to the EXT_REF metadata. Dovecot's message parsers should make this not-too-difficult to implement.
I'd rather it did mime parts, rather than attachments.
Well, okay, s/attachments/mime parts/ throughout my mail. That's what I meant. Checking if a mime part was an attachment would be just more extra work. Also there should be some size checks, so that the extraction is done only for parts that are larger than n bytes.
- Once that works, figure out a way to implement SIS for those externally written files. Creating hard links to files a global attachment storage would probably be a workable solution. Then scan through the storage once in a while and delete files with link count=1.
Hardlinks is one way, for filesystems that support it. But it does have limits (can't span volumes, etc).
But any kind of setup that can maintain the file and a usage count should work (and the two don't have to be kept together, though they can). If you add a management interface, all the better.
Hard links would be the simplest implementation without needing a separate database. Sure you could implement that too if you wanted to.