james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [1/3] james-project git commit: MAILBOX-268 Store attachments when storing a mail
Date Thu, 02 Jun 2016 07:12:48 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 0bfab26e5 -> be69ed1cf


http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMailboxManagerAttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMailboxManagerAttachmentTest.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMailboxManagerAttachmentTest.java
new file mode 100644
index 0000000..bde8984
--- /dev/null
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMailboxManagerAttachmentTest.java
@@ -0,0 +1,197 @@
+/****************************************************************
+ * 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.store;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.mail.Flags;
+import javax.mail.Flags.Flag;
+
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageManager;
+import org.apache.james.mailbox.mock.MockMailboxSession;
+import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.model.MessageRange;
+import org.apache.james.mailbox.store.mail.AttachmentMapper;
+import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.MessageMapper;
+import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
+import org.apache.james.mailbox.store.mail.model.AttachmentId;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public abstract class AbstractMailboxManagerAttachmentTest {
+    private static final String USERNAME = "user@domain.tld";
+    private static final Date SUN_SEP_9TH_2001 = new Date(1000000000000L);
+
+    private MailboxManager mailboxManager;
+    private MessageMapper messageMapper;
+    private MailboxMapper mailboxMapper;
+    private MailboxPath inboxPath;
+    private MailboxSession mailboxSession;
+    private Mailbox inbox;
+    private MessageManager inboxMessageManager;
+    private AttachmentMapper attachmentMapper;
+
+    protected abstract MailboxManager getMailboxManager();
+    protected abstract MailboxManager getParseFailingMailboxManager();
+    protected abstract MailboxSessionMapperFactory getMailboxSessionMapperFactory();
+    
+    protected void clean() {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        mailboxSession = new MockMailboxSession(USERNAME);
+        messageMapper = getMailboxSessionMapperFactory().getMessageMapper(mailboxSession);
+        mailboxMapper = getMailboxSessionMapperFactory().getMailboxMapper(mailboxSession);
+        inboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, "INBOX");
+        mailboxManager = getMailboxManager();
+        mailboxManager.createMailbox(inboxPath, mailboxSession);
+        inbox = mailboxMapper.findMailboxByPath(inboxPath);
+        inboxMessageManager = mailboxManager.getMailbox(inboxPath, mailboxSession);
+        attachmentMapper = getMailboxSessionMapperFactory().getAttachmentMapper(mailboxSession);
+    }
+
+    @After
+    public void tearDown() {
+        clean();
+    }
+
+    @Test
+    public void appendMessageShouldStoreWithoutAttachmentWhenMailWithoutAttachment() throws
Exception {
+        String mail = "Subject: Test\n\nBody";
+        InputStream mailInputStream = new ByteArrayInputStream(mail.getBytes());
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        assertThat(messages.next().getAttachmentsIds()).isEmpty();
+    }
+
+    @Test
+    public void appendMessageShouldStoreAttachmentWhenMailWithOneAttachment() throws Exception
{
+        InputStream mailInputStream = ClassLoader.getSystemResourceAsStream("eml/oneAttachmentAndSomeInlined.eml");
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        assertThat(messages.next().getAttachmentsIds()).hasSize(1);
+    }
+
+    @Test
+    public void appendMessageShouldStoreARetrievableAttachmentWhenMailWithOneAttachment()
throws Exception {
+        InputStream mailInputStream = ClassLoader.getSystemResourceAsStream("eml/oneAttachmentAndSomeInlined.eml");
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        List<AttachmentId> attachmentsIds = messages.next().getAttachmentsIds();
+        assertThat(attachmentsIds).hasSize(1);
+        assertThat(attachmentMapper.getAttachment(attachmentsIds.get(0)).getStream())
+            .hasContentEqualTo(ClassLoader.getSystemResourceAsStream("eml/gimp.png"));
+    }
+
+    @Test
+    public void appendMessageShouldStoreAttachmentsWhenMailWithTwoAttachment() throws Exception
{
+        InputStream mailInputStream = ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml");
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        assertThat(messages.next().getAttachmentsIds()).hasSize(2);
+    }
+
+    @Test
+    public void appendMessageShouldStoreTwoRetrievableAttachmentsWhenMailWithTwoAttachment()
throws Exception {
+        InputStream mailInputStream = ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml");
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        List<AttachmentId> attachmentsIds = messages.next().getAttachmentsIds();
+        assertThat(attachmentsIds).hasSize(2);
+        assertThat(attachmentMapper.getAttachment(attachmentsIds.get(0)).getStream())
+            .hasContentEqualTo(ClassLoader.getSystemResourceAsStream("eml/4037_014.jpg"));
+        assertThat(attachmentMapper.getAttachment(attachmentsIds.get(1)).getStream())
+            .hasContentEqualTo(ClassLoader.getSystemResourceAsStream("eml/4037_015.jpg"));
+    }
+
+    @Test
+    public void appendMessageShouldStoreEmbeddedMailAsAttachmentWhenMailWithEmbeddedAttachment()
throws Exception {
+        InputStream mailInputStream = ClassLoader.getSystemResourceAsStream("eml/embeddedAttachmentWithAttachment.eml");
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        assertThat(messages.next().getAttachmentsIds()).hasSize(1);
+    }
+
+    @Test
+    public void appendMessageShouldNotStoreAnyAttachmentWhenUnparsableMail() throws Exception
{
+        MailboxManager parseFailingMailboxManager = getParseFailingMailboxManager();
+        MessageManager parseFailingInboxMessageManager = parseFailingMailboxManager.getMailbox(inboxPath,
mailboxSession);
+        InputStream mailInputStream = new ByteArrayInputStream("content".getBytes());
+        parseFailingInboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001,
mailboxSession, true, new Flags(Flag.RECENT));
+
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        List<AttachmentId> attachmentsIds = messages.next().getAttachmentsIds();
+        assertThat(attachmentsIds).hasSize(0);
+    }
+
+    @Test
+    public void appendMessageShouldStoreOnceWhenDuplicateAttachment() throws Exception {
+        InputStream mailInputStream = ClassLoader.getSystemResourceAsStream("eml/oneAttachmentAndSomeInlined.eml");
+        InputStream mailInputStream2 = ClassLoader.getSystemResourceAsStream("eml/oneAttachmentAndSomeInlined.eml");
+        String user2 = "user2@domain.tld";
+        MailboxSession user2MailboxSession = new MockMailboxSession(user2);
+        MessageMapper user2MessageMapper = getMailboxSessionMapperFactory().getMessageMapper(user2MailboxSession);
+        MailboxMapper user2MailboxMapper = getMailboxSessionMapperFactory().getMailboxMapper(user2MailboxSession);
+        MailboxPath user2InboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user2,
"INBOX");
+        mailboxManager.createMailbox(user2InboxPath, user2MailboxSession);
+        Mailbox user2Inbox = user2MailboxMapper.findMailboxByPath(user2InboxPath);
+        MessageManager user2InboxMessageManager = mailboxManager.getMailbox(user2InboxPath,
user2MailboxSession);
+
+        inboxMessageManager.appendMessage(mailInputStream, SUN_SEP_9TH_2001, mailboxSession,
true, new Flags(Flags.Flag.RECENT));
+        user2InboxMessageManager.appendMessage(mailInputStream2, SUN_SEP_9TH_2001, user2MailboxSession,
true, new Flags(Flags.Flag.RECENT));
+
+        Iterator<MailboxMessage> messages = messageMapper.findInMailbox(inbox, MessageRange.all(),
FetchType.Full, 1);
+        Iterator<MailboxMessage> user2Messages = user2MessageMapper.findInMailbox(user2Inbox,
MessageRange.all(), FetchType.Full, 1);
+        assertThat(messages.hasNext()).isTrue();
+        List<AttachmentId> attachmentsIds = messages.next().getAttachmentsIds();
+        assertThat(attachmentsIds).hasSize(1);
+        assertThat(user2Messages.hasNext()).isTrue();
+        List<AttachmentId> user2AttachmentsIds = user2Messages.next().getAttachmentsIds();
+        assertThat(attachmentsIds.equals(user2AttachmentsIds)).isTrue();
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
index 1bc2f55..1fa865d 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
@@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.junit.Before;
 import org.junit.Test;
@@ -35,7 +36,7 @@ public class StoreMailboxManagerTest {
 
     @Before
     public void setUp() {
-        storeMailboxManager = new StoreMailboxManager(null, new MockAuthenticator(), new
JVMMailboxPathLocker(), new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
+        storeMailboxManager = new StoreMailboxManager(null, new MockAuthenticator(), new
JVMMailboxPathLocker(), new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver(),
new MessageParser());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mailbox/store/src/test/resources/eml/4037_014.jpg
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/resources/eml/4037_014.jpg b/mailbox/store/src/test/resources/eml/4037_014.jpg
new file mode 100644
index 0000000..735e34f
Binary files /dev/null and b/mailbox/store/src/test/resources/eml/4037_014.jpg differ

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mailbox/store/src/test/resources/eml/4037_015.jpg
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/resources/eml/4037_015.jpg b/mailbox/store/src/test/resources/eml/4037_015.jpg
new file mode 100644
index 0000000..f7cef26
Binary files /dev/null and b/mailbox/store/src/test/resources/eml/4037_015.jpg differ

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mailbox/tool/src/test/java/org/apache/james/mailbox/copier/MailboxCopierTest.java
----------------------------------------------------------------------
diff --git a/mailbox/tool/src/test/java/org/apache/james/mailbox/copier/MailboxCopierTest.java
b/mailbox/tool/src/test/java/org/apache/james/mailbox/copier/MailboxCopierTest.java
index 1737262..c4590d3 100644
--- a/mailbox/tool/src/test/java/org/apache/james/mailbox/copier/MailboxCopierTest.java
+++ b/mailbox/tool/src/test/java/org/apache/james/mailbox/copier/MailboxCopierTest.java
@@ -38,6 +38,7 @@ import org.apache.james.mailbox.mock.MockMailboxManager;
 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.mail.model.impl.MessageParser;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.LoggerFactory;
@@ -154,6 +155,7 @@ public class MailboxCopierTest {
     private MailboxManager newInMemoryMailboxManager() {
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
 
         return new StoreMailboxManager(
             new InMemoryMailboxSessionMapperFactory(), 
@@ -163,7 +165,8 @@ public class MailboxCopierTest {
                 }
             },
             aclResolver,
-            groupMembershipResolver
+            groupMembershipResolver,
+            messageParser
             );
     
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
index 470da42..6c66d9f 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
@@ -31,6 +31,7 @@ import org.apache.james.mailbox.cassandra.CassandraMailboxSessionMapperFactory;
 import org.apache.james.mailbox.cassandra.mail.CassandraModSeqProvider;
 import org.apache.james.mailbox.cassandra.mail.CassandraUidProvider;
 import org.apache.james.mailbox.cassandra.modules.CassandraAclModule;
+import org.apache.james.mailbox.cassandra.modules.CassandraAttachmentModule;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxCounterModule;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxModule;
 import org.apache.james.mailbox.cassandra.modules.CassandraMessageModule;
@@ -45,6 +46,7 @@ import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
 import org.apache.james.mailbox.store.quota.StoreQuotaManager;
@@ -73,7 +75,8 @@ public class CassandraHostSystem extends JamesImapHostSystem {
             new CassandraUidModule(),
             new CassandraModSeqModule(),
             new CassandraSubscriptionModule(),
-            new CassandraQuotaModule());
+            new CassandraQuotaModule(),
+            new CassandraAttachmentModule());
         cassandraClusterSingleton = CassandraCluster.create(mailboxModule);
         userManager = new MockAuthenticator();
         com.datastax.driver.core.Session session = cassandraClusterSingleton.getConf();
@@ -82,7 +85,7 @@ public class CassandraHostSystem extends JamesImapHostSystem {
 
         CassandraMailboxSessionMapperFactory mapperFactory = new CassandraMailboxSessionMapperFactory(uidProvider,
modSeqProvider, session, new CassandraTypesProvider(mailboxModule, session));
         
-        mailboxManager = new CassandraMailboxManager(mapperFactory, userManager, new JVMMailboxPathLocker());
+        mailboxManager = new CassandraMailboxManager(mapperFactory, userManager, new JVMMailboxPathLocker(),
new MessageParser());
         QuotaRootResolver quotaRootResolver = new DefaultQuotaRootResolver(mapperFactory);
 
         CassandraPerUserMaxQuotaManager perUserMaxQuotaManager = new CassandraPerUserMaxQuotaManager(session);

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
index 1cb71f3..6aaf843 100644
--- a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
+++ b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
@@ -50,6 +50,7 @@ import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
 import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.NoQuotaManager;
 import org.apache.james.mpt.api.ImapFeatures;
@@ -109,8 +110,9 @@ public class ElasticSearchHostSystem extends JamesImapHostSystem {
 
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
 
-        mailboxManager = new StoreMailboxManager(factory, userManager, aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(factory, userManager, aclResolver, groupMembershipResolver,
messageParser);
         mailboxManager.setMessageSearchIndex(searchIndex);
 
         try {

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
b/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
index 844b6cd..a205d32 100644
--- a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
+++ b/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
@@ -42,6 +42,7 @@ import org.apache.james.mailbox.hbase.mail.HBaseUidProvider;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.NoQuotaManager;
 import org.apache.james.mpt.api.ImapFeatures;
@@ -97,8 +98,9 @@ public class HBaseHostSystem extends JamesImapHostSystem {
                 conf, uidProvider, modSeqProvider);
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
         
-        mailboxManager = new HBaseMailboxManager(mapperFactory, userManager, aclResolver,
groupMembershipResolver);
+        mailboxManager = new HBaseMailboxManager(mapperFactory, userManager, aclResolver,
groupMembershipResolver, messageParser);
         mailboxManager.init();
 
         SubscriptionManager subscriptionManager = new StoreSubscriptionManager(mapperFactory);

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryEventAsynchronousHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryEventAsynchronousHostSystem.java
b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryEventAsynchronousHostSystem.java
index c855e65..fb491d1 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryEventAsynchronousHostSystem.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryEventAsynchronousHostSystem.java
@@ -38,6 +38,7 @@ import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
 import org.apache.james.mailbox.store.event.AsynchronousEventDelivery;
 import org.apache.james.mailbox.store.event.DefaultDelegatingMailboxListener;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.CurrentQuotaCalculator;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
@@ -77,8 +78,9 @@ public class InMemoryEventAsynchronousHostSystem extends JamesImapHostSystem
{
         InMemoryMailboxSessionMapperFactory factory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
 
-        mailboxManager = new StoreMailboxManager(factory, userManager, aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(factory, userManager, aclResolver, groupMembershipResolver,
messageParser);
         QuotaRootResolver quotaRootResolver = new DefaultQuotaRootResolver(factory);
 
         InMemoryPerUserMaxQuotaManager perUserMaxQuotaManager = new InMemoryPerUserMaxQuotaManager();

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
index 87ef8a5..cd33f8f 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
@@ -37,6 +37,7 @@ import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.CurrentQuotaCalculator;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
@@ -78,9 +79,10 @@ public class InMemoryHostSystem extends JamesImapHostSystem {
         userManager = new MockAuthenticator();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
 
         InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
-        mailboxManager = new InMemoryMailboxManager(mailboxSessionMapperFactory, userManager,
new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
+        mailboxManager = new InMemoryMailboxManager(mailboxSessionMapperFactory, userManager,
new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver, messageParser);
         QuotaRootResolver quotaRootResolver = new DefaultQuotaRootResolver(mailboxManager.getMapperFactory());
 
         InMemoryPerUserMaxQuotaManager perUserMaxQuotaManager = new InMemoryPerUserMaxQuotaManager();

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
index 9ff0162..9f1724e 100644
--- a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
+++ b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
@@ -42,6 +42,7 @@ import org.apache.james.mailbox.jcr.mail.JCRUidProvider;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MockAuthenticator;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.NoQuotaManager;
 import org.apache.james.mpt.api.ImapFeatures;
@@ -90,8 +91,9 @@ public class JCRHostSystem extends JamesImapHostSystem{
 
             MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
             GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+            MessageParser messageParser = new MessageParser();
 
-            mailboxManager = new JCRMailboxManager(mf, userManager, locker, aclResolver,
groupMembershipResolver);
+            mailboxManager = new JCRMailboxManager(mf, userManager, locker, aclResolver,
groupMembershipResolver, messageParser);
             mailboxManager.init();
 
             final ImapProcessor defaultImapProcessorFactory = 

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
index 3848df2..1889f2c 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
@@ -49,6 +49,7 @@ import org.apache.james.mailbox.jpa.user.model.JPASubscription;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MockAuthenticator;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.NoQuotaManager;
 import org.apache.james.mpt.api.ImapFeatures;
@@ -120,8 +121,9 @@ public class JPAHostSystem extends JamesImapHostSystem {
 
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
 
-        mailboxManager = new OpenJPAMailboxManager(mf, userManager, locker, false, aclResolver,
groupMembershipResolver);
+        mailboxManager = new OpenJPAMailboxManager(mf, userManager, locker, false, aclResolver,
groupMembershipResolver, messageParser);
         mailboxManager.init();
 
         SubscriptionManager subscriptionManager = new JPASubscriptionManager(mf);

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
index 99c52b0..52defda 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
@@ -37,6 +37,7 @@ import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.NoQuotaManager;
 import org.apache.james.mpt.api.ImapFeatures;
@@ -67,8 +68,9 @@ public class MaildirHostSystem extends JamesImapHostSystem {
         
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
 
-        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, userManager,
locker, aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, userManager,
locker, aclResolver, groupMembershipResolver, messageParser);
         mailboxManager.init();
 
         final ImapProcessor defaultImapProcessorFactory = 

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
index 48aae4a..67eb4e3 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
@@ -79,6 +79,7 @@ public class CassandraMailboxModule extends AbstractModule {
         cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraSubscriptionModule.class);
         cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraUidModule.class);
         cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraModSeqModule.class);
+        cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraAttachmentModule.class);
         
         Multibinder.newSetBinder(binder(), MailboxManagerDefinition.class).addBinding().to(CassandraMailboxManagerDefinition.class);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/container/mailbox-adapter/src/test/java/org/apache/james/adapter/mailbox/MailboxManagementTest.java
----------------------------------------------------------------------
diff --git a/server/container/mailbox-adapter/src/test/java/org/apache/james/adapter/mailbox/MailboxManagementTest.java
b/server/container/mailbox-adapter/src/test/java/org/apache/james/adapter/mailbox/MailboxManagementTest.java
index 86a3976..e38e78b 100644
--- a/server/container/mailbox-adapter/src/test/java/org/apache/james/adapter/mailbox/MailboxManagementTest.java
+++ b/server/container/mailbox-adapter/src/test/java/org/apache/james/adapter/mailbox/MailboxManagementTest.java
@@ -31,6 +31,7 @@ import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.junit.Before;
 import org.junit.Test;
@@ -55,7 +56,8 @@ public class MailboxManagementTest {
             new MockAuthenticator(),
             new JVMMailboxPathLocker(),
             new UnionMailboxACLResolver(),
-            new SimpleGroupMembershipResolver());
+            new SimpleGroupMembershipResolver(),
+            new MessageParser());
         mailboxManager.init();
         mailboxManagerManagement = new MailboxManagerManagement();
         mailboxManagerManagement.setMailboxManager(mailboxManager);

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
----------------------------------------------------------------------
diff --git a/server/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
b/server/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
index 4769445..be39003 100644
--- a/server/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
+++ b/server/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
@@ -119,6 +119,7 @@
        Mailbox
     ===========================================================================
     -->
+    <bean id="messageParser" class="org.apache.james.mailbox.store.mail.model.impl.MessageParser"
init-method="init"/>
 
     <!-- Mailbox Managers -->
     <bean class="org.apache.james.container.spring.bean.factorypostprocessor.MailboxConfigurationBeanFactoryPostProcessor"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
index 230f7ce..e5af08c 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
@@ -51,6 +51,7 @@ import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.SimpleMailboxSession;
 import org.apache.james.mailbox.store.StoreMailboxManager;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.assertj.core.groups.Tuple;
 import org.junit.Before;
 import org.junit.Test;
@@ -77,7 +78,8 @@ public class GetMailboxesMethodTest {
         mailboxMapperFactory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager(mailboxMapperFactory, new MockAuthenticator(),
aclResolver, groupMembershipResolver);
+        MessageParser messageParser = new MessageParser();
+        mailboxManager = new StoreMailboxManager(mailboxMapperFactory, new MockAuthenticator(),
aclResolver, groupMembershipResolver, messageParser);
         mailboxManager.init();
         mailboxUtils = new MailboxUtils(mailboxManager, mailboxMapperFactory);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
index 506da37..4632c1a 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
@@ -48,6 +48,7 @@ import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreMailboxManager;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.assertj.core.api.Condition;
 import org.assertj.core.data.MapEntry;
 import org.assertj.core.groups.Tuple;
@@ -110,7 +111,8 @@ public class GetMessagesMethodTest {
         authenticator.addUser(ROBERT.username, ROBERT.password);
         UnionMailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         SimpleGroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, authenticator,
aclResolver, groupMembershipResolver);
+        MessageParser messageParser = new MessageParser();
+        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, authenticator,
aclResolver, groupMembershipResolver, messageParser);
         mailboxManager.init();
         
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
index 2aa47fb..7e72b64 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
@@ -48,6 +48,7 @@ import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
+import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
 import org.apache.james.queue.api.MailQueue.MailQueueItem;
 import org.apache.mailet.Mail;
 import org.apache.mailet.base.test.FakeMail;
@@ -77,7 +78,8 @@ public class PostDequeueDecoratorTest {
         mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, new MockAuthenticator(),
aclResolver, groupMembershipResolver);
+        MessageParser messageParser = new MessageParser();
+        mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, new MockAuthenticator(),
aclResolver, groupMembershipResolver, messageParser);
         mailboxManager.init();
 
         mockedMailQueueItem = mock(MailQueueItem.class);

http://git-wip-us.apache.org/repos/asf/james-project/blob/bbcba2c8/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
index 537fc82..580a9a6 100644
--- a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
+++ b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
@@ -51,6 +51,7 @@ import org.apache.james.mailbox.model.MailboxConstants;
 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.mail.model.impl.MessageParser;
 import org.apache.james.pop3server.netty.POP3Server;
 import org.apache.james.protocols.lib.POP3BeforeSMTPHelper;
 import org.apache.james.protocols.lib.PortUtil;
@@ -712,6 +713,7 @@ public class POP3ServerTest {
         InMemoryMailboxSessionMapperFactory factory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MessageParser messageParser = new MessageParser();
         mailboxManager = new StoreMailboxManager(factory, new Authenticator() {
     
             @Override
@@ -723,7 +725,7 @@ public class POP3ServerTest {
                     return false;
                 }
             }
-        }, aclResolver, groupMembershipResolver);
+        }, aclResolver, groupMembershipResolver, messageParser);
         mailboxManager.init();
 
         protocolHandlerChain.put("mailboxmanager", MailboxManager.class, mailboxManager);


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


Mime
View raw message