[jira] [Commented] (JAMES-1808) if (character > 128) should be changed to if (character >= 128)

2016-07-25 Thread Paul Lee (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-1808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15392225#comment-15392225
 ] 

Paul Lee commented on JAMES-1808:
-

Unfortunately, I don't have any failing test case. I inadvertently watched the 
code and noticed that it was theoretically wrong and just reported it.

By the way, I'm curious if the code block is really necessary. I know that 
US-ASCII characters are only allowed by the standard, but isn't it just O.K to 
leave non-ASCII characters as is without converting them to question marks?

> if (character > 128) should be changed to if (character >= 128)
> ---
>
> Key: JAMES-1808
> URL: https://issues.apache.org/jira/browse/JAMES-1808
> Project: James Server
>  Issue Type: Bug
>  Components: IMAPServer
>Affects Versions: 3.0.0-beta5
>Reporter: Paul Lee
>Priority: Minor
> Fix For: 3.0.0-beta5
>
>
> There is a conditional code block as follows in the class 
> 'ImapResponseComposerImpl' of the package 'org.apache.james.imap.encode.base' 
> in the 'protocols-imap' project.
> // 7-bit ASCII only
> if (character > 128) {
> buffer.write(BYTE_QUESTION);
> } else {
> buffer.write((byte) character);
> }
> An equals(=) sign should be included in the conditional since the range of 
> US-ASCII is from 0 to 127(not including 128).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



Re: James / James JSieve dependency to Geronimo-Mail [unsigned]

2016-07-25 Thread Matthieu Baechler
Everything should switch to javamail now, as fas as I remember I did the 
switch on james-server some times ago.


--

Matthieu Baechler


On 07/25/2016 04:32 PM, Bernd Waibel wrote:

Hello,

we have runtime issues (class cast exception) using James3 due to the usage of 
java-mail-1.4.4 together with Geronimo-mail.
We are currently in testing, so we try to fix some runtime issues before going 
to production.

There have been a discussion to go back (again) from Geronimo to java-mail.
Java-mail is now developed by java.net, currently release is 1.5.5
See https://java.net/projects/javamail/pages/Home

Did the project james-jsieve do this move?

The dependency of james-server-mailets / apache-jsieve-mailet does define a 
dependency to geronimo-javamail_1.4_mail.
So if we do a maven install, we do get two Mail implementations in the lib 
directory:

-  geronimo-javamail_1.4_mail-1.8.3.jar

-  mail-1.4.4.jar

The content of the META-INF/mailcap is different:
Mail-1.4.4.jar:   text/plain;; 
x-java-content-handler=com.sun.mail.handlers.text_plain
Geronimo: text/plain;; 
x-java-content-handler=org.apache.geronimo.javamail.handlers.TextPlainHandler
So I currently do not know which handler is used. May depend on classloader.

Question:
Should james-jsieve should also switch to mail-1.4.4.jar?
Or does james switch back to geronimo?

(Maybe this would concern activation/geronimo-activation).


Greetings
Bernd





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



[jira] [Commented] (JAMES-1808) if (character > 128) should be changed to if (character >= 128)

2016-07-25 Thread Matthieu Baechler (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-1808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15392185#comment-15392185
 ] 

Matthieu Baechler commented on JAMES-1808:
--

Thank you very much for you report. Do you have a failing test case for that ? 
(MPT test, unit test, or even a copy/paste of an imap session)

> if (character > 128) should be changed to if (character >= 128)
> ---
>
> Key: JAMES-1808
> URL: https://issues.apache.org/jira/browse/JAMES-1808
> Project: James Server
>  Issue Type: Bug
>  Components: IMAPServer
>Affects Versions: 3.0.0-beta5
>Reporter: Paul Lee
>Priority: Minor
> Fix For: 3.0.0-beta5
>
>
> There is a conditional code block as follows in the class 
> 'ImapResponseComposerImpl' of the package 'org.apache.james.imap.encode.base' 
> in the 'protocols-imap' project.
> // 7-bit ASCII only
> if (character > 128) {
> buffer.write(BYTE_QUESTION);
> } else {
> buffer.write((byte) character);
> }
> An equals(=) sign should be included in the conditional since the range of 
> US-ASCII is from 0 to 127(not including 128).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



Re: AW: Running James as WAR [unsigned]

2016-07-25 Thread Matthieu Baechler

Hi Bernd,

I understand what you are trying to achieve and it makes perfect sense IMO.

We are writing a proposal about what we would like to see in James 3.0, 
you can find it here : https://github.com/apache/james-project/pull/42


Comments (and help, of course) are welcome. If you want the War 
deployment to be supported, maybe you can offer some help ?


I personally prefer a jar deployment with the http server built in. 
Security fix are more likely happening in anything but jetty nowadays so 
making a specific case just for the servlet container seems to 
complicated to me.


WDYT ?

--
Matthieu Baechler

On 07/18/2016 04:07 PM, Bernd Waibel wrote:

Hello Mathieu,

the reason for this:

We do have a web application for managing some features in James 2.3.2.
I do not want to do advertising here, cause this is a non-commercial forum, but you 
personally may have a look at this screenshot: 
"https://wiki.intarsys.de/confluence/display/SMG/Aktionen+in+den+Regeln;
Sorry, this page is currently only in German language, but some screenshots may 
make clear what we are doing.

The managing application is running in Tomcat7, and the web app is managing 
James and our own mailet (via JMX, and via our own mailet). So the idea is to 
manage James via our Tomcat-Servlet. We need to work with shared databases 
here, which may be of concern at runtime.

So, if Tomcat is already installed at the running machines of our customers, so 
why not run James in Tomcat? We hope the deployment would be easier, cause on 
an update we just want to replace the war file, and let tomcat do the 
deployment.

This has not been enabled in James2.3.2, I think, so it is a new feature.

We could use the standalone-runner, too.
The "Phoenix" implementation of james2 has been gone dead, which made the 
deployment tricky.
Would this happen again? Is the new runtime stable enough? What's about 
security fixes?
Tomcat has some good reputation on fixing security issues.

If you recommend to use the standalone service, because the James web app may 
become deprecated, please let me know.


Best Regards
Bernd Waibel

-Ursprüngliche Nachricht-
Von: Matthieu Baechler [mailto:mbaech...@linagora.com]
Gesendet: Montag, 18. Juli 2016 12:22
An: server-dev@james.apache.org
Betreff: Re: Running James as WAR [unsigned]

Could you explain why you would like to use it as a WAR ?

It looks like the trend is to have a self contained service.

I'm eager to know what would be the rational for that in 2016 and if it
would be interesting to actually support that for James 3.0 or not.

Regards,




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



[2/2] james-project git commit: Merge remote-tracking branch 'laura/JAMES-1805'

2016-07-25 Thread matthieu
Merge remote-tracking branch 'laura/JAMES-1805'


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/1616042b
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/1616042b
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/1616042b

Branch: refs/heads/master
Commit: 1616042be691fab99ab1a1d6eaf920812153e4ec
Parents: f888958 a897f58
Author: Matthieu Baechler 
Authored: Mon Jul 25 17:42:05 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 17:42:05 2016 +0200

--
 .../integration/SetMessagesMethodTest.java  | 82 +---
 .../james/jmap/model/CreationMessage.java   | 11 +--
 .../org/apache/james/jmap/model/Message.java|  1 -
 .../apache/james/jmap/model/MessageFactory.java | 13 ++--
 .../jmap/methods/GetMessagesMethodTest.java |  2 +-
 .../james/jmap/model/CreationMessageTest.java   | 50 ++--
 .../james/jmap/model/MailboxMessageTest.java|  2 +-
 7 files changed, 126 insertions(+), 35 deletions(-)
--



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



[jira] [Closed] (JAMES-1805) Allow empty subject when sending mail

2016-07-25 Thread Laura Royet (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Laura Royet closed JAMES-1805.
--
Resolution: Fixed

merged

> Allow empty subject when sending mail 
> --
>
> Key: JAMES-1805
> URL: https://issues.apache.org/jira/browse/JAMES-1805
> Project: James Server
>  Issue Type: Bug
>  Components: JMAP
>Reporter: Laura Royet
>Assignee: Antoine Duprat
>
> Allow empty subject when sending mail 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[1/2] james-project git commit: JAMES-1805 Allow empty subject when sending mail

2016-07-25 Thread matthieu
Repository: james-project
Updated Branches:
  refs/heads/master f88895834 -> 1616042be


JAMES-1805 Allow empty subject when sending mail


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/a897f587
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/a897f587
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/a897f587

Branch: refs/heads/master
Commit: a897f587f539eb02f3e4925e220d7a5db21c4e09
Parents: 0ea95c3
Author: Laura Royet 
Authored: Fri Jul 22 12:11:04 2016 +0200
Committer: Laura Royet 
Committed: Mon Jul 25 10:08:21 2016 +0200

--
 .../integration/SetMessagesMethodTest.java  | 82 +---
 .../james/jmap/model/CreationMessage.java   | 11 +--
 .../org/apache/james/jmap/model/Message.java|  1 -
 .../apache/james/jmap/model/MessageFactory.java | 13 ++--
 .../jmap/methods/GetMessagesMethodTest.java |  2 +-
 .../james/jmap/model/CreationMessageTest.java   | 50 ++--
 .../james/jmap/model/MailboxMessageTest.java|  2 +-
 7 files changed, 126 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/a897f587/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
--
diff --git 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index 6ea553f..af0dc11 100644
--- 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -686,6 +686,74 @@ public abstract class SetMessagesMethodTest {
 }
 
 @Test
+public void 
setMessageShouldReturnCreatedMessageWithEmptySubjectWhenSubjectIsNull() {
+String messageCreationId = "user|inbox|1";
+String fromAddress = username;
+String requestBody = "[" +
+"  [" +
+"\"setMessages\","+
+"{" +
+"  \"create\": { \"" + messageCreationId  + "\" : {" +
+"\"from\": { \"name\": \"Me\", \"email\": \"" + 
fromAddress + "\"}," +
+"\"to\": [{ \"name\": \"BOB\", \"email\": 
\"some...@example.com\"}]," +
+"\"subject\": null," +
+"\"mailboxIds\": [\"" + getOutboxId(accessToken) + 
"\"]" +
+"  }}" +
+"}," +
+"\"#0\"" +
+"  ]" +
+"]";
+
+given()
+.header("Authorization", accessToken.serialize())
+.body(requestBody)
+.when()
+.post("/jmap")
+.then()
+.log().ifValidationFails()
+.statusCode(200)
+.body(NAME, equalTo("messagesSet"))
+.body(ARGUMENTS + ".notCreated", aMapWithSize(0))
+.body(ARGUMENTS + ".created", aMapWithSize(1))
+.body(ARGUMENTS + ".created", hasKey(messageCreationId))
+.body(ARGUMENTS + ".created[\""+messageCreationId+"\"].subject", 
equalTo(""));
+}
+
+@Test
+public void 
setMessageShouldReturnCreatedMessageWithEmptySubjectWhenSubjectIsEmpty() {
+String messageCreationId = "user|inbox|1";
+String fromAddress = username;
+String requestBody = "[" +
+"  [" +
+"\"setMessages\","+
+"{" +
+"  \"create\": { \"" + messageCreationId  + "\" : {" +
+"\"from\": { \"name\": \"Me\", \"email\": \"" + 
fromAddress + "\"}," +
+"\"to\": [{ \"name\": \"BOB\", \"email\": 
\"some...@example.com\"}]," +
+"\"subject\": \"\"," +
+"\"mailboxIds\": [\"" + getOutboxId(accessToken) + 
"\"]" +
+"  }}" +
+"}," +
+"\"#0\"" +
+"  ]" +
+"]";
+
+given()
+.header("Authorization", accessToken.serialize())
+.body(requestBody)
+   .when()
+.post("/jmap")
+   .then()
+.log().ifValidationFails()
+.statusCode(200)
+.body(NAME, equalTo("messagesSet"))
+   

[3/3] james-project git commit: Merge branch 'JAMES-1807'

2016-07-25 Thread matthieu
Merge branch 'JAMES-1807'


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/f8889583
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/f8889583
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/f8889583

Branch: refs/heads/master
Commit: f888958349de0a37b0fea435d15963d34be22adc
Parents: c981e8a ae5f51e
Author: Matthieu Baechler 
Authored: Mon Jul 25 17:36:03 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 17:36:03 2016 +0200

--
 .../model/MultimailboxesSearchQuery.java|   9 +-
 .../modules/mailbox/MemoryMailboxModule.java|   3 +
 .../integration/GetMessageListMethodTest.java   |  11 +-
 .../jmap/methods/GetMessageListMethod.java  | 179 ---
 .../jmap/utils/SortToComparatorConvertor.java   |  15 +-
 .../utils/SortToComparatorConvertorTest.java|  70 ++--
 6 files changed, 155 insertions(+), 132 deletions(-)
--



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



[1/3] james-project git commit: JAMES-1807 Use new multimailbox search API in GetMessageList

2016-07-25 Thread matthieu
Repository: james-project
Updated Branches:
  refs/heads/master c981e8a39 -> f88895834


JAMES-1807 Use new multimailbox search API in GetMessageList


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c0fb4683
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c0fb4683
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c0fb4683

Branch: refs/heads/master
Commit: c0fb46831bfed2b7eaa1aa36cdd88b4495ece465
Parents: e456c07
Author: Raphael Ouazana 
Authored: Fri Jul 22 11:11:34 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 11:05:53 2016 +0200

--
 .../integration/GetMessageListMethodTest.java   |   6 +
 .../jmap/methods/GetMessageListMethod.java  | 157 +++
 .../jmap/utils/SortToComparatorConvertor.java   |  15 +-
 .../utils/SortToComparatorConvertorTest.java|  70 +++--
 4 files changed, 120 insertions(+), 128 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/c0fb4683/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
--
diff --git 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index 8a9eca5..685ef6e 100644
--- 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -44,6 +44,7 @@ import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.base.Charsets;
@@ -169,6 +170,7 @@ public abstract class GetMessageListMethodTest {
 .body(ARGUMENTS + ".messageIds", 
containsInAnyOrder("usern...@domain.tld|mailbox|1", 
"usern...@domain.tld|mailbox2|1"));
 }
 
+@Ignore("No multi user support in search for now")
 @Test
 public void 
getMessageListShouldReturnAllMessagesOfCurrentUserOnlyWhenMultipleMailboxesAndNoParameters()
 throws Exception {
 String otherUser = "other@" + domain;
@@ -252,6 +254,7 @@ public abstract class GetMessageListMethodTest {
 .body(ARGUMENTS + ".messageIds", 
contains("usern...@domain.tld|mailbox|1"));
 }
 
+@Ignore("Temporay break inMailboxes/notInMailboxes support")
 @Test
 public void 
getMessageListShouldFilterMessagesWhenNotInMailboxesFilterMatches() throws 
Exception {
 
jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, 
username, "mailbox");
@@ -273,6 +276,7 @@ public abstract class GetMessageListMethodTest {
 .body(ARGUMENTS + ".messageIds", empty());
 }
 
+@Ignore("Temporay break inMailboxes/notInMailboxes support")
 @Test
 public void 
getMessageListShouldFilterMessagesWhenNotInMailboxesFilterMatchesTwice() throws 
Exception {
 
jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, 
username, "mailbox");
@@ -297,6 +301,7 @@ public abstract class GetMessageListMethodTest {
 .body(ARGUMENTS + ".messageIds", empty());
 }
 
+@Ignore("Temporay break inMailboxes/notInMailboxes support")
 @Test
 public void 
getMessageListShouldFilterMessagesWhenIdenticalNotInMailboxesAndInmailboxesFilterMatch()
 throws Exception {
 
jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, 
username, "mailbox");
@@ -357,6 +362,7 @@ public abstract class GetMessageListMethodTest {
 .body(ARGUMENTS + ".messageIds", 
contains("usern...@domain.tld|mailbox|1"));
 }
 
+@Ignore("Temporay break inMailboxes/notInMailboxes support")
 @Test
 public void 
getMessageListShouldFilterMessagesWhenInMailboxesFilterDoesntMatches() throws 
Exception {
 
jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, 
username, "mailbox");

http://git-wip-us.apache.org/repos/asf/james-project/blob/c0fb4683/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessageListMethod.java
--
diff --git 

[2/3] james-project git commit: JAMES-1807 implement InMailboxes filter

2016-07-25 Thread matthieu
JAMES-1807 implement InMailboxes filter


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ae5f51e6
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ae5f51e6
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ae5f51e6

Branch: refs/heads/master
Commit: ae5f51e6a3c5106e1774ec1a1622fd206c4ee2b0
Parents: c0fb468
Author: Raphael Ouazana 
Authored: Fri Jul 22 17:07:38 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 12:09:03 2016 +0200

--
 .../model/MultimailboxesSearchQuery.java|  9 ++--
 .../modules/mailbox/MemoryMailboxModule.java|  3 +++
 .../integration/GetMessageListMethodTest.java   |  7 +++---
 .../jmap/methods/GetMessageListMethod.java  | 24 +++-
 4 files changed, 37 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/ae5f51e6/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
--
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
index f979a79..42e667b 100644
--- 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
+++ 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
@@ -20,6 +20,7 @@
 package org.apache.james.mailbox.model;
 
 import java.util.Arrays;
+import java.util.Collection;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
@@ -41,10 +42,14 @@ public class MultimailboxesSearchQuery {
 this.searchQuery = searchQuery;
 this.mailboxIds = ImmutableSet.builder();
 }
+
+public Builder inMailboxes(Collection mailboxIds) {
+this.mailboxIds.addAll(mailboxIds);
+return this;
+}
 
 public Builder inMailboxes(MailboxId... mailboxIds) {
-this.mailboxIds.addAll(Arrays.asList(mailboxIds));
-return this;
+return inMailboxes(Arrays.asList(mailboxIds));
 }
 
 public MultimailboxesSearchQuery build() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ae5f51e6/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
--
diff --git 
a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
 
b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
index 6a13bb6..e735349 100644
--- 
a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
+++ 
b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
@@ -30,10 +30,12 @@ import org.apache.james.mailbox.acl.MailboxACLResolver;
 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.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.inmemory.mail.InMemoryModSeqProvider;
 import org.apache.james.mailbox.inmemory.mail.InMemoryUidProvider;
+import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.store.Authenticator;
 import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
@@ -66,6 +68,7 @@ public class MemoryMailboxModule extends AbstractModule {
 
bind(MailboxSessionMapperFactory.class).to(InMemoryMailboxSessionMapperFactory.class);
 bind(ModSeqProvider.class).to(InMemoryModSeqProvider.class);
 bind(UidProvider.class).to(InMemoryUidProvider.class);
+bind(MailboxId.Factory.class).to(InMemoryId.Factory.class);
 
 bind(SubscriptionManager.class).to(StoreSubscriptionManager.class);
 
bind(SubscriptionMapperFactory.class).to(InMemoryMailboxSessionMapperFactory.class);

http://git-wip-us.apache.org/repos/asf/james-project/blob/ae5f51e6/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
--
diff --git 

[jira] [Created] (JAMES-1809) Add Content-Disposition header when downloading attachments

2016-07-25 Thread Laura Royet (JIRA)
Laura Royet created JAMES-1809:
--

 Summary: Add Content-Disposition header when downloading 
attachments
 Key: JAMES-1809
 URL: https://issues.apache.org/jira/browse/JAMES-1809
 Project: James Server
  Issue Type: Bug
  Components: JMAP
Reporter: Laura Royet
Assignee: Antoine Duprat


Add Content-Disposition header when downloading attachments



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



James / James JSieve dependency to Geronimo-Mail [unsigned]

2016-07-25 Thread Bernd Waibel
Hello,

we have runtime issues (class cast exception) using James3 due to the usage of 
java-mail-1.4.4 together with Geronimo-mail.
We are currently in testing, so we try to fix some runtime issues before going 
to production.

There have been a discussion to go back (again) from Geronimo to java-mail.
Java-mail is now developed by java.net, currently release is 1.5.5
See https://java.net/projects/javamail/pages/Home

Did the project james-jsieve do this move?

The dependency of james-server-mailets / apache-jsieve-mailet does define a 
dependency to geronimo-javamail_1.4_mail.
So if we do a maven install, we do get two Mail implementations in the lib 
directory:

-  geronimo-javamail_1.4_mail-1.8.3.jar

-  mail-1.4.4.jar

The content of the META-INF/mailcap is different:
Mail-1.4.4.jar:   text/plain;; 
x-java-content-handler=com.sun.mail.handlers.text_plain
Geronimo: text/plain;; 
x-java-content-handler=org.apache.geronimo.javamail.handlers.TextPlainHandler
So I currently do not know which handler is used. May depend on classloader.

Question:
Should james-jsieve should also switch to mail-1.4.4.jar?
Or does james switch back to geronimo?

(Maybe this would concern activation/geronimo-activation).


Greetings
Bernd



Re: James3 Reading configuration via classpath [unsigned]

2016-07-25 Thread Ioan Eugen Stan
Hi,

I have not worked on James recently so I might be too generic in
expression and not very helpfull. Appologies if that is the case.


On 25.07.2016 15:07, Bernd Waibel wrote:
> Hello together,
> 
> it seems to me, that James3 is reading his configuration files (/conf/*.xml) 
> via "classpath:".
> Is this a design decision? Why does it work like this?

I believe it should not be this way as it limits how you can change
configuration in production deployments. It should be loaded from a
system property.

> The "conf" directory has to be on classpath, or James does not start. And it 
> must be the "first" of all classpath entries.
> Is there any kind of configuration, to change this behavior?

I agree this should be changed. The code should be in the main class.

> My aim is, to make the configuration available to a user who acts as a "james 
> configuration manager".
> He should configure the application, but not be able to change the code of 
> the application.
> Furthermore, there should be one installation, which could be run with 
> different configurations (e.g. a multi-homed server).

I agree. We use this case when we have deployments. We always start the
application based on a symlink called 'current' or similar.

We unpack a new version of the application and point current symlink to
it. That way we can rollback easy. The configuratio directory is outside
of current and we don't need to change anything.


> I do not like configuration files on classpath:
> 
> 1.   If we use the classpath to load the configuration, we are able to 
> put any JAR file into the configuration directory.
> This JAR file will be loaded first, so e.g. it could be a 
> "james-server-app-3.0.0-beta5-SNAPSHOT.jar".
> This will lead to the fact, that I could hack the implementation by placing a 
> hacked james-jar inside the configuration directory.
> Is this an aim of the current implementation?
> 
> 2.   If you do not place a configuration file inside the conf directory, 
> any configuration file found in any jar will be used.
> 
> E.g. the imapserver.xml is deployed inside the 
> james-server-protocol-imap4.jar, and is available on classpath, outside conf 
> directory.
> If we do not deploy a imapserver.xml inside the conf directory, the "default" 
> implemented will be used.
> Is this an aim of the current implementation?
> 
> I normally want to split "configuration" from "implementation", but only for 
> "business configuration".
> I do understand, that the configuration of the "beans" need to stay inside 
> the implementation.
> 
> 
> The reason for the current implementation seems to be coded in class 
> ConfigurationProviderImpl, as it has the following implementation:
> /**
>  * Return the configuration prefix to load the configuration. In this case
>  * it is classpath:, but could be also file://conf/
>  *
>  * @return prefix
>  */
> private String getConfigPrefix() {
> return "classpath:";
> }
> 
> Shouldn't it be better to use file://conf here instead?
> Does someone know any side effects if we do this?
> Should I create a ticket/patch?
> 
> Greetings
> Bernd
> 
> 

I agree with you. James should be configured via system properties. It
should try a default path if no value is given.

It would be great if you submit a patch or a pull request. I can help
you with more information on how to do this.

Regards,

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



[2/2] james-project git commit: MAILBOX-272 Add users in ES indexer

2016-07-25 Thread matthieu
MAILBOX-272 Add users in ES indexer


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c981e8a3
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c981e8a3
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c981e8a3

Branch: refs/heads/master
Commit: c981e8a399efe6b01e558a67669caee6fd646165
Parents: e456c07
Author: Antoine Duprat 
Authored: Fri Jul 22 13:22:46 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 15:38:55 2016 +0200

--
 mailbox/elasticsearch/pom.xml   |   6 +
 .../elasticsearch/NodeMappingFactory.java   |   4 +
 ...lasticSearchListeningMessageSearchIndex.java |  11 +-
 .../elasticsearch/json/IndexableMessage.java|  12 +-
 .../json/JsonMessageConstants.java  |   1 +
 .../json/MessageToElasticSearchJson.java|   6 +-
 .../elasticsearch/query/QueryConverter.java |  12 +-
 .../search/ElasticSearchSearcher.java   |  10 +-
 ...hListeningMailboxMessageSearchIndexTest.java |  13 +-
 .../MailboxMessageToElasticSearchJsonTest.java  |  39 +-
 .../lucene/search/LuceneMessageSearchIndex.java |   3 +
 .../LuceneMailboxMessageSearchIndexTest.java| 113 ++---
 .../store/search/LazyMessageSearchIndex.java|   3 +
 .../mailbox/store/search/MessageSearches.java   |  80 ++--
 .../store/search/SimpleMessageSearchIndex.java  |  21 +-
 .../store/SearchUtilsMultipartMixedTest.java|  65 ++-
 .../mailbox/store/SearchUtilsRFC822Test.java|  31 +-
 .../james/mailbox/store/SearchUtilsTest.java| 441 +--
 .../search/AbstractMessageSearchIndexTest.java  |  23 +-
 .../store/src/test/resources/eml/htmlMail.json  |   5 +-
 mailbox/store/src/test/resources/eml/mail.json  |   5 +-
 .../src/test/resources/eml/nonTextual.json  |   5 +-
 .../src/test/resources/eml/pgpSignedMail.json   |   5 +-
 .../src/test/resources/eml/recursiveMail.json   |   5 +-
 .../store/src/test/resources/eml/spamMail.json  |   5 +-
 25 files changed, 514 insertions(+), 410 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/c981e8a3/mailbox/elasticsearch/pom.xml
--
diff --git a/mailbox/elasticsearch/pom.xml b/mailbox/elasticsearch/pom.xml
index 864a95f..59df4ee 100644
--- a/mailbox/elasticsearch/pom.xml
+++ b/mailbox/elasticsearch/pom.xml
@@ -163,6 +163,12 @@
 apache-james-mailbox-api
 
 
+${project.groupId}
+apache-james-mailbox-api
+test-jar
+test
+
+
 org.apache.james
 apache-james-mailbox-store
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/c981e8a3/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
--
diff --git 
a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
 
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
index f74da92..91bf2e6 100644
--- 
a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
+++ 
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
@@ -192,6 +192,10 @@ public class NodeMappingFactory {
 .field(TYPE, STRING)
 .field(INDEX, NOT_ANALYZED)
 .endObject()
+.startObject(JsonMessageConstants.USERS)
+.field(TYPE, STRING)
+.field(INDEX, NOT_ANALYZED)
+.endObject()
 .startObject(JsonMessageConstants.PROPERTIES)
 .field(TYPE, NESTED)
 .startObject(PROPERTIES)

http://git-wip-us.apache.org/repos/asf/james-project/blob/c981e8a3/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
--
diff --git 
a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
 
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
index dc7e301..957826d 100644
--- 

[1/2] james-project git commit: MAILBOX-272 Add users in ES indexer

2016-07-25 Thread matthieu
Repository: james-project
Updated Branches:
  refs/heads/master e456c0733 -> c981e8a39


http://git-wip-us.apache.org/repos/asf/james-project/blob/c981e8a3/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
--
diff --git 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
index 06703f1..5ac4fe2 100644
--- 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
+++ 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
@@ -38,8 +38,6 @@ import 
org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.MessageSearches;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class SearchUtilsTest {
 
@@ -62,7 +60,6 @@ public class SearchUtilsTest {
 MessageBuilder builder;
 
 Collection recent;
-private Logger log = LoggerFactory.getLogger(getClass());
 
 private Calendar getGMT() {
 return Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.UK);
@@ -85,13 +82,13 @@ public class SearchUtilsTest {
 builder.size = SIZE;
 MailboxMessage row = builder.build();
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE - 1), row,
-recent, log));
+recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE), row,
-recent, log));
+recent));
 assertTrue(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE 
+ 1), row,
-recent, log));
+recent));
 assertTrue(new MessageSearches().isMatch(
-SearchQuery.sizeLessThan(Integer.MAX_VALUE), row, recent, 
log));
+SearchQuery.sizeLessThan(Integer.MAX_VALUE), row, recent));
 }
 
 @Test
@@ -99,13 +96,13 @@ public class SearchUtilsTest {
 builder.size = SIZE;
 MailboxMessage row = builder.build();
 assertTrue(new 
MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE - 1), row,
-recent, log));
+recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE), row,
-recent, log));
+recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE + 1),
-row, recent, log));
+row, recent));
 assertFalse(new MessageSearches().isMatch(SearchQuery
-.sizeGreaterThan(Integer.MAX_VALUE), row, recent, log));
+.sizeGreaterThan(Integer.MAX_VALUE), row, recent));
 }
 
 @Test
@@ -113,12 +110,12 @@ public class SearchUtilsTest {
 builder.size = SIZE;
 MailboxMessage row = builder.build();
 assertFalse(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE 
- 1), row,
-recent, log));
-assertTrue(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE), 
row, recent, log));
+recent));
+assertTrue(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE), 
row, recent));
 assertFalse(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE 
+ 1), row,
-recent, log));
+recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.sizeEquals(Integer.MAX_VALUE),
-row, recent, log));
+row, recent));
 }
 
 @Test
@@ -126,15 +123,15 @@ public class SearchUtilsTest {
 builder.internalDate = SUN_SEP_9TH_2001;
 MailboxMessage row = builder.build();
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(9, 9, 2000), 
DateResolution.Day),
-row, recent, log));
+row, recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(8, 9, 2001), 
DateResolution.Day),
-row, recent, log));
+row, recent));
 assertTrue(new 
MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(9, 9, 2001), 
DateResolution.Day),
-row, recent, log));
+row, recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(10, 9, 2001), 
DateResolution.Day),
-row, recent, log));
+row, recent));
 assertFalse(new 
MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(9, 9, 2002), 
DateResolution.Day),
-row, recent, log));
+row, recent));
 }
 
 
@@ -143,15 +140,15 @@ public class SearchUtilsTest {
 builder.internalDate = SUN_SEP_9TH_2001;
 MailboxMessage row = builder.build();
 

James3 Reading configuration via classpath [unsigned]

2016-07-25 Thread Bernd Waibel
Hello together,

it seems to me, that James3 is reading his configuration files (/conf/*.xml) 
via "classpath:".
Is this a design decision? Why does it work like this?

The "conf" directory has to be on classpath, or James does not start. And it 
must be the "first" of all classpath entries.
Is there any kind of configuration, to change this behavior?

My aim is, to make the configuration available to a user who acts as a "james 
configuration manager".
He should configure the application, but not be able to change the code of the 
application.
Furthermore, there should be one installation, which could be run with 
different configurations (e.g. a multi-homed server).

I do not like configuration files on classpath:

1.   If we use the classpath to load the configuration, we are able to put 
any JAR file into the configuration directory.
This JAR file will be loaded first, so e.g. it could be a 
"james-server-app-3.0.0-beta5-SNAPSHOT.jar".
This will lead to the fact, that I could hack the implementation by placing a 
hacked james-jar inside the configuration directory.
Is this an aim of the current implementation?

2.   If you do not place a configuration file inside the conf directory, 
any configuration file found in any jar will be used.

E.g. the imapserver.xml is deployed inside the james-server-protocol-imap4.jar, 
and is available on classpath, outside conf directory.
If we do not deploy a imapserver.xml inside the conf directory, the "default" 
implemented will be used.
Is this an aim of the current implementation?

I normally want to split "configuration" from "implementation", but only for 
"business configuration".
I do understand, that the configuration of the "beans" need to stay inside the 
implementation.


The reason for the current implementation seems to be coded in class 
ConfigurationProviderImpl, as it has the following implementation:
/**
 * Return the configuration prefix to load the configuration. In this case
 * it is classpath:, but could be also file://conf/
 *
 * @return prefix
 */
private String getConfigPrefix() {
return "classpath:";
}

Shouldn't it be better to use file://conf here instead?
Does someone know any side effects if we do this?
Should I create a ticket/patch?

Greetings
Bernd



[jira] [Closed] (MAILBOX-273) add an api in MessageSearchIndex to query regarless of a mailbox

2016-07-25 Thread Matthieu Baechler (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matthieu Baechler closed MAILBOX-273.
-
Resolution: Fixed

Merged

> add an api in MessageSearchIndex to query regarless of a mailbox
> 
>
> Key: MAILBOX-273
> URL: https://issues.apache.org/jira/browse/MAILBOX-273
> Project: James Mailbox
>  Issue Type: Improvement
>Reporter: Matthieu Baechler
>
> We should add a CAPABILITY to query all mailboxes of any user at once.
> For that, we have to add an api in MessageSearchIndex to query regarless of a 
> mailbox.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[3/8] james-project git commit: MAILBOX-273 reorder lucene dependencies

2016-07-25 Thread matthieu
MAILBOX-273 reorder lucene dependencies


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/72ace6a1
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/72ace6a1
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/72ace6a1

Branch: refs/heads/master
Commit: 72ace6a16b8f498dd6feef3d93e0b83d7b70e961
Parents: 73b2da0
Author: Matthieu Baechler 
Authored: Mon Jul 18 15:20:33 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:29 2016 +0200

--
 mailbox/lucene/pom.xml | 56 ++---
 1 file changed, 28 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/72ace6a1/mailbox/lucene/pom.xml
--
diff --git a/mailbox/lucene/pom.xml b/mailbox/lucene/pom.xml
index 4a8cbc5..5edac5e 100644
--- a/mailbox/lucene/pom.xml
+++ b/mailbox/lucene/pom.xml
@@ -38,7 +38,24 @@
 
 
 org.apache.james
+apache-james-mailbox-api
+test-jar
+test
+
+
+org.apache.james
+apache-james-mailbox-memory
+test
+
+
+org.apache.james
+apache-james-mailbox-store
+
+
+org.apache.james
 apache-james-mailbox-store
+test-jar
+test
 
 
 org.apache.james
@@ -49,13 +66,22 @@
 apache-mime4j-dom
 
 
+${javax.mail.groupId}
+${javax.mail.artifactId}
+
+
+junit
+junit
+test
+
+
 org.apache.lucene
-lucene-core
+lucene-analyzers
 ${lucene.version}
 
 
 org.apache.lucene
-lucene-analyzers
+lucene-core
 ${lucene.version}
 
 
@@ -73,32 +99,6 @@
 org.slf4j
 slf4j-api
 
-
-${javax.mail.groupId}
-${javax.mail.artifactId}
-
-
-junit
-junit
-test
-
-
-org.apache.james
-apache-james-mailbox-api
-test-jar
-test
-
-
-org.apache.james
-apache-james-mailbox-memory
-test
-
-
-org.apache.james
-apache-james-mailbox-store
-test-jar
-test
-
 
 
 


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



[5/8] james-project git commit: MAILBOX-273 update LuceneMailboxMessageSearchIndexTest to match new standards

2016-07-25 Thread matthieu
MAILBOX-273 update LuceneMailboxMessageSearchIndexTest to match new standards


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/eff623d6
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/eff623d6
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/eff623d6

Branch: refs/heads/master
Commit: eff623d6e756e1c66297bb3c7cf5298e65fe4077
Parents: 72ace6a
Author: Matthieu Baechler 
Authored: Mon Jul 18 16:45:00 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:30 2016 +0200

--
 .../LuceneMailboxMessageSearchIndexTest.java| 674 +++
 1 file changed, 261 insertions(+), 413 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/eff623d6/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
--
diff --git 
a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
 
b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
index f116bfb..f9d5158 100644
--- 
a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
+++ 
b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
@@ -18,9 +18,7 @@
  /
 package org.apache.james.mailbox.lucene.search;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.nio.charset.Charset;
 import java.util.Arrays;
@@ -126,580 +124,436 @@ public class LuceneMailboxMessageSearchIndexTest {
 
 
 @Test
-public void testBodyShouldMatchPhraseInBody() throws Exception {
+public void bodySearchShouldMatchPhraseInBody() throws Exception {
 SearchQuery query = new SearchQuery();
 query.andCriteria(SearchQuery.bodyContains(CUSTARD));
 Iterator result = index.search(null, mailbox3, query);
-assertEquals(10L, result.next().longValue());
-assertFalse(result.hasNext());
-
-
-query = new SearchQuery();
-query.andCriteria(SearchQuery.bodyContains(CUSTARD + CUSTARD));
-result = index.search(null, mailbox3, query);
-assertFalse(result.hasNext());
+assertThat(result).containsExactly(10L);
 }
 
 @Test
-public void testBodyMatchShouldBeCaseInsensitive() throws Exception {
+public void bodySearchShouldNotMatchAbsentPhraseInBody() throws Exception {
+SearchQuery query = new SearchQuery();
+query.andCriteria(SearchQuery.bodyContains(CUSTARD + CUSTARD));
+Iterator result = index.search(null, mailbox3, query);
+assertThat(result).isEmpty();
+}
+
+@Test
+public void bodySearchShouldBeCaseInsensitive() throws Exception {
 SearchQuery query = new SearchQuery();
 query.andCriteria(SearchQuery.bodyContains(RHUBARD));
 Iterator result = index.search(null, mailbox3, query);
-assertEquals(10L, result.next().longValue());
-assertFalse(result.hasNext());
+assertThat(result).containsExactly(10L);
 }
 
 @Test
-public void testBodyShouldNotMatchPhraseOnlyInHeader() throws Exception {
+public void bodySearchNotMatchPhraseOnlyInFrom() throws Exception {
 SearchQuery query = new SearchQuery();
 query.andCriteria(SearchQuery.bodyContains(FROM_ADDRESS));
 Iterator result = index.search(null, mailbox3, query);
-assertFalse(result.hasNext());
-
-query = new SearchQuery();
+assertThat(result).isEmpty();
+}
+
+@Test
+public void bodySearchShouldNotMatchPhraseOnlyInSubject() throws Exception 
{
+SearchQuery query = new SearchQuery();
 query.andCriteria(SearchQuery.bodyContains(SUBJECT_PART));
-result = index.search(null, mailbox3, query);
-assertFalse(result.hasNext());
+Iterator result = index.search(null, mailbox3, query);
+assertThat(result).isEmpty();
 }
 
 @Test
-public void testTextShouldMatchPhraseInBody() throws Exception {
+public void textSearchShouldMatchPhraseInBody() throws Exception {
 SearchQuery query = new SearchQuery();
 query.andCriteria(SearchQuery.mailContains(CUSTARD));
 Iterator result = index.search(null, mailbox3, query);
-assertEquals(10L, result.next().longValue());
-assertFalse(result.hasNext());
-  

[6/8] james-project git commit: MAILBOX-273 implement cross-mailboxes search in ElasticSearch

2016-07-25 Thread matthieu
MAILBOX-273 implement cross-mailboxes search in ElasticSearch


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/085cf65e
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/085cf65e
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/085cf65e

Branch: refs/heads/master
Commit: 085cf65e9dbb1dfe5b3fbe4a00c7d9a36ea334be
Parents: eff623d
Author: Matthieu Baechler 
Authored: Tue Jul 19 18:12:07 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:30 2016 +0200

--
 .../apache/james/mailbox/model/MailboxId.java   |   5 +
 .../model/MultimailboxesSearchQuery.java|  72 
 .../model/MultimailboxesSearchQueryTest.java|  92 +++
 .../james/mailbox/cassandra/CassandraId.java|   7 ++
 mailbox/elasticsearch/pom.xml   |   5 +
 ...lasticSearchListeningMessageSearchIndex.java |  17 ++-
 .../elasticsearch/query/QueryConverter.java |  26 +++--
 .../search/ElasticSearchSearcher.java   |  51 
 .../ElasticSearchIntegrationTest.java   |   3 +-
 .../lucene/search/LuceneMessageSearchIndex.java | 108 -
 .../LuceneMailboxMessageSearchIndexTest.java|  34 +-
 .../search/LuceneMessageSearchIndexTest.java|  15 ++-
 .../james/mailbox/inmemory/InMemoryId.java  |   8 ++
 .../search/SimpleMessageSearchIndexTest.java|  25 
 .../store/search/LazyMessageSearchIndex.java|  10 ++
 .../store/search/MessageSearchIndex.java|  15 ++-
 .../store/search/SimpleMessageSearchIndex.java  |  10 ++
 .../org/apache/james/mailbox/store/TestId.java  |   8 ++
 .../search/AbstractMessageSearchIndexTest.java  | 116 ---
 .../imap/scripts/UidSearchAtomsIndexer.test |  37 +-
 .../host/ElasticSearchHostSystem.java   |   3 +-
 .../modules/mailbox/CassandraMailboxModule.java |   4 +
 22 files changed, 583 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/085cf65e/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
--
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
index 7410b4e..3e263fc 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
@@ -19,5 +19,10 @@
 package org.apache.james.mailbox.model;
 
 public interface MailboxId {
+
+interface Factory {
+MailboxId fromString(String serialized);
+}
+
 String serialize();
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/085cf65e/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
--
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
new file mode 100644
index 000..f979a79
--- /dev/null
+++ 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MultimailboxesSearchQuery.java
@@ -0,0 +1,72 @@
+/
+ * 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.model;
+
+import java.util.Arrays;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableSet;
+

[4/8] james-project git commit: MAILBOX-273 reorder MailboxCapabilities alphabetically

2016-07-25 Thread matthieu
MAILBOX-273 reorder MailboxCapabilities alphabetically


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/41cd5448
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/41cd5448
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/41cd5448

Branch: refs/heads/master
Commit: 41cd5448bbdb78f039c3cbf04e96880894bc1d15
Parents: 085cf65
Author: Matthieu Baechler 
Authored: Tue Jul 19 18:15:02 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:30 2016 +0200

--
 .../src/main/java/org/apache/james/mailbox/MailboxManager.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/41cd5448/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
--
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
index cfbdc15..1d60bcf 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
@@ -73,10 +73,10 @@ import org.slf4j.Logger;
 public interface MailboxManager extends RequestAware, MailboxListenerSupport {
 
 enum MailboxCapabilities {
+Annotation,
 Move,
-UserFlag,
 Namespace,
-Annotation
+UserFlag
 }
 
 EnumSet getSupportedMailboxCapabilities();


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



[7/8] james-project git commit: MAILBOX-273 require multimailbox search capability for jmap

2016-07-25 Thread matthieu
MAILBOX-273 require multimailbox search capability for jmap


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/7a6a4c19
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/7a6a4c19
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/7a6a4c19

Branch: refs/heads/master
Commit: 7a6a4c193d35b23ff2e4e326a858b9be237a44ef
Parents: 41cd544
Author: Matthieu Baechler 
Authored: Tue Jul 19 18:35:31 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:31 2016 +0200

--
 .../org/apache/james/mailbox/MailboxManager.java|  6 ++
 .../ElasticSearchListeningMessageSearchIndex.java   |  7 +++
 .../lucene/search/LuceneMessageSearchIndex.java |  8 
 .../james/mailbox/store/StoreMailboxManager.java|  6 ++
 .../store/search/LazyMessageSearchIndex.java|  7 +++
 .../mailbox/store/search/MessageSearchIndex.java|  4 
 .../store/search/SimpleMessageSearchIndex.java  |  7 +++
 .../processor/base/MailboxEventAnalyserTest.java|  5 +
 .../apache/james/JamesCapabilitiesServerTest.java   | 16 
 .../main/java/org/apache/james/jmap/JMAPModule.java |  2 ++
 .../jmap/FirstUserConnectionFilterThreadTest.java   |  5 +
 11 files changed, 73 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/7a6a4c19/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
--
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
index 1d60bcf..8cc0ea6 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
@@ -88,7 +88,13 @@ public interface MailboxManager extends RequestAware, 
MailboxListenerSupport {
 }
 
 EnumSet getSupportedMessageCapabilities();
+
+enum SearchCapabilities {
+MultimailboxSearch
+}
 
+EnumSet getSupportedSearchCapabilities();
+
 
 /**
  * Return the delimiter to use for folders

http://git-wip-us.apache.org/repos/asf/james-project/blob/7a6a4c19/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
--
diff --git 
a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
 
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
index b967e7c..dc7e301 100644
--- 
a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
+++ 
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
@@ -21,6 +21,7 @@ package org.apache.james.mailbox.elasticsearch.events;
 import static org.elasticsearch.index.query.QueryBuilders.termQuery;
 
 import java.util.Collection;
+import java.util.EnumSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -29,6 +30,7 @@ import java.util.stream.Collectors;
 import javax.inject.Inject;
 
 import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MailboxManager.SearchCapabilities;
 import org.apache.james.mailbox.elasticsearch.ElasticSearchIndexer;
 import org.apache.james.mailbox.elasticsearch.json.JsonMessageConstants;
 import org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson;
@@ -72,6 +74,11 @@ public class ElasticSearchListeningMessageSearchIndex 
extends ListeningMessageSe
 }
 
 @Override
+public EnumSet getSupportedCapabilities() {
+return EnumSet.of(SearchCapabilities.MultimailboxSearch);
+}
+
+@Override
 public Iterator search(MailboxSession session, Mailbox mailbox, 
SearchQuery searchQuery) throws MailboxException {
 MailboxId mailboxId = mailbox.getMailboxId();
 return searcher

http://git-wip-us.apache.org/repos/asf/james-project/blob/7a6a4c19/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
--
diff --git 
a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
 
b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
index 13ce4ac..9eb0388 100644
--- 

[1/8] james-project git commit: MAILBOX-273 MessageSearchIndex doesn't have an Id parameter

2016-07-25 Thread matthieu
Repository: james-project
Updated Branches:
  refs/heads/master 0ea95c34b -> e456c0733


MAILBOX-273 MessageSearchIndex doesn't have an Id parameter


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/55b1476c
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/55b1476c
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/55b1476c

Branch: refs/heads/master
Commit: 55b1476c4b6a288f16073a3e402b6a06cb9aca83
Parents: 0ea95c3
Author: Matthieu Baechler 
Authored: Mon Jul 18 13:21:01 2016 +0200
Committer: Raphael Ouazana 
Committed: Thu Jul 21 10:21:03 2016 +0200

--
 .../org/apache/james/mailbox/store/search/MessageSearchIndex.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/55b1476c/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
--
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
index 459af2c..c3ed9dd 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
@@ -32,8 +32,6 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * 
  * A developer should think of building an inverse-index for that.
  * 
- *
- * @param 
  */
 public interface MessageSearchIndex {
 


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



[8/8] james-project git commit: MAILBOX-273 Add partial multimailbox support for simple search backend

2016-07-25 Thread matthieu
MAILBOX-273 Add partial multimailbox support for simple search backend


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/e456c073
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/e456c073
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/e456c073

Branch: refs/heads/master
Commit: e456c07333db5735599cc7a93cbe05476c6b7a40
Parents: 7a6a4c1
Author: Raphael Ouazana 
Authored: Thu Jul 21 14:45:16 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:31 2016 +0200

--
 .../search/SimpleMessageSearchIndexTest.java| 19 +-
 .../mailbox/store/StoreMailboxManager.java  |  2 +-
 .../store/search/SimpleMessageSearchIndex.java  | 64 
 3 files changed, 56 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/e456c073/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java
--
diff --git 
a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java
 
b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java
index f034769..b974db9 100644
--- 
a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java
+++ 
b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java
@@ -39,7 +39,7 @@ public class SimpleMessageSearchIndexTest extends 
AbstractMessageSearchIndexTest
 @Override
 protected void initializeMailboxManager() throws Exception {
 MailboxSessionMapperFactory mapperFactory = new 
InMemoryMailboxSessionMapperFactory();
-messageSearchIndex = new SimpleMessageSearchIndex(mapperFactory);
+messageSearchIndex = new SimpleMessageSearchIndex(mapperFactory, 
mapperFactory);
 storeMailboxManager = new InMemoryMailboxManager(
 mapperFactory,
 new MockAuthenticator(),
@@ -214,29 +214,14 @@ public class SimpleMessageSearchIndexTest extends 
AbstractMessageSearchIndexTest
 @Override
 public void sortShouldOrderMessages() throws Exception {
 }
-
-@Ignore
-@Override
-public void 
multimailboxSearchShouldReturnUidOfMessageMarkedAsSeenInTwoMailboxes() throws 
MailboxException {
-}
 
 @Ignore
 @Override
-public void 
multimailboxSearchShouldReturnUidOfMessageMarkedAsSeenInAllMailboxes() throws 
MailboxException {
-}
-
-@Ignore
-@Override
 public void 
multimailboxSearchShouldReturnUidOfMessageWithExpectedFromInTwoMailboxes() 
throws MailboxException {
 }
-
+
 @Ignore
 @Override
 public void 
multimailboxSearchShouldReturnUidOfMessageWithExpectedFromInAllMailboxes() 
throws MailboxException {
 }
-
-@Ignore
-@Override
-public void 
multimailboxSearchShouldReturnUidOfMessageMarkedAsSeenInOneMailbox() throws 
MailboxException {
-}
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/e456c073/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
--
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
index 84f24ae..7f5bd28 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
@@ -173,7 +173,7 @@ public class StoreMailboxManager implements MailboxManager {
 dispatcher = new MailboxEventDispatcher(getDelegationListener());
 
 if (index == null) {
-index = new SimpleMessageSearchIndex(mailboxSessionMapperFactory);
+index = new SimpleMessageSearchIndex(mailboxSessionMapperFactory, 
mailboxSessionMapperFactory);
 }
 if (index instanceof ListeningMessageSearchIndex) {
 this.addGlobalListener((MailboxListener) index, null);

http://git-wip-us.apache.org/repos/asf/james-project/blob/e456c073/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
--
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
index 4a2e8d1..7d05a49 100644
--- 

[2/8] james-project git commit: MAILBOX-273 move MailboxId to mailbox-api project

2016-07-25 Thread matthieu
MAILBOX-273 move MailboxId to mailbox-api project


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/73b2da08
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/73b2da08
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/73b2da08

Branch: refs/heads/master
Commit: 73b2da08b5239ace21b1a4b950945c4187c515fe
Parents: 55b1476
Author: Matthieu Baechler 
Authored: Mon Jul 18 14:13:11 2016 +0200
Committer: Matthieu Baechler 
Committed: Mon Jul 25 10:13:29 2016 +0200

--
 .../apache/james/mailbox/model/MailboxId.java   | 23 
 .../CachingMailboxSessionMapperFactory.java |  2 +-
 .../guava/GuavaMailboxMetadataCache.java|  2 +-
 .../james/mailbox/cassandra/CassandraId.java|  2 +-
 .../CassandraMailboxSessionMapperFactory.java   |  2 +-
 .../org/apache/james/mailbox/hbase/HBaseId.java |  2 +-
 .../hbase/HBaseMailboxSessionMapperFactory.java |  2 +-
 .../org/apache/james/mailbox/jcr/JCRId.java |  2 +-
 .../jcr/JCRMailboxSessionMapperFactory.java |  2 +-
 .../org/apache/james/mailbox/jpa/JPAId.java |  2 +-
 .../jpa/JPAMailboxSessionMapperFactory.java |  2 +-
 .../apache/james/mailbox/maildir/MaildirId.java |  2 +-
 .../MaildirMailboxSessionMapperFactory.java |  2 +-
 .../james/mailbox/inmemory/InMemoryId.java  |  2 +-
 .../InMemoryMailboxSessionMapperFactory.java|  2 +-
 .../store/MailboxSessionMapperFactory.java  |  2 +-
 .../store/mail/model/DefaultMessageId.java  |  2 ++
 .../james/mailbox/store/mail/model/Mailbox.java |  1 +
 .../mailbox/store/mail/model/MailboxId.java | 23 
 .../store/mail/model/MailboxIdDeserializer.java |  2 ++
 .../store/mail/model/MailboxMessage.java|  2 ++
 .../store/mail/model/impl/SimpleMailbox.java|  2 +-
 .../mail/model/impl/SimpleMailboxMessage.java   |  2 +-
 .../store/search/LazyMessageSearchIndex.java|  2 +-
 .../StoreMailboxManagerAnnotationTest.java  |  2 +-
 .../org/apache/james/mailbox/store/TestId.java  |  2 +-
 .../store/mail/model/MapperProvider.java|  1 +
 .../store/mail/model/MessageMapperTest.java |  1 +
 .../store/mail/model/MessageMoveTest.java   |  1 +
 .../mailbox/store/mail/ZooUidProvider.java  |  2 +-
 .../mailbox/store/mail/ZooUidProviderTest.java  |  2 +-
 .../integration/GetMessageListMethodTest.java   |  2 +-
 .../methods/SetMessagesCreationProcessor.java   |  2 +-
 .../jmap/utils/SortToComparatorConvertor.java   |  2 +-
 .../james/jmap/utils/MailboxUtilsTest.java  |  2 +-
 35 files changed, 59 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/james-project/blob/73b2da08/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
--
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
new file mode 100644
index 000..7410b4e
--- /dev/null
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxId.java
@@ -0,0 +1,23 @@
+/
+ * 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.model;
+
+public interface MailboxId {
+String serialize();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/73b2da08/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java
--
diff --git