[Dovecot] Dovecot METADATA support
I've been trying to work with dovecot metadata plugin and posted a question here related to that a few days ago here : http://www.dovecot.org/list/dovecot/2013-March/089241.html
I just read today (e-mail on this list) from Timo Sirainen that
Dovecot is getting close to having native METADATA support.
I am very curious about this. When is "getting close" and I would guess this will be for v2.2? Will this support be the same as the dovecot-metadata-plugin in hg or something completely different? I'm sorry if I'm asking questions that have already been answered.
My goal is to use Kolab3 with Dovecot instead of using Cyrus IMAP and Kolab requires metadata/annotation support. Right now I'm testing this using the dovecot-metadata-plugin but I am very interested it learning about native metadata support and testing it with Kolab 3.
Any detail you can provide would be very appreciated.
Bruce
On 27.3.2013, at 16.34, Bruce Marriner bruce+dovecot@bmts.us wrote:
I've been trying to work with dovecot metadata plugin and posted a question here related to that a few days ago here : http://www.dovecot.org/list/dovecot/2013-March/089241.html
The patch is now in v2.1 hg, so will be in v2.1.16.
I just read today (e-mail on this list) from Timo Sirainen that
Dovecot is getting close to having native METADATA support.
I am very curious about this. When is "getting close" and I would guess this will be for v2.2? Will this support be the same as the dovecot-metadata-plugin in hg or something completely different? I'm sorry if I'm asking questions that have already been answered.
The metadata plugin started with implementing the IMAP commands and kind of ignored the difficult parts of fitting it in with everything. The stuff that is in Dovecot now handles most of the difficult parts, but the IMAP commands are missing. There are still two somewhat difficult things missing:
- Where/how to keep track of metadata quota to prevent abuse? Maybe some limits to number of entries, max. bytes total in entries, max. bytes per entry. Although the last one only is useful for those backends that can't handle large entry sizes.
( * Maybe there should be a new dict backend that can handle both small and large entries more optimally.. Then again some nosql dict backend would probably work well too.)
- Currently it's configured via mail_attribute_dict, which can e.g. point to a file in user's home directory. How to handle shared metadata in shared folders? Should userA just be accessing userB's dict file? Where are metadata stored for public folders that have no owner? Should there be two dict settings for private and public dict? (The last, or maybe all, would be a non-issue if I had already implemented my idea of having only one dict configuration where different prefixes could be mapped to completely different locations/backends/etc.)
On Wednesday, March 27, 2013 02:25 PM CDT, Timo Sirainen tss@iki.fi wrote:
On 27.3.2013, at 16.34, Bruce Marriner bruce+dovecot@bmts.us wrote:
I've been trying to work with dovecot metadata plugin and posted a question here related to that a few days ago here : http://www.dovecot.org/list/dovecot/2013-March/089241.html
The patch is now in v2.1 hg, so will be in v2.1.16.
Thank you.
Dovecot is getting close to having native METADATA support.
I am very curious about this. When is "getting close" and I would guess this will be for v2.2? Will this support be the same as the dovecot-metadata-plugin in hg or something completely different? I'm sorry if I'm asking questions that have already been answered.
The metadata plugin started with implementing the IMAP commands and kind of ignored the difficult parts of fitting it in with everything. The stuff that is in Dovecot now handles most of the difficult parts, but the IMAP commands are missing. There are still two somewhat difficult things missing:
- Where/how to keep track of metadata quota to prevent abuse? Maybe some limits to number of entries, max. bytes total in entries, max. bytes per entry. Although the last one only is useful for those backends that can't handle large entry sizes.
( * Maybe there should be a new dict backend that can handle both small and large entries more optimally.. Then again some nosql dict backend would probably work well too.)
- Currently it's configured via mail_attribute_dict, which can e.g. point to a file in user's home directory. How to handle shared metadata in shared folders? Should userA just be accessing userB's dict file? Where are metadata stored for public folders that have no owner? Should there be two dict settings for private and public dict? (The last, or maybe all, would be a non-issue if I had already implemented my idea of having only one dict configuration where different prefixes could be mapped to completely different locations/backends/etc.)
These questions I can't help much with, sadly. But I am more then willing to help with any testing, debugging, etc that I can possibly provide when there's something to test :). I really do appreciate your work on this Timo!
On Wed, 2013-03-27 at 21:25 +0200, Timo Sirainen wrote:
The metadata plugin started with implementing the IMAP commands and kind of ignored the difficult parts of fitting it in with everything. The stuff that is in Dovecot now handles most of the difficult parts, but the IMAP commands are missing. There are still two somewhat difficult things missing:
So, here are some plans for them:
- Where/how to keep track of metadata quota to prevent abuse? Maybe some limits to number of entries, max. bytes total in entries, max. bytes per entry. Although the last one only is useful for those backends that can't handle large entry sizes.
I guess there should be a total number of metadata items and total bytes of metadata, similar as to mails. Possibly it could even share the same quotas by default.
Whenever metadata item is updated, its key is logged to dovecot.index.log among (in future version) the value's length. These can be used to update quota and minimize locking waits:
- remember current transaction log offset
- read existing modified keys' value lengths
- mailbox metadata lock
- update new keys' values, remember their lengths
- commit transaction
- mailbox metadata unlock
- scan transaction log for changes to same keys, replace old key length with latest seen key length
- increase quota with (new length - previous length)
Would be nice to get rid of the locking, but I guess it's not possible without causing a race condition (S1, S2 = session 1/2):
S1: read 10 S1: write 25 S2: read 25 S2: write 30
a) S1 committed first: old=10, new=30 -> quota +20 S1: 25-10 = +15 S2: 30-25 = +5
b) S2 committed first (which can't happen with locking): old=10, new=25 -> quota +15 S1: 25-30 = -5 S2: 30-25 = +5 [30-10=+20 would be correct..]
- Currently it's configured via mail_attribute_dict, which can e.g. point to a file in user's home directory. How to handle shared metadata in shared folders? Should userA just be accessing userB's dict file? Where are metadata stored for public folders that have no owner? Should there be two dict settings for private and public dict? (The last, or maybe all, would be a non-issue if I had already implemented my idea of having only one dict configuration where different prefixes could be mapped to completely different locations/backends/etc.)
METADATA RFC says that shared metadata is required, while private metadata isn't required. So most of the metadata is probably marked as shared, even for mailboxes without any ACLs. So for efficiency most of the metadata should be stored in each user's own metadata database rather than one huge shared database. So that's why mail_attribute_dict must be used for private and shared metadata for your user's own mailboxes. That also forces using the same for shared mailboxes.
For public mailboxes there is no owner user, so I guess there needs to be a new setting mail_attribute_public_dict. I was also considering a per-namespace mail_attribute_dict, but maybe that's not worth the trouble for now. In any case in future the idea is to allow all mail settings to be overridden by putting them inside namespace {}.
participants (2)
-
Bruce Marriner
-
Timo Sirainen