On Tue, 2005-02-01 at 12:00 -0500, Geo Carncross wrote:
I wish keywords could be used as a replacement for UIDs that'd never change ( e.g. KEYWORD $MID=989498397.32217.wumpus,S=6013 ), but most IMAP servers don't seem to optimize SEARCH KEYWORD for this.
I don't think that is a good way to use keywords. Keywords are required (I think) to be shown in PERMANENTFLAGS reply and then it would contain every message's UID.
Also servers' internal implementations usually treat them as flags which are reused between multiple messages. I've tried to make Dovecot's implementation so that setting a separate keyword for each message wouldn't be too slow or memory hungry, but in index file they're still stored in a bitmask, so it uses 4 bytes per 32 keywords for all messages.
ANNOTATE extension is really where this belongs. I'll probably implement it at some point, but I don't really know where I'd store them. Perhaps I should finally use Berkeley DB for that.. or SQL as alternative. Although having some simpler (but slower) choice would be nice too. So I guess I'll just use some generic key -> value mapper API which has different backends..
I wish keywords could be used as a replacement for folders such that a message could be in multiple folders, but IMAP clients would need a way to fetch all the keywords efficiently. Perhaps just adding them to the PERMANENTFLAGS response would be enough...
Some thought should go into the support of clients that support this kind of behavior, and provide a way to map "folders" and "keywords" in both directions.
I've recently discussed about this in private mail with a few people. Virtual folders implemented with keywords would be a nice idea. Each keyword would map to virtual folder under the mailbox.
"?keyword" would mean the keyword was set automatically by some virtual folder rule. It's removed if the rule is changed and doesn't match anymore.
"keyword" means the message was explicitly copied into the virtual folder and it's not removed automatically.
"-keyword" means the message was explicitly moved away from the virtual folder and it's not added again automatically by any rule.
\Deleted + EXPUNGE probably would expunge the message from all virtual folders. I'm not sure how the "moving away" would work then.. COPY + \Deleted + EXPUNGE sequence somehow should remember that the message was wanted to be expunged only from that mailbox.
I think ?keyword should be shown to client as keyword without the ? character and -keywords not at all.