james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioan Eugen Stan <stan.ieu...@gmail.com>
Subject HBase rowkey choice for MailboxMapper interface implementation
Date Mon, 11 Jul 2011 16:41:53 GMT

Development on the mailbox is going well, I am nearly done with
implementing MailboxManager. After this, the route will be
SubscriptionManager and MessageManager.
We are facing some issues regarding the key choice that will determine
the way to access mailboxes.

The MAILBOXES HBase table stores information about individual
mailboxes. The current values stored are: Name, Namespace, User (who
is probably owner of the mailbox ???), uid validity field, last uid,
highest mod seq, for which I don't know the purpose, and mailbox ID.

After discussing with Eric, I have switched from using the mailbox ID
as a row key to using one like „user:namespace:name”.
Eric pointed out that mailboxes can be renamed and we should switch
back using the UID as a rowkey. We agreed that it's best to have an
open discussion about this.

The mailbox search API provides access only to a MailboxPath, that we
have to use in order to find information about the mailbox. If we use
a rowkey like "user:namespace:name", finding the mailbox and getting
the information is a simple Get operation. Also, finding mailboxes
that contain that mailbox name is a scan with a partial key, so again
pretty fast.

If we are using the mailbox ID as a row key, finding a mailbox by it's
path is more difficult. We have to either scan the entire table, or
store additional information in the users account (like what mailboxes
does he have, and what are their ID's, and get them by ID).

My thoughts:
The IMAP RFC states that a user can not send commands that affect
messages unless he is in „Selected  State”, that is he has
successfully selected a mailbox (SELECT or EXAMINE). To get into
selected state he must be first authenticated. The user must also have
a primary mailbox called „INBOX”. I think we can use this to form a
key, and store some valuable information that we can use for other

What do you think?


Ioan Eugen Stan

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message