diff --git .gitignore .gitignore
index e2fbf32..303b9f1 100644
--- .gitignore
+++ .gitignore
@@ -4,3 +4,6 @@ target
 derby.log
 var
 log
+.classpath
+.project
+.settings
\ No newline at end of file
diff --git cassandra/pom.xml cassandra/pom.xml
new file mode 100644
index 0000000..aa2c240
--- /dev/null
+++ cassandra/pom.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>apache-james-mailbox</artifactId>
+        <groupId>org.apache.james</groupId>
+        <version>0.6-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>apache-james-mailbox-cassandra</artifactId>
+    <description>Apache James Mailbox implementation over Cassandra</description>
+    <name>Apache James :: Mailbox :: Cassandra</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>${javax.mail.groupId}</groupId>
+            <artifactId>${javax.mail.artifactId}</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>apache-james-mailbox-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>apache-james-mailbox-store</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>apache-james-mailbox-api</artifactId>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+        <dependency>
+	    <groupId>com.datastax.cassandra</groupId>
+	    <artifactId>cassandra-driver-core</artifactId>
+	    <version>${cassandra-driver-core.version}</version>
+        </dependency>
+        <dependency>
+    	    <groupId>org.cassandraunit</groupId>
+   	    <artifactId>cassandra-unit</artifactId>
+            <version>${cassandra-unit.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>noTest</id>
+            <activation>
+                <os>
+                    <family>windows</family>
+                </os>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>true</skipTests>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>fully.qualified.MainClass</mainClass>
+                         </manifest>
+                    </archive>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java
new file mode 100644
index 0000000..e33b5f1
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java
@@ -0,0 +1,57 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra;
+
+import java.util.UUID;
+
+import org.apache.james.mailbox.MailboxPathLocker;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
+import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.Authenticator;
+import org.apache.james.mailbox.store.StoreMailboxManager;
+import org.apache.james.mailbox.store.StoreMessageManager;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
+
+/**
+ * Cassandra implementation of {@link StoreMailboxManager}
+ */
+public class CassandraMailboxManager extends StoreMailboxManager<UUID> {
+    private MailboxPathLocker locker;
+
+    public CassandraMailboxManager(CassandraMailboxSessionMapperFactory mapperFactory, Authenticator authenticator, final MailboxPathLocker locker) {
+        super(mapperFactory, authenticator, locker, new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
+        this.locker = locker;
+    }
+
+    @Override
+    protected Mailbox<UUID> doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
+        return new SimpleMailbox<UUID>(mailboxPath, randomUidValidity());
+    }
+
+    @Override
+    protected StoreMessageManager<UUID> createMessageManager(Mailbox<UUID> mailboxRow, MailboxSession session) throws MailboxException {
+        return new CassandraMessageManager(getMapperFactory(), getMessageSearchIndex(), getEventDispatcher(), this.locker, mailboxRow);
+    }
+
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java
new file mode 100644
index 0000000..c736ab0
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java
@@ -0,0 +1,74 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra;
+
+import java.util.UUID;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.cassandra.mail.CassandraMailboxMapper;
+import org.apache.james.mailbox.cassandra.mail.CassandraMessageMapper;
+import org.apache.james.mailbox.cassandra.mail.CassandraUidProvider;
+import org.apache.james.mailbox.cassandra.user.CassandraSubscriptionMapper;
+import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
+import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.ModSeqProvider;
+import org.apache.james.mailbox.store.mail.UidProvider;
+import org.apache.james.mailbox.store.user.SubscriptionMapper;
+
+import com.datastax.driver.core.Session;
+
+/**
+ * Cassandra implementation of {@link MailboxSessionMapperFactory}
+ * 
+ */
+public class CassandraMailboxSessionMapperFactory extends MailboxSessionMapperFactory<UUID> {
+    private Session session;
+    private CassandraUidProvider uidProvider;
+    private ModSeqProvider<UUID> modSeqProvider;
+
+    public CassandraMailboxSessionMapperFactory(CassandraUidProvider uidProvider, ModSeqProvider<UUID> modSeqProvider, CassandraSession session) {
+        this.uidProvider = uidProvider;
+        this.modSeqProvider = modSeqProvider;
+        this.session = session;
+    }
+
+    @Override
+    public CassandraMessageMapper createMessageMapper(MailboxSession mailboxSession) {
+        return new CassandraMessageMapper(session, uidProvider, modSeqProvider);
+    }
+
+    @Override
+    public MailboxMapper<UUID> createMailboxMapper(MailboxSession mailboxSession) {
+        return new CassandraMailboxMapper(session);
+    }
+
+    @Override
+    public SubscriptionMapper createSubscriptionMapper(MailboxSession mailboxSession) {
+        return new CassandraSubscriptionMapper(session);
+    }
+
+    public ModSeqProvider<UUID> getModSeqProvider() {
+        return modSeqProvider;
+    }
+
+    public UidProvider<UUID> getUidProvider() {
+        return uidProvider;
+    }
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java
new file mode 100644
index 0000000..12b306e
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java
@@ -0,0 +1,57 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra;
+
+import java.util.UUID;
+
+import javax.mail.Flags;
+
+import org.apache.james.mailbox.MailboxPathLocker;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
+import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.MailboxEventDispatcher;
+import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
+import org.apache.james.mailbox.store.StoreMessageManager;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.search.MessageSearchIndex;
+
+/**
+ * Cassandra implementation of {@link StoreMessageManager}
+ * 
+ */
+public class CassandraMessageManager extends StoreMessageManager<UUID> {
+
+    public CassandraMessageManager(MailboxSessionMapperFactory<UUID> mapperFactory, MessageSearchIndex<UUID> index, MailboxEventDispatcher<UUID> dispatcher, MailboxPathLocker locker, Mailbox<UUID> mailbox) throws MailboxException {
+        super(mapperFactory, index, dispatcher, locker, mailbox, new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
+
+    }
+
+    /**
+     * Support user flags
+     */
+    @Override
+    protected Flags getPermanentFlags(MailboxSession session) {
+        Flags flags = super.getPermanentFlags(session);
+        flags.add(Flags.Flag.USER);
+        return flags;
+    }
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraSession.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraSession.java
new file mode 100644
index 0000000..b1426cb
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraSession.java
@@ -0,0 +1,149 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra;
+
+import com.datastax.driver.core.CloseFuture;
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.RegularStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.Statement;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * A Cassandra session with the default keyspace
+ * 
+ */
+public class CassandraSession implements Session {
+    private final static String DEFAULT_CLUSTER_IP = "localhost";
+    private final static int DEFAULT_CLUSTER_PORT = 9042;
+    private final static String DEFAULT_KEYSPACE_NAME = "apache_james";
+    private final static int DEFAULT_REPLICATION_FACTOR = 1;
+
+    private Session session;
+
+    public CassandraSession(String ip, int port, String keyspace, int replicationFactor) {
+        Cluster cluster = Cluster.builder().addContactPoint(ip).withPort(port).build();
+        if (cluster.getMetadata().getKeyspace(keyspace) == null) {
+            initDatabase(cluster, keyspace, replicationFactor);
+        }
+        session = cluster.connect(keyspace);
+    }
+
+    private void initDatabase(Cluster cluster, String keyspace, int replicationFactor) {
+        session = cluster.connect();
+        session.execute("CREATE KEYSPACE IF NOT EXISTS " + keyspace + " WITH replication " + "= {'class':'SimpleStrategy', 'replication_factor':" + replicationFactor + "};");
+        session.execute("CREATE TABLE IF NOT EXISTS " + keyspace + ".mailbox (" + "id uuid PRIMARY KEY," + "name text, namespace text," + "uidvalidity bigint," + "user text," + "path text" + ");");
+        session.execute("CREATE INDEX IF NOT EXISTS ON " + keyspace + ".mailbox(path);");
+        session.execute("CREATE TABLE IF NOT EXISTS " + keyspace + ".messageCounter (" + "mailboxId UUID PRIMARY KEY," + "nextUid bigint," + ");");
+        session.execute("CREATE TABLE IF NOT EXISTS " + keyspace + ".mailboxCounters (" + "mailboxId UUID PRIMARY KEY," + "count counter," + "unseen counter," + "nextModSeq counter" + ");");
+        session.execute("CREATE TABLE IF NOT EXISTS " + keyspace + ".message (" + "mailboxId UUID," + "uid bigint," + "internalDate timestamp," + "bodyStartOctet int," + "content blob," + "modSeq bigint," + "mediaType text," + "subType text," + "fullContentOctets int," + "bodyOctets int,"
+                + "textualLineCount bigint," + "bodyContent blob," + "headerContent blob," + "flagAnswered boolean," + "flagDeleted boolean," + "flagDraft boolean," + "flagRecent boolean," + "flagSeen boolean," + "flagFlagged boolean," + "flagUser boolean," + "PRIMARY KEY (mailboxId, uid)" + ");");
+        session.execute("CREATE TABLE IF NOT EXISTS " + keyspace + ".subscription (" + "user text," + "mailbox text," + "PRIMARY KEY (mailbox, user)" + ");");
+        session.close();
+    }
+
+    public CassandraSession() {
+        this(DEFAULT_CLUSTER_IP, DEFAULT_CLUSTER_PORT, DEFAULT_KEYSPACE_NAME, DEFAULT_REPLICATION_FACTOR);
+    }
+
+    @Override
+    public String getLoggedKeyspace() {
+        return session.getLoggedKeyspace();
+    }
+
+    @Override
+    public Session init() {
+        return session.init();
+    }
+
+    @Override
+    public ResultSet execute(String query) {
+        return session.execute(query);
+    }
+
+    @Override
+    public ResultSet execute(String query, Object... values) {
+        return session.execute(query, values);
+    }
+
+    @Override
+    public ResultSet execute(Statement statement) {
+        return session.execute(statement);
+    }
+
+    @Override
+    public ResultSetFuture executeAsync(String query) {
+        return session.executeAsync(query);
+    }
+
+    @Override
+    public ResultSetFuture executeAsync(String query, Object... values) {
+        return session.executeAsync(query, values);
+    }
+
+    @Override
+    public ResultSetFuture executeAsync(Statement statement) {
+        return session.executeAsync(statement);
+    }
+
+    @Override
+    public PreparedStatement prepare(String query) {
+        return session.prepare(query);
+    }
+
+    @Override
+    public PreparedStatement prepare(RegularStatement statement) {
+        return session.prepare(statement);
+    }
+
+    @Override
+    public ListenableFuture<PreparedStatement> prepareAsync(String query) {
+        return session.prepareAsync(query);
+    }
+
+    @Override
+    public ListenableFuture<PreparedStatement> prepareAsync(RegularStatement statement) {
+        return session.prepareAsync(statement);
+    }
+
+    @Override
+    public CloseFuture closeAsync() {
+        return session.closeAsync();
+    }
+
+    @Override
+    public void close() {
+        session.close();
+    }
+
+    @Override
+    public boolean isClosed() {
+        return session.isClosed();
+    }
+
+    @Override
+    public Cluster getCluster() {
+        return session.getCluster();
+    }
+
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraSubscriptionManager.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraSubscriptionManager.java
new file mode 100644
index 0000000..c1428e9
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraSubscriptionManager.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.user.model.Subscription;
+import org.apache.james.mailbox.store.user.model.impl.SimpleSubscription;
+
+/**
+ * Cassandra implementation of {@link StoreSubscriptionManager}
+ * 
+ */
+public class CassandraSubscriptionManager extends StoreSubscriptionManager {
+
+    public CassandraSubscriptionManager(CassandraMailboxSessionMapperFactory mapperFactory) {
+        super(mapperFactory);
+    }
+
+    /**
+     * @see org.apache.james.mailbox.store.StoreSubscriptionManager#createSubscription(org.apache.james.mailbox.MailboxSession,
+     *      java.lang.String)
+     */
+    protected Subscription createSubscription(MailboxSession session, String mailbox) {
+        return new SimpleSubscription(session.getUser().getUserName(), mailbox);
+    }
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
new file mode 100644
index 0000000..8b5f018
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
@@ -0,0 +1,147 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.mail;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.insertInto;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
+
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.FIELDS;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.ID;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.NAME;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.NAMESPACE;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.PATH;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.TABLE_NAME;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.UIDVALIDITY;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxTable.USER;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.exception.MailboxNotFoundException;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableList.Builder;
+
+/**
+ * Data access management for mailbox.
+ */
+public class CassandraMailboxMapper implements MailboxMapper<UUID> {
+
+    private Session session;
+
+    public CassandraMailboxMapper(Session session) {
+        this.session = session;
+    }
+
+    @Override
+    public void delete(Mailbox<UUID> mailbox) throws MailboxException {
+        session.execute(QueryBuilder.delete().from(TABLE_NAME).where(eq(ID, mailbox.getMailboxId())));
+    }
+
+    @Override
+    public Mailbox<UUID> findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException {
+        ResultSet resultSet = session.execute(select(FIELDS).from(TABLE_NAME).where(eq(PATH, path.toString())));
+        if (resultSet.isExhausted()) {
+            throw new MailboxNotFoundException(path);
+        } else {
+            return mailbox(resultSet.one());
+        }
+    }
+
+    private SimpleMailbox<UUID> mailbox(Row row) {
+        SimpleMailbox<UUID> mailbox = new SimpleMailbox<UUID>(new MailboxPath(row.getString(NAMESPACE), row.getString(USER), row.getString(NAME)), row.getLong(UIDVALIDITY));
+        mailbox.setMailboxId(row.getUUID(ID));
+        return mailbox;
+    }
+
+    @Override
+    public List<Mailbox<UUID>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
+        final String regexWithUser = ".*" + path.getNamespace() + ".*" + path.getUser() + ".*" + path.getName() + ".*";
+        final String regexWithoutUser = ".*" + path.getNamespace() + ".*null.*" + path.getName() + ".*";
+        Builder<Mailbox<UUID>> result = ImmutableList.<Mailbox<UUID>> builder();
+        for (Row row : session.execute(select(FIELDS).from(TABLE_NAME))) {
+            if (row.getString(PATH).matches(regexWithUser) || row.getString(PATH).matches(regexWithoutUser)) {
+                result.add(mailbox(row));
+            }
+        }
+        return result.build();
+    }
+
+    @Override
+    public void save(Mailbox<UUID> mailbox) throws MailboxException {
+        Preconditions.checkArgument(mailbox instanceof SimpleMailbox<?>);
+        SimpleMailbox<UUID> simpleMailbox = (SimpleMailbox<UUID>) mailbox;
+        if (simpleMailbox.getMailboxId() == null) {
+            simpleMailbox.setMailboxId(UUID.randomUUID());
+        }
+        upsertMailbox(simpleMailbox);
+    }
+
+    private void upsertMailbox(SimpleMailbox<UUID> mailbox) {
+        session.execute(insertInto(TABLE_NAME).value(ID, mailbox.getMailboxId()).value(NAME, mailbox.getName()).value(NAMESPACE, mailbox.getNamespace()).value(UIDVALIDITY, mailbox.getUidValidity()).value(USER, mailbox.getUser()).value(PATH, path(mailbox).toString()));
+    }
+
+    private MailboxPath path(Mailbox<?> mailbox) {
+        return new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
+    }
+
+    @Override
+    public void endRequest() {
+        // Do nothing
+    }
+
+    @Override
+    public boolean hasChildren(Mailbox<UUID> mailbox, char delimiter) {
+        final String regexWithUser = ".*" + mailbox.getNamespace() + ".*" + mailbox.getUser() + ".*" + mailbox.getName() + delimiter + ".*";
+        final String regexWithoutUser = ".*" + mailbox.getNamespace() + ".*null.*" + mailbox.getName() + delimiter + ".*";
+        for (Row row : session.execute(select(PATH).from(TABLE_NAME))) {
+            if (row.getString(PATH).matches(regexWithUser) || row.getString(PATH).matches(regexWithoutUser)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public List<Mailbox<UUID>> list() throws MailboxException {
+        Builder<Mailbox<UUID>> result = ImmutableList.<Mailbox<UUID>> builder();
+        for (Row row : session.execute(select(FIELDS).from(TABLE_NAME))) {
+            result.add(mailbox(row));
+        }
+        return result.build();
+    }
+
+    @Override
+    public <T> T execute(Transaction<T> transaction) throws MailboxException {
+        return transaction.run();
+    }
+
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
new file mode 100644
index 0000000..3a1de08
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
@@ -0,0 +1,369 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.mail;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.asc;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.bindMarker;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.decr;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.gt;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.incr;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.insertInto;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.lt;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.update;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.BODY_CONTENT;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.BODY_OCTECTS;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.BODY_START_OCTET;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.FIELDS;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.FULL_CONTENT_OCTETS;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.HEADER_CONTENT;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.IMAP_UID;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.INTERNAL_DATE;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.MAILBOX_ID;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.MEDIA_TYPE;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.MOD_SEQ;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.SUB_TYPE;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.TABLE_NAME;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.TEXTUAL_LINE_COUNT;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.ANSWERED;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.DELETED;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.DRAFT;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.FLAGGED;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.JAVAX_MAIL_FLAG;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.RECENT;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.SEEN;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageTable.Flag.USER;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.mail.Flags;
+import javax.mail.Flags.Flag;
+import javax.mail.util.SharedByteArrayInputStream;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.cassandra.table.CassandraMailboxCountersTable;
+import org.apache.james.mailbox.cassandra.table.CassandraMessageTable;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MessageMetaData;
+import org.apache.james.mailbox.model.MessageRange;
+import org.apache.james.mailbox.model.UpdatedFlags;
+import org.apache.james.mailbox.store.SimpleMessageMetaData;
+import org.apache.james.mailbox.store.mail.MessageMapper;
+import org.apache.james.mailbox.store.mail.ModSeqProvider;
+import org.apache.james.mailbox.store.mail.UidProvider;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMessage;
+
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.querybuilder.Assignment;
+import com.datastax.driver.core.querybuilder.Insert;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.datastax.driver.core.querybuilder.Select.Where;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSortedSet;
+import com.google.common.collect.ImmutableSortedSet.Builder;
+import com.google.common.io.ByteStreams;
+import com.google.common.primitives.Bytes;
+
+/**
+ * Cassandra implementation of a {@link MessageMapper}.
+ */
+public class CassandraMessageMapper implements MessageMapper<UUID> {
+
+    private Session session;
+    private ModSeqProvider<UUID> modSeqProvider;
+    private MailboxSession mailboxSession;
+    private UidProvider<UUID> uidProvider;
+
+    public CassandraMessageMapper(Session session, CassandraUidProvider uidProvider, ModSeqProvider<UUID> modSeqProvider) {
+        this.session = session;
+        this.uidProvider = uidProvider;
+        this.modSeqProvider = modSeqProvider;
+    }
+
+    public CassandraMessageMapper(Session session, CassandraUidProvider uidProvider, CassandraModSeqProvider modSeqProvider, MailboxSession mailboxSession) {
+        this(session, uidProvider, modSeqProvider);
+        this.mailboxSession = mailboxSession;
+    }
+
+    @Override
+    public long countMessagesInMailbox(Mailbox<UUID> mailbox) throws MailboxException {
+        ResultSet results = session.execute(select(CassandraMailboxCountersTable.COUNT).from(CassandraMailboxCountersTable.TABLE_NAME).where(eq(CassandraMailboxCountersTable.MAILBOX_ID, mailbox.getMailboxId())));
+        return results.isExhausted() ? 0 : results.one().getLong(CassandraMailboxCountersTable.COUNT);
+    }
+
+    @Override
+    public long countUnseenMessagesInMailbox(Mailbox<UUID> mailbox) throws MailboxException {
+        ResultSet results = session.execute(select(CassandraMailboxCountersTable.UNSEEN).from(CassandraMailboxCountersTable.TABLE_NAME).where(eq(CassandraMailboxCountersTable.MAILBOX_ID, mailbox.getMailboxId())));
+        if (!results.isExhausted()) {
+            Row row = results.one();
+            if (row.getColumnDefinitions().contains(CassandraMailboxCountersTable.UNSEEN)) {
+                return row.getLong(CassandraMailboxCountersTable.UNSEEN);
+            }
+        }
+        return 0;
+    }
+
+    @Override
+    public void delete(Mailbox<UUID> mailbox, Message<UUID> message) throws MailboxException {
+        session.execute(QueryBuilder.delete().from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(eq(IMAP_UID, message.getUid())));
+        decrementCount(mailbox);
+        if (!message.isSeen()) {
+            decrementUnseen(mailbox);
+        }
+    }
+
+    private void decrementCount(Mailbox<UUID> mailbox) {
+        updateMailbox(mailbox, decr(CassandraMailboxCountersTable.COUNT));
+    }
+
+    private void incrementCount(Mailbox<UUID> mailbox) {
+        updateMailbox(mailbox, incr(CassandraMailboxCountersTable.COUNT));
+    }
+
+    private void decrementUnseen(Mailbox<UUID> mailbox) {
+        updateMailbox(mailbox, decr(CassandraMailboxCountersTable.UNSEEN));
+    }
+
+    private void incrementUnseen(Mailbox<UUID> mailbox) {
+        updateMailbox(mailbox, incr(CassandraMailboxCountersTable.UNSEEN));
+    }
+
+    private void updateMailbox(Mailbox<UUID> mailbox, Assignment operation) {
+        session.execute(update(CassandraMailboxCountersTable.TABLE_NAME).with(operation).where(eq(CassandraMailboxCountersTable.MAILBOX_ID, mailbox.getMailboxId())));
+    }
+
+    @Override
+    public Iterator<Message<UUID>> findInMailbox(Mailbox<UUID> mailbox, MessageRange set, FetchType ftype, int max) throws MailboxException {
+        Builder<Message<UUID>> result = ImmutableSortedSet.<Message<UUID>> naturalOrder();
+        ResultSet rows = session.execute(buildQuery(mailbox, set));
+        for (Row row : rows) {
+            result.add(message(row));
+        }
+        return result.build().iterator();
+    }
+
+    private byte[] getFullContent(Row row) {
+        byte[] headerContent = new byte[row.getBytes(HEADER_CONTENT).remaining()];
+        byte[] bodyContent = new byte[row.getBytes(BODY_CONTENT).remaining()];
+        row.getBytes(HEADER_CONTENT).get(headerContent);
+        row.getBytes(BODY_CONTENT).get(bodyContent);
+        return Bytes.concat(headerContent, bodyContent);
+    }
+
+    private Flags getFlags(Row row) {
+        Flags flags = new Flags();
+        for (String flag : CassandraMessageTable.Flag.ALL) {
+            if (row.getBool(flag)) {
+                flags.add(JAVAX_MAIL_FLAG.get(flag));
+            }
+        }
+        return flags;
+    }
+
+    private PropertyBuilder getPropertyBuilder(Row row) {
+        PropertyBuilder property = new PropertyBuilder();
+        property.setSubType(row.getString(SUB_TYPE));
+        property.setMediaType(row.getString(MEDIA_TYPE));
+        property.setTextualLineCount(row.getLong(TEXTUAL_LINE_COUNT));
+        return property;
+    }
+
+    private Message<UUID> message(Row row) {
+        SimpleMessage<UUID> message = new SimpleMessage<UUID>(row.getDate(INTERNAL_DATE), row.getInt(FULL_CONTENT_OCTETS), row.getInt(BODY_START_OCTET), new SharedByteArrayInputStream(getFullContent(row)), getFlags(row), getPropertyBuilder(row), row.getUUID(MAILBOX_ID));
+        message.setUid(row.getLong(IMAP_UID));
+        return message;
+    }
+
+    private Where buildQuery(Mailbox<UUID> mailbox, MessageRange set) {
+        final MessageRange.Type type = set.getType();
+        switch (type) {
+        case ALL:
+            return selectAll(mailbox);
+        case FROM:
+            return selectFrom(mailbox, set.getUidFrom());
+        case RANGE:
+            return selectRange(mailbox, set.getUidFrom(), set.getUidTo());
+        case ONE:
+            return selectMessage(mailbox, set.getUidFrom());
+        }
+        throw new UnsupportedOperationException();
+    }
+
+    private Where selectAll(Mailbox<UUID> mailbox) {
+        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId()));
+    }
+
+    private Where selectFrom(Mailbox<UUID> mailbox, long uid) {
+        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(gt(IMAP_UID, uid));
+    }
+
+    private Where selectRange(Mailbox<UUID> mailbox, long from, long to) {
+        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(gt(IMAP_UID, from)).and(lt(IMAP_UID, to));
+    }
+
+    private Where selectMessage(Mailbox<UUID> mailbox, long uid) {
+        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(eq(IMAP_UID, uid));
+    }
+
+    @Override
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox<UUID> mailbox) throws MailboxException {
+        ImmutableList.Builder<Long> result = ImmutableList.<Long> builder();
+        ResultSet rows = session.execute(selectAll(mailbox).orderBy(asc(IMAP_UID)));
+        for (Row row : rows) {
+            if (row.getBool(RECENT)) {
+                result.add(row.getLong(IMAP_UID));
+            }
+        }
+        return result.build();
+    }
+
+    @Override
+    public Long findFirstUnseenMessageUid(Mailbox<UUID> mailbox) throws MailboxException {
+        ResultSet rows = session.execute(selectAll(mailbox).orderBy(asc(IMAP_UID)));
+        for (Row row : rows) {
+            if (!row.getBool(SEEN)) {
+                return row.getLong(IMAP_UID);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(final Mailbox<UUID> mailbox, MessageRange set) throws MailboxException {
+        ImmutableMap.Builder<Long, MessageMetaData> deletedMessages = ImmutableMap.builder();
+        ResultSet messages = session.execute(buildQuery(mailbox, set));
+        for (Row row : messages) {
+            if (row.getBool(DELETED)) {
+                Message<UUID> message = message(row);
+                delete(mailbox, message);
+                deletedMessages.put(message.getUid(), new SimpleMessageMetaData(message));
+            }
+        }
+        return deletedMessages.build();
+    }
+
+    @Override
+    public MessageMetaData move(Mailbox<UUID> mailbox, Message<UUID> original) throws MailboxException {
+        throw new UnsupportedOperationException("Not implemented - see https://issues.apache.org/jira/browse/IMAP-370");
+    }
+
+    @Override
+    public void endRequest() {
+        // Do nothing
+    }
+
+    @Override
+    public long getHighestModSeq(Mailbox<UUID> mailbox) throws MailboxException {
+        return modSeqProvider.highestModSeq(mailboxSession, mailbox);
+    }
+
+    @Override
+    public <T> T execute(Transaction<T> transaction) throws MailboxException {
+        return transaction.run();
+    }
+
+    @Override
+    public MessageMetaData add(Mailbox<UUID> mailbox, Message<UUID> message) throws MailboxException {
+        message.setUid(uidProvider.nextUid(mailboxSession, mailbox));
+        message.setModSeq(modSeqProvider.nextModSeq(mailboxSession, mailbox));
+        MessageMetaData messageMetaData = save(mailbox, message);
+        if (!message.isSeen()) {
+            incrementUnseen(mailbox);
+        }
+        incrementCount(mailbox);
+        return messageMetaData;
+    }
+
+    private MessageMetaData save(Mailbox<UUID> mailbox, Message<UUID> message) throws MailboxException {
+        try {
+            Insert query = insertInto(TABLE_NAME).value(MAILBOX_ID, mailbox.getMailboxId()).value(IMAP_UID, message.getUid()).value(MOD_SEQ, message.getModSeq()).value(INTERNAL_DATE, message.getInternalDate()).value(MEDIA_TYPE, message.getMediaType())
+                    .value(BODY_START_OCTET, message.getFullContentOctets() - message.getBodyOctets()).value(SUB_TYPE, message.getSubType()).value(FULL_CONTENT_OCTETS, message.getFullContentOctets()).value(BODY_OCTECTS, message.getBodyOctets()).value(ANSWERED, message.isAnswered())
+                    .value(DELETED, message.isDeleted()).value(DRAFT, message.isDraft()).value(FLAGGED, message.isFlagged()).value(RECENT, message.isRecent()).value(SEEN, message.isSeen()).value(USER, message.createFlags().contains(Flag.USER)).value(BODY_CONTENT, bindMarker())
+                    .value(HEADER_CONTENT, bindMarker()).value(TEXTUAL_LINE_COUNT, message.getTextualLineCount());
+            PreparedStatement preparedStatement = session.prepare(query.toString());
+            BoundStatement boundStatement = preparedStatement.bind(toByteBuffer(message.getBodyContent()), toByteBuffer(message.getHeaderContent()));
+            session.execute(boundStatement);
+            return new SimpleMessageMetaData(message);
+        } catch (IOException e) {
+            throw new MailboxException("Error saving mail", e);
+        }
+    }
+
+    private ByteBuffer toByteBuffer(InputStream stream) throws IOException {
+        return ByteBuffer.wrap(ByteStreams.toByteArray(stream));
+    }
+
+    @Override
+    public Iterator<UpdatedFlags> updateFlags(Mailbox<UUID> mailbox, Flags flags, boolean value, boolean replace, MessageRange set) throws MailboxException {
+        ImmutableList.Builder<UpdatedFlags> result = ImmutableList.builder();
+        for (Row row : session.execute(buildQuery(mailbox, set))) {
+            Message<UUID> message = message(row);
+            Flags originFlags = message.createFlags();
+            Flags updatedFlags = buildFlags(message, flags, value, replace);
+            message.setFlags(updatedFlags);
+            message.setModSeq(modSeqProvider.nextModSeq(mailboxSession, mailbox));
+            save(mailbox, message);
+            result.add(new UpdatedFlags(message.getUid(), message.getModSeq(), originFlags, updatedFlags));
+        }
+        return result.build().iterator();
+    }
+
+    private Flags buildFlags(Message<UUID> message, Flags flags, boolean value, boolean replace) {
+        if (replace) {
+            return message.createFlags();
+        } else {
+            Flags updatedFlags = message.createFlags();
+            if (value) {
+                updatedFlags.add(flags);
+            } else {
+                updatedFlags.remove(flags);
+            }
+            return updatedFlags;
+        }
+    }
+
+    @Override
+    public MessageMetaData copy(Mailbox<UUID> mailbox, Message<UUID> original) throws MailboxException {
+        original.setUid(uidProvider.nextUid(mailboxSession, mailbox));
+        original.setModSeq(modSeqProvider.nextModSeq(mailboxSession, mailbox));
+        return save(mailbox, original);
+    }
+
+    @Override
+    public long getLastUid(Mailbox<UUID> mailbox) throws MailboxException {
+        return uidProvider.lastUid(mailboxSession, mailbox);
+    }
+
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProvider.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProvider.java
new file mode 100644
index 0000000..118d7dc
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProvider.java
@@ -0,0 +1,59 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.mail;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.incr;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.update;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxCountersTable.MAILBOX_ID;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxCountersTable.NEXT_MOD_SEQ;
+import static org.apache.james.mailbox.cassandra.table.CassandraMailboxCountersTable.TABLE_NAME;
+
+import java.util.UUID;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.mail.ModSeqProvider;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Session;
+
+public class CassandraModSeqProvider implements ModSeqProvider<UUID> {
+
+    private Session session;
+
+    public CassandraModSeqProvider(Session session) {
+        this.session = session;
+    }
+
+    @Override
+    public long nextModSeq(MailboxSession mailboxSession, Mailbox<UUID> mailbox) throws MailboxException {
+        session.execute(update(TABLE_NAME).with(incr(NEXT_MOD_SEQ)).where(eq(MAILBOX_ID, mailbox.getMailboxId())));
+        return highestModSeq(mailboxSession, mailbox);
+    }
+
+    @Override
+    public long highestModSeq(MailboxSession mailboxSession, Mailbox<UUID> mailbox) throws MailboxException {
+        ResultSet result = session.execute(select(NEXT_MOD_SEQ).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())));
+        return result.isExhausted() ? 0 : result.one().getLong(NEXT_MOD_SEQ);
+    }
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProvider.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProvider.java
new file mode 100644
index 0000000..2f2574d
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProvider.java
@@ -0,0 +1,69 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.mail;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.update;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageUidTable.MAILBOX_ID;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageUidTable.NEXT_UID;
+import static org.apache.james.mailbox.cassandra.table.CassandraMessageUidTable.TABLE_NAME;
+
+import java.util.UUID;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.mail.UidProvider;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Session;
+
+public class CassandraUidProvider implements UidProvider<UUID> {
+    private Session session;
+    private final int applied = 0;
+
+    public CassandraUidProvider(Session session) {
+        this.session = session;
+    }
+
+    @Override
+    public long nextUid(MailboxSession mailboxSession, Mailbox<UUID> mailbox) throws MailboxException {
+        ResultSet resultat = null;
+        long lastUid = lastUid(mailboxSession, mailbox);
+        if (lastUid == 0) {
+            resultat = session.execute(update(TABLE_NAME).with(set(NEXT_UID, ++lastUid)).where(eq(MAILBOX_ID, mailbox.getMailboxId())));
+        } else {
+            do {
+                lastUid = lastUid(mailboxSession, mailbox);
+                resultat = session.execute(update(TABLE_NAME).onlyIf(eq(NEXT_UID, lastUid)).with(set(NEXT_UID, ++lastUid)).where(eq(MAILBOX_ID, mailbox.getMailboxId())));
+            } while (!resultat.one().getBool(applied));
+        }
+        return lastUid;
+    }
+
+    @Override
+    public long lastUid(MailboxSession mailboxSession, Mailbox<UUID> mailbox) throws MailboxException {
+        ResultSet result = session.execute(select(NEXT_UID).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())));
+        return result.isExhausted() ? 0 : result.one().getLong(NEXT_UID);
+    }
+
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMailboxCountersTable.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMailboxCountersTable.java
new file mode 100644
index 0000000..175e208
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMailboxCountersTable.java
@@ -0,0 +1,28 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.table;
+
+public interface CassandraMailboxCountersTable {
+    String TABLE_NAME = "mailboxCounters";
+    String MAILBOX_ID = "mailboxId";
+    String COUNT = "count";
+    String UNSEEN = "unseen";
+    String NEXT_MOD_SEQ = "nextModSeq";
+}
\ No newline at end of file
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMailboxTable.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMailboxTable.java
new file mode 100644
index 0000000..1851eb9
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMailboxTable.java
@@ -0,0 +1,31 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.table;
+
+public interface CassandraMailboxTable {
+    String TABLE_NAME = "mailbox";
+    String ID = "id";
+    String USER = "user";
+    String PATH = "path";
+    String NAMESPACE = "namespace";
+    String UIDVALIDITY = "uidvalidity";
+    String NAME = "name";
+    String[] FIELDS = { ID, USER, NAMESPACE, UIDVALIDITY, NAME, PATH };
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMessageTable.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMessageTable.java
new file mode 100644
index 0000000..86ebe4f
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMessageTable.java
@@ -0,0 +1,57 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.table;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+
+public interface CassandraMessageTable {
+
+    String TABLE_NAME = "message";
+    String MAILBOX_ID = "mailboxId";
+    String IMAP_UID = "uid";
+    String INTERNAL_DATE = "internalDate";
+    String BODY_START_OCTET = "bodyStartOctet";
+    String CONTENT = "content";
+    String MOD_SEQ = "modSeq";
+    String MEDIA_TYPE = "mediaType";
+    String SUB_TYPE = "subType";
+    String FULL_CONTENT_OCTETS = "fullContentOctets";
+    String BODY_OCTECTS = "bodyOctets";
+    String TEXTUAL_LINE_COUNT = "textualLineCount";
+    String BODY_CONTENT = "bodyContent";
+    String HEADER_CONTENT = "headerContent";
+    String[] FIELDS = { MAILBOX_ID, IMAP_UID, INTERNAL_DATE, MOD_SEQ, BODY_START_OCTET, MEDIA_TYPE, SUB_TYPE, FULL_CONTENT_OCTETS, BODY_OCTECTS, Flag.ANSWERED, Flag.DELETED, Flag.DRAFT, Flag.FLAGGED, Flag.RECENT, Flag.SEEN, Flag.USER, BODY_CONTENT, HEADER_CONTENT, TEXTUAL_LINE_COUNT };
+
+    interface Flag {
+        String ANSWERED = "flagAnswered";
+        String DELETED = "flagDeleted";
+        String DRAFT = "flagDraft";
+        String RECENT = "flagRecent";
+        String SEEN = "flagSeen";
+        String FLAGGED = "flagFlagged";
+        String USER = "flagUser";
+        String[] ALL = { ANSWERED, DELETED, DRAFT, RECENT, SEEN, FLAGGED, USER };
+
+        ImmutableMap<String, javax.mail.Flags.Flag> JAVAX_MAIL_FLAG = new Builder<String, javax.mail.Flags.Flag>().put(ANSWERED, javax.mail.Flags.Flag.ANSWERED).put(DELETED, javax.mail.Flags.Flag.DELETED).put(DRAFT, javax.mail.Flags.Flag.DRAFT).put(RECENT, javax.mail.Flags.Flag.RECENT)
+                .put(SEEN, javax.mail.Flags.Flag.SEEN).put(FLAGGED, javax.mail.Flags.Flag.FLAGGED).put(USER, javax.mail.Flags.Flag.USER).build();
+
+    }
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMessageUidTable.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMessageUidTable.java
new file mode 100644
index 0000000..0566e2b
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraMessageUidTable.java
@@ -0,0 +1,26 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.table;
+
+public interface CassandraMessageUidTable {
+    String TABLE_NAME = "messageCounter";
+    String MAILBOX_ID = "mailboxId";
+    String NEXT_UID = "nextUid";
+}
\ No newline at end of file
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraSubscriptionTable.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraSubscriptionTable.java
new file mode 100644
index 0000000..91b2d12
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraSubscriptionTable.java
@@ -0,0 +1,29 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.table;
+
+public interface CassandraSubscriptionTable {
+
+    String TABLE_NAME = "subscription";
+    String USER = "user";
+    String MAILBOX = "mailbox";
+    String[] FIELDS = { MAILBOX, USER };
+
+}
diff --git cassandra/src/main/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapper.java cassandra/src/main/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapper.java
new file mode 100644
index 0000000..77d45ca
--- /dev/null
+++ cassandra/src/main/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapper.java
@@ -0,0 +1,95 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.user;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.insertInto;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
+import static org.apache.james.mailbox.cassandra.table.CassandraSubscriptionTable.FIELDS;
+import static org.apache.james.mailbox.cassandra.table.CassandraSubscriptionTable.MAILBOX;
+import static org.apache.james.mailbox.cassandra.table.CassandraSubscriptionTable.TABLE_NAME;
+import static org.apache.james.mailbox.cassandra.table.CassandraSubscriptionTable.USER;
+
+import java.util.List;
+
+import org.apache.james.mailbox.store.transaction.NonTransactionalMapper;
+import org.apache.james.mailbox.store.user.SubscriptionMapper;
+import org.apache.james.mailbox.store.user.model.Subscription;
+import org.apache.james.mailbox.store.user.model.impl.SimpleSubscription;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.querybuilder.Insert;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.datastax.driver.core.querybuilder.Select;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableList.Builder;
+
+public class CassandraSubscriptionMapper extends NonTransactionalMapper implements SubscriptionMapper {
+    private Session session;
+
+    public CassandraSubscriptionMapper(Session session) {
+        this.session = session;
+    }
+
+    @Override
+    public synchronized void delete(Subscription subscription) {
+        session.execute(QueryBuilder.delete().from(TABLE_NAME).where(eq(USER, subscription.getUser())).and(eq(MAILBOX, subscription.getMailbox())));
+    }
+
+    @Override
+    public Subscription findMailboxSubscriptionForUser(String user, String mailbox) {
+        ResultSet results = session.execute(select(MAILBOX).from(TABLE_NAME).where(eq(USER, user)).and(eq(MAILBOX, mailbox)));
+        return !results.isExhausted() ? new SimpleSubscription(user, mailbox) : null;
+    }
+
+    @Override
+    public List<Subscription> findSubscriptionsForUser(String user) {
+        Builder<Subscription> result = ImmutableList.<Subscription> builder();
+        Select query = select(MAILBOX).from(TABLE_NAME);
+        query.where(eq(USER, user));
+        query.allowFiltering();
+        for (Row row : session.execute(query)) {
+            result.add(new SimpleSubscription(user, row.getString(MAILBOX)));
+        }
+        return result.build();
+    }
+
+    @Override
+    public synchronized void save(Subscription subscription) {
+        Insert query = insertInto(TABLE_NAME).value(USER, subscription.getUser()).value(MAILBOX, subscription.getMailbox());
+        session.execute(query);
+    }
+
+    public List<SimpleSubscription> list() {
+        Builder<SimpleSubscription> result = ImmutableList.<SimpleSubscription> builder();
+        for (Row row : session.execute(select(FIELDS).from(TABLE_NAME))) {
+            result.add(new SimpleSubscription(row.getString(USER), row.getString(MAILBOX)));
+        }
+        return result.build();
+    }
+
+    @Override
+    public void endRequest() {
+        // nothing todo
+    }
+
+}
diff --git cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
new file mode 100644
index 0000000..6e803aa
--- /dev/null
+++ cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.    
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <!-- 
+      Mailbox Cassandra
+    -->
+    <bean id="cassandra-mailboxmanager" class="org.apache.james.mailbox.cassandra.CassandraMailboxManager" init-method="init">
+        <constructor-arg index="0" ref="cassandra-sessionMapperFactory"/>
+        <constructor-arg index="1" ref="authenticator"/>
+        <constructor-arg index="2" ref="cassandra-locker"/>
+    </bean>
+
+    <bean id ="cassandra-subscriptionManager" class="org.apache.james.mailbox.cassandra.CassandraSubscriptionManager">
+        <constructor-arg index="0" ref="cassandra-sessionMapperFactory"/>
+    </bean>
+
+    <bean id="cassandra-sessionMapperFactory" class="org.apache.james.mailbox.cassandra.CassandraMailboxSessionMapperFactory">
+        <constructor-arg index="0" ref="cassandra-uidProvider"/>
+        <constructor-arg index="1" ref="cassandra-modSeqProvider"/>
+        <constructor-arg index="2" ref="cassandra-session"/>
+    </bean>
+
+    <bean id="cassandra-uidProvider" class="org.apache.james.mailbox.cassandra.mail.CassandraUidProvider">
+        <constructor-arg index="0" ref="cassandra-session"/>
+    </bean>
+
+    <bean id="cassandra-modSeqProvider" class="org.apache.james.mailbox.cassandra.mail.CassandraModSeqProvider">
+        <constructor-arg index="0" ref="cassandra-session"/>
+    </bean>
+
+    <!--
+      The parameters are : the IP of a Cassendra cluster, the port, the keyspace and the replication factor
+      Default values are : localhost, 9042, apache_james and 1
+    -->
+    <bean id="cassandra-session" class="org.apache.james.mailbox.cassandra.CassandraSession">
+        <constructor-arg index="0" value="localhost"/>
+        <constructor-arg index="1" value="9042" type="int"/>
+        <constructor-arg index="2" value="apache_james"/>
+        <constructor-arg index="3" value="1" type="int"/>
+    </bean>
+
+    <alias name="jvm-locker" alias="cassandra-locker"/>
+
+</beans>
diff --git cassandra/src/reporting-site/site.xml cassandra/src/reporting-site/site.xml
new file mode 100644
index 0000000..d919164
--- /dev/null
+++ cassandra/src/reporting-site/site.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.    
+-->
+<project name="${project.name}">
+
+    <body>
+
+        <menu ref="parent" />
+        <menu ref="reports" />
+
+    </body>
+
+</project>
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java
new file mode 100644
index 0000000..b97315c
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java
@@ -0,0 +1,131 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra;
+
+import org.apache.commons.lang.NotImplementedException;
+import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.datastax.driver.core.Session;
+
+/**
+ * Class that will creates a single instance of Cassandra session.
+ */
+public final class CassandraClusterSingleton {
+    private final static String CLUSTER_IP = "localhost";
+    private final static int CLUSTER_PORT_TEST = 9142;
+    private final static String KEYSPACE_NAME = "apache_james";
+    private final static int DEFAULT_REPLICATION_FACTOR = 1;
+
+    private static final Logger LOG = LoggerFactory.getLogger(CassandraClusterSingleton.class);
+    private static CassandraClusterSingleton cluster = null;
+    private CassandraSession session;
+
+    /**
+     * Builds a MiniCluster instance.
+     * 
+     * @return the {@link CassandraClusterSingleton} instance
+     * @throws RuntimeException
+     */
+    public static synchronized CassandraClusterSingleton build() throws RuntimeException {
+        LOG.info("Retrieving cluster instance.");
+        if (cluster == null) {
+            cluster = new CassandraClusterSingleton();
+        }
+        return cluster;
+    }
+
+    private CassandraClusterSingleton() throws RuntimeException {
+       try {
+            EmbeddedCassandraServerHelper.startEmbeddedCassandra();
+            // Let Cassandra initialization before creating
+            // the session. Solve very fast computer tests run.
+            Thread.sleep(2000);
+            this.session = new CassandraSession(CLUSTER_IP, CLUSTER_PORT_TEST, KEYSPACE_NAME, DEFAULT_REPLICATION_FACTOR);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Return a configuration for the runnning MiniCluster.
+     * 
+     * @return
+     */
+    public Session getConf() {
+        return session;
+    }
+
+    /**
+     * Create a specific table.
+     * 
+     * @param tableName
+     *            the table name
+     */
+    public void ensureTable(String tableName) {
+        if (tableName.equals("mailbox")) {
+            session.execute("CREATE TABLE IF NOT EXISTS " + session.getLoggedKeyspace() + ".mailbox (" + "id uuid PRIMARY KEY," + "name text, namespace text," + "uidvalidity bigint," + "user text," + "path text" + ");");
+
+            session.execute("CREATE INDEX IF NOT EXISTS ON " + session.getLoggedKeyspace() + ".mailbox(path);");
+        } else if (tableName.equals("messageCounter")) {
+            session.execute("CREATE TABLE IF NOT EXISTS " + session.getLoggedKeyspace() + ".messageCounter (" + "mailboxId UUID PRIMARY KEY," + "nextUid bigint," + ");");
+        } else if (tableName.equals("mailboxCounters")) {
+            session.execute("CREATE TABLE IF NOT EXISTS " + session.getLoggedKeyspace() + ".mailboxCounters (" + "mailboxId UUID PRIMARY KEY," + "count counter," + "unseen counter," + "nextModSeq counter" + ");");
+        } else if (tableName.equals("message")) {
+            session.execute("CREATE TABLE IF NOT EXISTS " + session.getLoggedKeyspace() + ".message (" + "mailboxId UUID," + "uid bigint," + "internalDate timestamp," + "bodyStartOctet int," + "content blob," + "modSeq bigint," + "mediaType text," + "subType text," + "fullContentOctets int,"
+                    + "bodyOctets int," + "textualLineCount bigint," + "bodyContent blob," + "headerContent blob," + "flagAnswered boolean," + "flagDeleted boolean," + "flagDraft boolean," + "flagRecent boolean," + "flagSeen boolean," + "flagFlagged boolean," + "flagUser boolean,"
+                    + "PRIMARY KEY (mailboxId, uid)" + ");");
+        } else if (tableName.equals("subscription")) {
+            session.execute("CREATE TABLE IF NOT EXISTS " + session.getLoggedKeyspace() + ".subscription (" + "user text," + "mailbox text," + "PRIMARY KEY (mailbox, user)" + ");");
+        } else {
+            throw new NotImplementedException("We don't support the class " + tableName);
+        }
+    }
+
+    /**
+     * Ensure all tables
+     */
+    public void ensureAllTables() {
+        ensureTable("mailbox");
+        ensureTable("mailboxCounters");
+        ensureTable("message");
+        ensureTable("subscription");
+    }
+
+    /**
+     * Delete all rows from specified table.
+     * 
+     * @param tableName
+     */
+    public void clearTable(String tableName) {
+        session.execute("TRUNCATE " + tableName + ";");
+    }
+
+    /**
+     * Delete all rows for all tables.
+     */
+    public void clearAllTables() {
+        clearTable("mailbox");
+        clearTable("mailboxCounters");
+        clearTable("message");
+        clearTable("subscription");
+    }
+
+}
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerTest.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerTest.java
new file mode 100644
index 0000000..8ff72ed
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerTest.java
@@ -0,0 +1,90 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra;
+
+import org.apache.james.mailbox.AbstractMailboxManagerTest;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.cassandra.mail.CassandraModSeqProvider;
+import org.apache.james.mailbox.cassandra.mail.CassandraUidProvider;
+import org.apache.james.mailbox.cassandra.table.CassandraMailboxTable;
+import org.apache.james.mailbox.exception.BadCredentialsException;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.JVMMailboxPathLocker;
+import org.junit.After;
+import org.junit.Before;
+import org.slf4j.LoggerFactory;
+
+/**
+ * CassandraMailboxManagerTest that extends the StoreMailboxManagerTest.
+ * 
+ */
+public class CassandraMailboxManagerTest extends AbstractMailboxManagerTest {
+
+    private static final CassandraClusterSingleton CLUSTER = CassandraClusterSingleton.build();
+
+    /**
+     * Setup the mailboxManager.
+     * 
+     * @throws Exception
+     */
+    @Before
+    public void setup() throws Exception {
+        CLUSTER.ensureAllTables();
+        CLUSTER.clearAllTables();
+        createMailboxManager();
+    }
+
+    /**
+     * Close the system session and entityManagerFactory
+     * 
+     * @throws MailboxException
+     * @throws BadCredentialsException
+     */
+    @After
+    public void tearDown() throws Exception {
+        deleteAllMailboxes();
+        MailboxSession session = getMailboxManager().createSystemSession("test", LoggerFactory.getLogger("Test"));
+        session.close();
+    }
+
+    /*
+     * (non-Javadoc)i deve
+     * 
+     * @see org.apache.james.mailbox.MailboxManagerTest#createMailboxManager()
+     */
+    @Override
+    protected void createMailboxManager() throws MailboxException {
+        final CassandraUidProvider uidProvider = new CassandraUidProvider(CLUSTER.getConf());
+        final CassandraModSeqProvider modSeqProvider = new CassandraModSeqProvider(CLUSTER.getConf());
+        final CassandraMailboxSessionMapperFactory mapperFactory = new CassandraMailboxSessionMapperFactory(uidProvider, modSeqProvider, (CassandraSession) CLUSTER.getConf());
+
+        final CassandraMailboxManager manager = new CassandraMailboxManager(mapperFactory, null, new JVMMailboxPathLocker());
+        manager.init();
+
+        setMailboxManager(manager);
+
+        deleteAllMailboxes();
+    }
+
+    private void deleteAllMailboxes() throws BadCredentialsException, MailboxException {
+        MailboxSession session = getMailboxManager().createSystemSession("test", LoggerFactory.getLogger("Test"));
+        CLUSTER.clearTable(CassandraMailboxTable.TABLE_NAME);
+        session.close();
+    }
+}
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactoryTest.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactoryTest.java
new file mode 100644
index 0000000..b27999b
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactoryTest.java
@@ -0,0 +1,121 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.UUID;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.cassandra.mail.CassandraModSeqProvider;
+import org.apache.james.mailbox.cassandra.mail.CassandraUidProvider;
+import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.MessageMapper;
+import org.apache.james.mailbox.store.mail.ModSeqProvider;
+import org.apache.james.mailbox.store.mail.UidProvider;
+import org.apache.james.mailbox.store.user.SubscriptionMapper;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The MailboxSessionMapperFactory test.
+ * 
+ */
+public class CassandraMailboxSessionMapperFactoryTest {
+    private static final CassandraClusterSingleton CLUSTER = CassandraClusterSingleton.build();
+    private final static Logger LOG = LoggerFactory.getLogger(CassandraMailboxSessionMapperFactoryTest.class);
+
+    @Before
+    public void beforeMethod() {
+        CLUSTER.ensureAllTables();
+        CLUSTER.clearAllTables();
+    }
+
+    /**
+     * Test of createMessageMapper method, of class
+     * CassandraMailboxSessionMapperFactory.
+     */
+    @Test
+    public void testCreateMessageMapper() throws Exception {
+        LOG.info("createMessageMapper");
+        MailboxSession session = null;
+        CassandraMailboxSessionMapperFactory instance = new CassandraMailboxSessionMapperFactory(null, null, null);
+        MessageMapper<UUID> messageMapper = instance.createMessageMapper(session);
+        assertNotNull(messageMapper);
+        assertTrue(messageMapper instanceof MessageMapper);
+    }
+
+    /**
+     * Test of createMailboxMapper method, of class
+     * CassandraMailboxSessionMapperFactory.
+     */
+    @Test
+    public void testCreateMailboxMapper() throws Exception {
+        LOG.info("createMailboxMapper");
+        MailboxSession session = null;
+        CassandraMailboxSessionMapperFactory instance = new CassandraMailboxSessionMapperFactory(null, null, null);
+        MailboxMapper<UUID> mailboxMapper = instance.createMailboxMapper(session);
+        assertNotNull(mailboxMapper);
+        assertTrue(mailboxMapper instanceof MailboxMapper);
+    }
+
+    /**
+     * Test of createSubscriptionMapper method, of class
+     * CassandraMailboxSessionMapperFactory.
+     */
+    @Test
+    public void testCreateSubscriptionMapper() throws Exception {
+        LOG.info("createSubscriptionMapper");
+        MailboxSession session = null;
+        CassandraMailboxSessionMapperFactory instance = new CassandraMailboxSessionMapperFactory(null, null, null);
+        SubscriptionMapper subscriptionMapper = instance.createSubscriptionMapper(session);
+        assertNotNull(subscriptionMapper);
+        assertTrue(subscriptionMapper instanceof SubscriptionMapper);
+    }
+
+    /**
+     * Test of getModSeqProvider method, of class
+     * CassandraMailboxSessionMapperFactory.
+     */
+    @Test
+    public void testGetModSeqProvider() {
+        LOG.info("getModSeqProvider");
+        ModSeqProvider<UUID> expResult = new CassandraModSeqProvider(CLUSTER.getConf());
+        CassandraMailboxSessionMapperFactory instance = new CassandraMailboxSessionMapperFactory(null, expResult, null);
+        ModSeqProvider<UUID> result = instance.getModSeqProvider();
+        assertEquals(expResult, result);
+    }
+
+    /**
+     * Test of getUidProvider method, of class
+     * CassandraMailboxSessionMapperFactory.
+     */
+    @Test
+    public void testGetUidProvider() {
+        LOG.info("getUidProvider");
+        UidProvider<UUID> expResult = new CassandraUidProvider(CLUSTER.getConf());
+        CassandraMailboxSessionMapperFactory instance = new CassandraMailboxSessionMapperFactory((CassandraUidProvider) expResult, null, null);
+        UidProvider<UUID> result = instance.getUidProvider();
+        assertEquals(expResult, result);
+    }
+}
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperTest.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperTest.java
new file mode 100644
index 0000000..862d2fe
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperTest.java
@@ -0,0 +1,240 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra.mail;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.exception.MailboxNotFoundException;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.datastax.driver.core.Session;
+
+/**
+ * CassandraMailboxMapper unit tests.
+ * 
+ */
+public class CassandraMailboxMapperTest {
+
+    private static final Logger LOG = LoggerFactory.getLogger(CassandraMailboxMapperTest.class);
+    public static final CassandraClusterSingleton CLUSTER = CassandraClusterSingleton.build();
+    private static CassandraMailboxMapper mapper;
+    private static List<SimpleMailbox<UUID>> mailboxList;
+    private static List<MailboxPath> pathsList;
+    private static final int NAMESPACES = 5;
+    private static final int USERS = 5;
+    private static final int MAILBOX_NO = 5;
+    private static final char SEPARATOR = '%';
+    private Session session;
+
+    @Before
+    public void setUp() throws Exception {
+        CLUSTER.ensureAllTables();
+        CLUSTER.clearAllTables();
+        session = CLUSTER.getConf();
+        fillMailboxList();
+        mapper = new CassandraMailboxMapper(session);
+        for (SimpleMailbox<UUID> mailbox : mailboxList) {
+            mapper.save(mailbox);
+        }
+    }
+
+    /**
+     * Test an ordered scenario with list, delete... methods.
+     * 
+     * @throws Exception
+     */
+    @Test
+    public void testMailboxMapperScenario() throws Exception {
+        testFindMailboxByPath();
+        testFindMailboxWithPathLike();
+        testList();
+        testSave();
+        testDelete();
+        testHasChildren();
+        // testDeleteAllMemberships(); // Ignore this test
+    }
+
+    /**
+     * Test of findMailboxByPath method, of class CassandraMailboxMapper.
+     */
+    private void testFindMailboxByPath() throws Exception {
+        LOG.info("findMailboxByPath");
+        SimpleMailbox<UUID> mailbox;
+        for (MailboxPath path : pathsList) {
+            LOG.info("Searching for " + path);
+            mailbox = (SimpleMailbox<UUID>) mapper.findMailboxByPath(path);
+            assertEquals(path, new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName()));
+        }
+    }
+
+    /**
+     * Test of findMailboxWithPathLike method, of class CassandraMailboxMapper.
+     */
+    private void testFindMailboxWithPathLike() throws Exception {
+        LOG.info("findMailboxWithPathLike");
+        MailboxPath path = pathsList.get(pathsList.size() / 2);
+
+        List<Mailbox<UUID>> result = mapper.findMailboxWithPathLike(path);
+        assertEquals(1, result.size());
+
+        int start = 3;
+        int end = 7;
+        MailboxPath newPath;
+
+        for (int i = start; i < end; i++) {
+            newPath = new MailboxPath(path);
+            newPath.setName(i + newPath.getName() + " " + i);
+            // test for paths with null user
+            if (i % 2 == 0) {
+                newPath.setUser(null);
+            }
+            addMailbox(new SimpleMailbox<UUID>(newPath, 1234));
+        }
+        result = mapper.findMailboxWithPathLike(path);
+        assertEquals(end - start + 1, result.size());
+    }
+
+    /**
+     * Test of list method, of class CassandraMailboxMapper.
+     */
+    private void testList() throws Exception {
+        LOG.info("list");
+        List<Mailbox<UUID>> result = mapper.list();
+        assertEquals(mailboxList.size(), result.size());
+
+    }
+
+    /**
+     * Test of save method and list method, of class CassandraMailboxMapper.
+     */
+    private void testSave() throws Exception {
+        LOG.info("save and mailboxFromResult");
+        final List<Mailbox<UUID>> mailboxes = mapper.list();
+        final SimpleMailbox<UUID> mlbx = mailboxList.get(mailboxList.size() / 2);
+        Mailbox<UUID> newValue = mailboxes.get(0);
+
+        for (Mailbox<UUID> mailbox : mailboxes) {
+            if (mlbx.getMailboxId().equals(mailbox.getMailboxId())) {
+                newValue = mailbox;
+            }
+        }
+
+        assertEquals(mlbx, newValue);
+        assertEquals(mlbx.getUser(), newValue.getUser());
+        assertEquals(mlbx.getName(), newValue.getName());
+        assertEquals(mlbx.getNamespace(), newValue.getNamespace());
+        assertEquals(mlbx.getMailboxId(), newValue.getMailboxId());
+    }
+
+    /**
+     * Test of delete method, of class CassandraMailboxMapper.
+     */
+    private void testDelete() throws Exception {
+        LOG.info("delete");
+        // delete last 5 mailboxes from mailboxList
+        int offset = 5;
+        int notFoundCount = 0;
+
+        Iterator<SimpleMailbox<UUID>> iterator = mailboxList.subList(mailboxList.size() - offset, mailboxList.size()).iterator();
+
+        while (iterator.hasNext()) {
+            SimpleMailbox<UUID> mailbox = iterator.next();
+            mapper.delete(mailbox);
+            iterator.remove();
+            MailboxPath path = new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
+            pathsList.remove(path);
+            LOG.info("Removing mailbox: {}", path);
+            try {
+                mapper.findMailboxByPath(path);
+            } catch (MailboxNotFoundException e) {
+                LOG.info("Succesfully removed {}", mailbox);
+                notFoundCount++;
+            }
+        }
+        assertEquals(offset, notFoundCount);
+        assertEquals(mailboxList.size(), mapper.list().size());
+    }
+
+    /**
+     * Test of hasChildren method, of class CassandraMailboxMapper.
+     */
+    private void testHasChildren() throws Exception {
+        LOG.info("hasChildren");
+        String oldName;
+        for (MailboxPath path : pathsList) {
+            final SimpleMailbox<UUID> mailbox = new SimpleMailbox<UUID>(path, 12455);
+            oldName = mailbox.getName();
+            if (path.getUser().equals("user3")) {
+                mailbox.setName("test");
+            }
+            boolean result = mapper.hasChildren(mailbox, SEPARATOR);
+            mailbox.setName(oldName);
+            if (path.getUser().equals("user3")) {
+                assertTrue(result);
+            } else {
+                assertFalse(result);
+            }
+
+        }
+    }
+
+    private static void fillMailboxList() {
+        mailboxList = new ArrayList<SimpleMailbox<UUID>>();
+        pathsList = new ArrayList<MailboxPath>();
+        MailboxPath path;
+        String name;
+        for (int i = 0; i < NAMESPACES; i++) {
+            for (int j = 0; j < USERS; j++) {
+                for (int k = 0; k < MAILBOX_NO; k++) {
+                    if (j == 3) {
+                        name = "test" + SEPARATOR + "subbox" + k;
+                    } else {
+                        name = "mailbox" + k;
+                    }
+                    path = new MailboxPath("namespace" + i, "user" + j, name);
+                    pathsList.add(path);
+                    mailboxList.add(new SimpleMailbox<UUID>(path, 13));
+                }
+            }
+        }
+        LOG.info("Created test case with {} mailboxes and {} paths", mailboxList.size(), pathsList.size());
+    }
+
+    private void addMailbox(SimpleMailbox<UUID> mailbox) throws MailboxException {
+        mailboxList.add(mailbox);
+        pathsList.add(new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName()));
+        mapper.save(mailbox);
+        LOG.info("Added new mailbox: {} paths: {}", mailboxList.size(), pathsList.size());
+    }
+}
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
new file mode 100644
index 0000000..81648ee
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
@@ -0,0 +1,208 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra.mail;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+import java.util.UUID;
+
+import javax.mail.Flags;
+import javax.mail.internet.SharedInputStream;
+import javax.mail.util.SharedByteArrayInputStream;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
+import org.apache.james.mailbox.mock.MockMailboxSession;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMessage;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.datastax.driver.core.Session;
+
+/**
+ * Unit tests for CassandraMessageMapper.
+ * 
+ */
+public class CassandraMessageMapperTest {
+
+    private static final Logger LOG = LoggerFactory.getLogger(CassandraMailboxMapperTest.class);
+    public static final CassandraClusterSingleton CLUSTER = CassandraClusterSingleton.build();
+    private static CassandraUidProvider uidProvider;
+    private static CassandraModSeqProvider modSeqProvider;
+    private static CassandraMessageMapper messageMapper;
+    private static final List<MailboxPath> MBOX_PATHS = new ArrayList<MailboxPath>();
+    private static final List<Mailbox<UUID>> MBOXES = new ArrayList<Mailbox<UUID>>();
+    private static final List<Message<UUID>> MESSAGE_NO = new ArrayList<Message<UUID>>();
+    private static final int COUNT = 5;
+    private static Session session;
+    /*
+     * we mock a simple message content
+     */
+    private static final String messageTemplate = "Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)\n" + "From: Fred Foobar <foobar@Blurdybloop.COM>\n" + "Subject: Test 02\n" + "To: mooch@owatagu.siam.edu\n" + "Message-Id: <B27397-0100000@Blurdybloop.COM>\n" + "MIME-Version: 1.0\n"
+            + "Content-Type: TEXT/PLAIN; CHARSET=US-ASCII\n" + "\n" + "Test\n" + "\n.";
+
+    private static SharedInputStream content = new SharedByteArrayInputStream(messageTemplate.getBytes());
+
+    @Before
+    public void setUp() throws Exception {
+        CLUSTER.ensureAllTables();
+        CLUSTER.clearAllTables();
+        session = CLUSTER.getConf();
+        uidProvider = new CassandraUidProvider(session);
+        modSeqProvider = new CassandraModSeqProvider(session);
+        generateTestData();
+        final MailboxSession mailboxSession = new MockMailboxSession("ieugen");
+        messageMapper = new CassandraMessageMapper(session, uidProvider, modSeqProvider, mailboxSession);
+        for (int i = 0; i < MESSAGE_NO.size(); i++) {
+            messageMapper.add(MBOXES.get(1), MESSAGE_NO.get(i));
+        }
+    }
+
+    public static void generateTestData() {
+        final Random random = new Random();
+        MailboxPath mboxPath;
+        final PropertyBuilder propBuilder = new PropertyBuilder();
+        SimpleMailbox<UUID> mailbox;
+
+        for (int i = 0; i < COUNT; i++) {
+            if (i % 2 == 0) {
+                mboxPath = new MailboxPath("gsoc", "ieugen" + i, "INBOX");
+            } else {
+                mboxPath = new MailboxPath("gsoc", "ieugen" + i, "INBOX.box" + i);
+            }
+            MBOX_PATHS.add(mboxPath);
+            mailbox = new SimpleMailbox<UUID>(MBOX_PATHS.get(i), random.nextLong());
+            mailbox.setMailboxId(UUID.randomUUID());
+            MBOXES.add(mailbox);
+            propBuilder.setProperty("gsoc", "prop" + i, "value");
+        }
+        propBuilder.setMediaType("text");
+        propBuilder.setSubType("html");
+        propBuilder.setTextualLineCount(2L);
+
+        SimpleMessage<UUID> myMsg;
+        final Flags flags = new Flags(Flags.Flag.RECENT);
+        final Date today = new Date();
+
+        for (int i = 0; i < COUNT * 2; i++) {
+            myMsg = new SimpleMessage<UUID>(today, messageTemplate.getBytes().length, messageTemplate.getBytes().length - 20, content, flags, propBuilder, MBOXES.get(1).getMailboxId());
+            if (i == COUNT * 2 - 1) {
+                flags.add(Flags.Flag.SEEN);
+                flags.remove(Flags.Flag.RECENT);
+                myMsg.setFlags(flags);
+            }
+            MESSAGE_NO.add(myMsg);
+        }
+    }
+
+    /**
+     * Test an ordered scenario with count, find, add... methods.
+     * 
+     * @throws Exception
+     */
+    @Test
+    public void testMessageMapperScenario() throws Exception {
+        testCountMessagesInMailbox();
+        testCountUnseenMessagesInMailbox();
+        testFindFirstUnseenMessageUid();
+        testFindRecentMessageUidsInMailbox();
+        testAdd();
+        testGetLastUid();
+        testGetHighestModSeq();
+    }
+
+    /**
+     * Test of countMessagesInMailbox method, of class CassandraMessageMapper.
+     */
+    private void testCountMessagesInMailbox() throws Exception {
+        LOG.info("countMessagesInMailbox");
+        long messageCount = messageMapper.countMessagesInMailbox(MBOXES.get(1));
+        assertEquals(MESSAGE_NO.size(), messageCount);
+    }
+
+    /**
+     * Test of countUnseenMessagesInMailbox method, of class
+     * CassandraMessageMapper.
+     */
+    private void testCountUnseenMessagesInMailbox() throws Exception {
+        LOG.info("countUnseenMessagesInMailbox");
+        long unseen = messageMapper.countUnseenMessagesInMailbox(MBOXES.get(1));
+        assertEquals(MESSAGE_NO.size() - 1, unseen);
+    }
+
+    /**
+     * Test of findFirstUnseenMessageUid method, of class
+     * CassandraMessageMapper.
+     */
+    private void testFindFirstUnseenMessageUid() throws Exception {
+        LOG.info("findFirstUnseenMessageUid");
+        final long uid = messageMapper.findFirstUnseenMessageUid(MBOXES.get(1));
+        assertEquals(1, uid);
+    }
+
+    /**
+     * Test of findRecentMessageUidsInMailbox method, of class
+     * CassandraMessageMapper.
+     */
+    private void testFindRecentMessageUidsInMailbox() throws Exception {
+        LOG.info("findRecentMessageUidsInMailbox");
+        List<Long> recentMessages = messageMapper.findRecentMessageUidsInMailbox(MBOXES.get(1));
+        assertEquals(MESSAGE_NO.size() - 1, recentMessages.size());
+    }
+
+    /**
+     * Test of add method, of class CassandraMessageMapper.
+     */
+    private void testAdd() throws Exception {
+        LOG.info("add");
+        // The tables should be deleted every time the tests run.
+        long msgCount = messageMapper.countMessagesInMailbox(MBOXES.get(1));
+        LOG.info(msgCount + " " + MESSAGE_NO.size());
+        assertEquals(MESSAGE_NO.size(), msgCount);
+    }
+
+    /**
+     * Test of getLastUid method, of class CassandraMessageMapper.
+     */
+    private void testGetLastUid() throws Exception {
+        LOG.info("getLastUid");
+        long lastUid = messageMapper.getLastUid(MBOXES.get(1));
+        assertEquals(MESSAGE_NO.size(), lastUid);
+    }
+
+    /**
+     * Test of getHighestModSeq method, of class CassandraMessageMapper.
+     */
+    private void testGetHighestModSeq() throws Exception {
+        LOG.info("getHighestModSeq");
+        long highestModSeq = messageMapper.getHighestModSeq(MBOXES.get(1));
+        assertEquals(MESSAGE_NO.size(), highestModSeq);
+    }
+}
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java
new file mode 100644
index 0000000..a89ac14
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java
@@ -0,0 +1,163 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra.mail;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.datastax.driver.core.Session;
+
+/**
+ * Unit tests for UidProvider and ModSeqProvider.
+ * 
+ */
+public class CassandraUidAndModSeqProviderTest {
+
+    private static final Logger LOG = LoggerFactory.getLogger(CassandraUidAndModSeqProviderTest.class);
+    private static final CassandraClusterSingleton CLUSTER = CassandraClusterSingleton.build();
+    private static Session session;
+    private static CassandraUidProvider uidProvider;
+    private static CassandraModSeqProvider modSeqProvider;
+    private static CassandraMailboxMapper mapper;
+    private static List<SimpleMailbox<UUID>> mailboxList;
+    private static List<MailboxPath> pathsList;
+    private static final int NAMESPACES = 5;
+    private static final int USERS = 5;
+    private static final int MAILBOX_NO = 5;
+    private static final char SEPARATOR = '%';
+
+    @Before
+    public void setUpClass() throws Exception {
+        CLUSTER.ensureAllTables();
+        CLUSTER.ensureAllTables();
+        session = CLUSTER.getConf();
+        uidProvider = new CassandraUidProvider(session);
+        modSeqProvider = new CassandraModSeqProvider(session);
+        mapper = new CassandraMailboxMapper(session);
+        fillMailboxList();
+        for (SimpleMailbox<UUID> mailbox : mailboxList) {
+            mapper.save(mailbox);
+        }
+    }
+
+    private static void fillMailboxList() {
+        mailboxList = new ArrayList<SimpleMailbox<UUID>>();
+        pathsList = new ArrayList<MailboxPath>();
+        MailboxPath path;
+        String name;
+        for (int i = 0; i < NAMESPACES; i++) {
+            for (int j = 0; j < USERS; j++) {
+                for (int k = 0; k < MAILBOX_NO; k++) {
+                    if (j == 3) {
+                        name = "test" + SEPARATOR + "subbox" + k;
+                    } else {
+                        name = "mailbox" + k;
+                    }
+                    path = new MailboxPath("namespace" + i, "user" + j, name);
+                    pathsList.add(path);
+                    mailboxList.add(new SimpleMailbox<UUID>(path, 13));
+                }
+            }
+        }
+
+        LOG.info("Created test case with {} mailboxes and {} paths", mailboxList.size(), pathsList.size());
+    }
+
+    /**
+     * Test of lastUid method, of class CassandraUidProvider.
+     */
+    @Test
+    public void testLastUid() throws Exception {
+        LOG.info("lastUid");
+        final MailboxPath path = new MailboxPath("gsoc", "ieugen", "Trash");
+        final SimpleMailbox<UUID> newBox = new SimpleMailbox<UUID>(path, 1234);
+        mapper.save(newBox);
+        mailboxList.add(newBox);
+        pathsList.add(path);
+
+        final long result = uidProvider.lastUid(null, newBox);
+        assertEquals(0, result);
+        for (int i = 1; i < 10; i++) {
+            final long uid = uidProvider.nextUid(null, newBox);
+            assertEquals(uid, uidProvider.lastUid(null, newBox));
+        }
+    }
+
+    /**
+     * Test of nextUid method, of class CassandraUidProvider.
+     */
+    @Test
+    public void testNextUid() throws Exception {
+        LOG.info("nextUid");
+        final SimpleMailbox<UUID> mailbox = mailboxList.get(mailboxList.size() / 2);
+        final long lastUid = uidProvider.lastUid(null, mailbox);
+        long result;
+        for (int i = (int) lastUid + 1; i < (lastUid + 10); i++) {
+            result = uidProvider.nextUid(null, mailbox);
+            assertEquals(i, result);
+        }
+    }
+
+    /**
+     * Test of highestModSeq method, of class CassandraModSeqProvider.
+     */
+    @Test
+    public void testHighestModSeq() throws Exception {
+        LOG.info("highestModSeq");
+        LOG.info("lastUid");
+        MailboxPath path = new MailboxPath("gsoc", "ieugen", "Trash");
+        SimpleMailbox<UUID> newBox = new SimpleMailbox<UUID>(path, 1234);
+        mapper.save(newBox);
+        mailboxList.add(newBox);
+        pathsList.add(path);
+
+        long result = modSeqProvider.highestModSeq(null, newBox);
+        assertEquals(0, result);
+        for (int i = 1; i < 10; i++) {
+            long uid = modSeqProvider.nextModSeq(null, newBox);
+            assertEquals(uid, modSeqProvider.highestModSeq(null, newBox));
+        }
+    }
+
+    /**
+     * Test of nextModSeq method, of class CassandraModSeqProvider.
+     */
+    @Test
+    public void testNextModSeq() throws Exception {
+        LOG.info("nextModSeq");
+        final SimpleMailbox<UUID> mailbox = mailboxList.get(mailboxList.size() / 2);
+        final long lastUid = modSeqProvider.highestModSeq(null, mailbox);
+        long result;
+        for (int i = (int) lastUid + 1; i < (lastUid + 10); i++) {
+            result = modSeqProvider.nextModSeq(null, mailbox);
+            assertEquals(i, result);
+        }
+    }
+}
diff --git cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java
new file mode 100644
index 0000000..dde0ece
--- /dev/null
+++ cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java
@@ -0,0 +1,178 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.cassandra.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
+import org.apache.james.mailbox.store.user.model.Subscription;
+import org.apache.james.mailbox.store.user.model.impl.SimpleSubscription;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.datastax.driver.core.Session;
+
+/**
+ * Runs tests for SubscriptionMapper.
+ * 
+ */
+public class CassandraSubscriptionMapperTest {
+
+    private static final Logger LOG = LoggerFactory.getLogger(CassandraSubscriptionMapperTest.class);
+    private static final CassandraClusterSingleton CLUSTER = CassandraClusterSingleton.build();
+    private static Session session;
+    private static CassandraSubscriptionMapper mapper;
+    private static Map<String, List<SimpleSubscription>> subscriptionList;
+    private static final int USERS = 5;
+    private static final int MAILBOX_NO = 5;
+
+    @Before
+    public void setUp() throws Exception {
+        CLUSTER.ensureAllTables();
+        CLUSTER.clearAllTables();
+        session = CLUSTER.getConf();
+        mapper = new CassandraSubscriptionMapper(session);
+        fillSubscriptionList();
+    }
+
+    private static void fillSubscriptionList() {
+        LOG.info("Creating subscription list");
+        SimpleSubscription subscription;
+        String user, mailbox;
+        subscriptionList = new HashMap<String, List<SimpleSubscription>>();
+        for (int i = 0; i < USERS; i++) {
+            user = "user" + i;
+            final List<SimpleSubscription> mailboxes = new ArrayList<SimpleSubscription>();
+            subscriptionList.put(user, mailboxes);
+
+            for (int j = 0; j < MAILBOX_NO; j++) {
+                if (j == 0) {
+                    mailbox = "INBOX";
+                } else {
+                    mailbox = "BOX" + j;
+                }
+                if ((i % 2 == 0) && (j > 0)) {
+                    continue;
+                }
+                subscription = new SimpleSubscription(user, mailbox);
+                mailboxes.add(subscription);
+                mapper.save(subscription);
+                LOG.info("Adding subscription " + subscription);
+            }
+        }
+    }
+
+    /**
+     * Test of findMailboxSubscriptionForUser method, of class
+     * CassandraSubscriptionMapper.
+     */
+    @Test
+    public void testFindMailboxSubscriptionForUser() throws Exception {
+        LOG.info("findMailboxSubscriptionForUser");
+
+        final SimpleSubscription fake1 = new SimpleSubscription("user1", "FAKEBOX");
+        final SimpleSubscription fake2 = new SimpleSubscription("fakeUser", "INBOX");
+
+        for (String user : subscriptionList.keySet()) {
+            LOG.info("Searching for all subscriptions for user:{}", user);
+            for (SimpleSubscription subscription : subscriptionList.get(user)) {
+                final Subscription result = mapper.findMailboxSubscriptionForUser(user, subscription.getMailbox());
+                assertEquals(subscription.getMailbox(), result.getMailbox());
+                assertEquals(subscription.getUser(), result.getUser());
+            }
+        }
+        assertNull(mapper.findMailboxSubscriptionForUser(fake1.getUser(), fake1.getMailbox()));
+        assertNull(mapper.findMailboxSubscriptionForUser(fake2.getUser(), fake2.getMailbox()));
+    }
+
+    /**
+     * Test of save method, of class CassandraSubscriptionMapper.
+     */
+    @Test
+    public void testSave() throws Exception {
+        LOG.info("save");
+        final List<SimpleSubscription> subscriptions = mapper.list();
+        for (String user : subscriptionList.keySet()) {
+            for (Subscription subscription : subscriptionList.get(user)) {
+                assertTrue(containSubscription(subscriptions, subscription));
+            }
+        }
+    }
+
+    /**
+     * Test of findSubscriptionsForUser method, of class
+     * CassandraSubscriptionMapper.
+     */
+    @Test
+    public void testFindSubscriptionsForUser() throws Exception {
+        LOG.info("findSubscriptionsForUser");
+        final SimpleSubscription fake2 = new SimpleSubscription("fakeUser", "INBOX");
+        for (String user : subscriptionList.keySet()) {
+            LOG.info("Searching for all subscriptions for user: " + user);
+            final List<Subscription> found = mapper.findSubscriptionsForUser(user);
+            assertEquals(subscriptionList.get(user).size(), found.size());
+            // TODO: patch Subscription to implement equals
+            // assertTrue(subscriptionList.get(user).containsAll(foundSubscriptions));
+            // assertTrue(foundSubscriptions.containsAll(subscriptionList.get(user)));
+            // assertFalse(foundSubscriptions.contains(fake1));
+            // assertFalse(foundSubscriptions.contains(fake2));
+        }
+        // TODO: check what value we should return in case of no subscriptions:
+        // null or empty list
+        assertEquals(mapper.findSubscriptionsForUser(fake2.getMailbox()).size(), 0);
+
+    }
+
+    /**
+     * Test of delete method, of class CassandraSubscriptionMapper.
+     */
+    @Test
+    public void testDelete() throws Exception {
+        LOG.info("delete");
+        for (String user : subscriptionList.keySet()) {
+            LOG.info("Deleting subscriptions for user: " + user);
+            for (SimpleSubscription subscription : subscriptionList.get(user)) {
+                LOG.info("Deleting subscription : " + subscription);
+                mapper.delete(subscription);
+                assertFalse(containSubscription(mapper.list(), subscription));
+            }
+        }
+        fillSubscriptionList();
+    }
+
+    private boolean containSubscription(List<SimpleSubscription> subscriptions, Subscription subscription) {
+        for (SimpleSubscription s : subscriptions) {
+            if (subscription.getMailbox().equals(s.getMailbox()) && subscription.getUser().equals(s.getUser())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}
diff --git pom.xml pom.xml
index 8fd084d..aad4632 100644
--- pom.xml
+++ pom.xml
@@ -52,6 +52,7 @@
         <module>api</module>
         <module>caching</module>
         <module>hbase</module>
+        <module>cassandra</module>
         <module>jcr</module>
         <module>jpa</module>
         <module>lucene</module>
@@ -114,10 +115,12 @@
         <geronimo-activation-spec.version>1.1</geronimo-activation-spec.version>
         <geronimo-javamail-mail.version>1.8.3</geronimo-javamail-mail.version>
         <apache-mailet.version>2.5.0</apache-mailet.version>
-        <slf4j.version>1.7.2</slf4j.version>
+        <slf4j.version>1.7.7</slf4j.version>
         <junit.version>4.11</junit.version>
         <jasypt.version>1.9.0</jasypt.version>
         <guava.version>13.0</guava.version>
+        <cassandra-driver-core.version>2.0.1</cassandra-driver-core.version>
+        <cassandra-unit.version>2.0.2.1</cassandra-unit.version>
     </properties>
 
     <dependencyManagement>
@@ -191,7 +194,13 @@
                 <artifactId>apache-james-mailbox-hbase</artifactId>
                 <version>${project.version}</version>
             </dependency>
-            <dependency>
+           <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>apache-james-mailbox-cassandra</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+
+           <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-tool</artifactId>
                 <version>${project.version}</version>
@@ -502,7 +511,6 @@
                 <artifactId>spring-orm</artifactId>
                 <version>${spring.version}</version>
             </dependency>
-
             <!--
                 END SPRING
             -->
@@ -514,6 +522,16 @@
                 <groupId>org.apache.hbase</groupId>
                 <artifactId>hbase</artifactId>
                 <version>${hbase.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.codehaus.jackson</groupId>
+                        <artifactId>jackson-core-asl</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.codehaus.jackson</groupId>
+                        <artifactId>jackson-mapper-asl</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.apache.hbase</groupId>
@@ -536,7 +554,7 @@
             <!--
                 END HBASE/HADOOP
             -->
-        </dependencies>
+       </dependencies>
     </dependencyManagement>
 
     <build>
