On Fri, 2009-08-14 at 11:28 -0700, Daniel L. Miller wrote:
What would be involved in implementing SIS within Dovecot? A new or modified mailbox format?
It could be added to dbox without too much trouble. I already kind of planned for it:
/* Pointer to external message data. Format is:
1*(<start offset> <byte count> <ref>) */
DBOX_METADATA_EXT_REF = 'X',
Nothing uses that yet though. So what you'd need is:
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.
When reading messages, get the ext references and then you should be able to create concat-istream by piecing together the main dbox istream with those external istreams. Maybe implement some istream that lazily opens the external files only when it's actually needed.
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.