You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ad...@apache.org on 2016/07/04 14:46:16 UTC
[1/5] james-project git commit: JAMES-1788 Advertise the new JMAP
Upload endpoint
Repository: james-project
Updated Branches:
refs/heads/master aba9b9213 -> 57edcaa4f
JAMES-1788 Advertise the new JMAP Upload endpoint
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/447b5dc8
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/447b5dc8
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/447b5dc8
Branch: refs/heads/master
Commit: 447b5dc882b94b103792c8a359032a7a7511e224
Parents: bdd8415
Author: Raphael Ouazana <ra...@linagora.com>
Authored: Thu Jun 30 17:08:19 2016 +0200
Committer: Raphael Ouazana <ra...@linagora.com>
Committed: Mon Jul 4 14:57:37 2016 +0200
----------------------------------------------------------------------
.../test/java/org/apache/james/jmap/JMAPAuthenticationTest.java | 4 ++--
.../main/java/org/apache/james/jmap/AuthenticationServlet.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/447b5dc8/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index 60ccaf9..cd17481 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -285,7 +285,7 @@ public abstract class JMAPAuthenticationTest {
.body("accessToken", isA(String.class))
.body("api", equalTo("/jmap"))
.body("eventSource", both(isA(String.class)).and(notNullValue()))
- .body("upload", both(isA(String.class)).and(notNullValue()))
+ .body("upload", equalTo("/upload"))
.body("download", equalTo("/download"));
}
@@ -321,7 +321,7 @@ public abstract class JMAPAuthenticationTest {
.statusCode(200)
.body("api", equalTo("/jmap"))
.body("eventSource", both(isA(String.class)).and(notNullValue()))
- .body("upload", both(isA(String.class)).and(notNullValue()))
+ .body("upload", equalTo("/upload"))
.body("download", equalTo("/download"));
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/447b5dc8/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
index 06c5395..7b0e187 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
@@ -184,7 +184,7 @@ public class AuthenticationServlet extends HttpServlet {
.accessToken(accessTokenManager.grantAccessToken(username))
.api(JMAPUrls.JMAP)
.eventSource("/notImplemented")
- .upload("/notImplemented")
+ .upload(JMAPUrls.UPLOAD)
.download(JMAPUrls.DOWNLOAD)
.build();
mapper.writeValue(resp.getOutputStream(), response);
@@ -197,7 +197,7 @@ public class AuthenticationServlet extends HttpServlet {
.builder()
.api(JMAPUrls.JMAP)
.eventSource("/notImplemented")
- .upload("/notImplemented")
+ .upload(JMAPUrls.UPLOAD)
.download(JMAPUrls.DOWNLOAD)
.build();
mapper.writeValue(resp.getOutputStream(), response);
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[2/5] james-project git commit: JAMES-1788 Introduce the upload
endpoint
Posted by ad...@apache.org.
JAMES-1788 Introduce the upload endpoint
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/bdd8415c
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/bdd8415c
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/bdd8415c
Branch: refs/heads/master
Commit: bdd8415c3f7b533bb1a3393f2fd37f71247c957a
Parents: f26d8cb
Author: Raphael Ouazana <ra...@linagora.com>
Authored: Thu Jun 30 17:04:57 2016 +0200
Committer: Raphael Ouazana <ra...@linagora.com>
Committed: Mon Jul 4 14:57:37 2016 +0200
----------------------------------------------------------------------
.../cucumber/CassandraUploadCucumberTest.java | 33 ++++++++
.../integration/cucumber/UploadStepdefs.java | 85 ++++++++++++++++++++
.../resources/cucumber/UploadEndpoint.feature | 23 ++++++
.../cucumber/MemoryUploadCucumberTest.java | 33 ++++++++
.../java/org/apache/james/jmap/JMAPServer.java | 7 +-
.../java/org/apache/james/jmap/JMAPUrls.java | 1 +
.../org/apache/james/jmap/UploadServlet.java | 34 ++++++++
7 files changed, 215 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraUploadCucumberTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraUploadCucumberTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraUploadCucumberTest.java
new file mode 100644
index 0000000..10e5d6c
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraUploadCucumberTest.java
@@ -0,0 +1,33 @@
+/****************************************************************
+ * 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.jmap.cassandra.cucumber;
+
+import org.junit.runner.RunWith;
+
+import cucumber.api.CucumberOptions;
+import cucumber.api.junit.Cucumber;
+
+@RunWith(Cucumber.class)
+@CucumberOptions(features={"classpath:cucumber/UploadEndpoint.feature"},
+ glue={"org.apache.james.jmap.methods.integration", "org.apache.james.jmap.cassandra.cucumber"},
+ tags = {"~@Ignore"},
+ strict = true)
+public class CassandraUploadCucumberTest {
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
new file mode 100644
index 0000000..bb31263
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
@@ -0,0 +1,85 @@
+/****************************************************************
+ * 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.jmap.methods.integration.cucumber;
+
+import static com.jayway.restassured.RestAssured.with;
+
+import javax.inject.Inject;
+
+import org.apache.james.jmap.api.access.AccessToken;
+
+import com.jayway.restassured.response.Response;
+import com.jayway.restassured.specification.RequestSpecification;
+
+import cucumber.api.java.en.Then;
+import cucumber.api.java.en.When;
+import cucumber.runtime.java.guice.ScenarioScoped;
+
+@ScenarioScoped
+public class UploadStepdefs {
+
+ private final UserStepdefs userStepdefs;
+ private Response response;
+
+ @Inject
+ private UploadStepdefs(UserStepdefs userStepdefs) {
+ this.userStepdefs = userStepdefs;
+ }
+
+ @When("^\"([^\"]*)\" upload a content$")
+ public void userUploadContent(String username) throws Throwable {
+ AccessToken accessToken = userStepdefs.tokenByUser.get(username);
+ RequestSpecification with = with();
+ if (accessToken != null) {
+ with.header("Authorization", accessToken.serialize());
+ }
+ response = with
+ .post("/upload");
+ }
+
+ @When("^\"([^\"]*)\" checks for the availability of the upload endpoint$")
+ public void optionUpload(String username) throws Throwable {
+ AccessToken accessToken = userStepdefs.tokenByUser.get(username);
+ RequestSpecification with = with();
+ if (accessToken != null) {
+ with.header("Authorization", accessToken.serialize());
+ }
+ response = with
+ .options("/upload");
+ }
+
+ @Then("^the user should receive an authorized response$")
+ public void httpAuthorizedStatus() throws Exception {
+ response.then()
+ .statusCode(200);
+ }
+
+ @Then("^the user should receive a created response$")
+ public void httpCreatedStatus() throws Exception {
+ response.then()
+ .statusCode(201);
+ }
+
+ @Then("^the user should receive a not authorized response$")
+ public void httpUnauthorizedStatus() throws Exception {
+ response.then()
+ .statusCode(401);
+ }
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
new file mode 100644
index 0000000..6564f60
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
@@ -0,0 +1,23 @@
+Feature: An upload endpoint should be available to upload contents
+ As a James user
+ I want to upload my attachments
+
+ Background:
+ Given a domain named "domain.tld"
+ And a connected user "username@domain.tld"
+
+ Scenario: An authenticated user should initiate the access to the upload endpoint
+ When "username@domain.tld" checks for the availability of the upload endpoint
+ Then the user should receive an authorized response
+
+ Scenario: An unauthenticated user should initiate the access to the download endpoint
+ When "non-authenticated@domain.tld" checks for the availability of the upload endpoint
+ Then the user should receive an authorized response
+
+ Scenario: Uploading a content without being authenticated
+ When "non-authenticated@domain.tld" upload a content
+ Then the user should receive a not authorized response
+
+ Scenario: Uploading a content being authenticated
+ When "username@domain.tld" upload a content
+ Then the user should receive a created response
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryUploadCucumberTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryUploadCucumberTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryUploadCucumberTest.java
new file mode 100644
index 0000000..25b123e
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryUploadCucumberTest.java
@@ -0,0 +1,33 @@
+/****************************************************************
+ * 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.jmap.memory.cucumber;
+
+import org.junit.runner.RunWith;
+
+import cucumber.api.CucumberOptions;
+import cucumber.api.junit.Cucumber;
+
+@RunWith(Cucumber.class)
+@CucumberOptions(features={"classpath:cucumber/UploadEndpoint.feature"},
+ glue={"org.apache.james.jmap.methods.integration", "org.apache.james.jmap.memory.cucumber"},
+ tags = {"~@Ignore"},
+ strict = true)
+public class MemoryUploadCucumberTest {
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
index 1728d0a..7d235a4 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
@@ -39,7 +39,7 @@ public class JMAPServer implements Configurable {
@Inject
private JMAPServer(JMAPConfiguration jmapConfiguration,
- AuthenticationServlet authenticationServlet, JMAPServlet jmapServlet, DownloadServlet downloadServlet,
+ AuthenticationServlet authenticationServlet, JMAPServlet jmapServlet, DownloadServlet downloadServlet, UploadServlet uploadServlet,
AuthenticationFilter authenticationFilter, FirstUserConnectionFilter firstUserConnectionFilter) {
server = JettyHttpServer.create(
@@ -60,6 +60,11 @@ public class JMAPServer implements Configurable {
.filterAsOneLevelTemplate(JMAPUrls.DOWNLOAD)
.with(new AllowAllCrossOriginRequests(bypass(authenticationFilter).on("GET").and("OPTIONS").only()))
.only()
+ .serve(JMAPUrls.UPLOAD)
+ .with(uploadServlet)
+ .filterAsOneLevelTemplate(JMAPUrls.UPLOAD)
+ .with(new AllowAllCrossOriginRequests(bypass(authenticationFilter).on("OPTIONS").only()))
+ .only()
.build());
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
index 9d96ccd..563b090 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
@@ -24,4 +24,5 @@ public interface JMAPUrls {
String JMAP = "/jmap";
String AUTHENTICATION = "/authentication";
String DOWNLOAD = "/download";
+ String UPLOAD = "/upload";
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/bdd8415c/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
new file mode 100644
index 0000000..c7e9ed0
--- /dev/null
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.jmap;
+
+import static javax.servlet.http.HttpServletResponse.SC_CREATED;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class UploadServlet extends HttpServlet {
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
+ resp.setStatus(SC_CREATED);
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[4/5] james-project git commit: JAMES-1788 Ignoring size limit
control for now
Posted by ad...@apache.org.
JAMES-1788 Ignoring size limit control for now
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/5fc0e783
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/5fc0e783
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/5fc0e783
Branch: refs/heads/master
Commit: 5fc0e7831796084d9ef2c132156dd17f423d1a28
Parents: 447b5dc
Author: Raphael Ouazana <ra...@linagora.com>
Authored: Fri Jul 1 14:56:17 2016 +0200
Committer: Raphael Ouazana <ra...@linagora.com>
Committed: Mon Jul 4 14:57:38 2016 +0200
----------------------------------------------------------------------
.../integration/cucumber/UploadStepdefs.java | 47 ++++++++++++++++++++
.../resources/cucumber/UploadEndpoint.feature | 5 +++
2 files changed, 52 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/5fc0e783/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
index bb31263..10023ac 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
@@ -21,10 +21,14 @@ package org.apache.james.jmap.methods.integration.cucumber;
import static com.jayway.restassured.RestAssured.with;
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+
import javax.inject.Inject;
import org.apache.james.jmap.api.access.AccessToken;
+import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.response.Response;
import com.jayway.restassured.specification.RequestSpecification;
@@ -34,6 +38,8 @@ import cucumber.runtime.java.guice.ScenarioScoped;
@ScenarioScoped
public class UploadStepdefs {
+ private static final int _1M = 1024 * 1024;
+ private static final int _10M = 10 * _1M;
private final UserStepdefs userStepdefs;
private Response response;
@@ -54,6 +60,19 @@ public class UploadStepdefs {
.post("/upload");
}
+ @When("^\"([^\"]*)\" upload a too big content$")
+ public void userUploadTooBigContent(String username) throws Throwable {
+ AccessToken accessToken = userStepdefs.tokenByUser.get(username);
+ RequestSpecification with = with();
+ if (accessToken != null) {
+ with.header("Authorization", accessToken.serialize());
+ }
+ response = with
+ .contentType(ContentType.BINARY)
+ .content(new BufferedInputStream(new ZeroedInputStream(_10M), _10M))
+ .post("/upload");
+ }
+
@When("^\"([^\"]*)\" checks for the availability of the upload endpoint$")
public void optionUpload(String username) throws Throwable {
AccessToken accessToken = userStepdefs.tokenByUser.get(username);
@@ -82,4 +101,32 @@ public class UploadStepdefs {
response.then()
.statusCode(401);
}
+
+ @Then("^the user should receive a request entity too large response$")
+ public void httpRequestEntityTooBigStatus() throws Exception {
+ response.then()
+ .statusCode(413);
+ }
+
+ public static class ZeroedInputStream extends InputStream {
+ public static final int RETURNED_VALUE = 0;
+
+ private final int max;
+ private int pos;
+
+ public ZeroedInputStream(int max) {
+ this.max = max;
+ this.pos = 0;
+ }
+
+ @Override
+ public int read() {
+ if (pos < max) {
+ pos++;
+ return RETURNED_VALUE;
+ }
+ return -1;
+ }
+ }
+
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/5fc0e783/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
index 6564f60..1379ddf 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
@@ -18,6 +18,11 @@ Feature: An upload endpoint should be available to upload contents
When "non-authenticated@domain.tld" upload a content
Then the user should receive a not authorized response
+ @Ignore
+ Scenario: Uploading a too big content
+ When "username@domain.tld" upload a too big content
+ Then the user should receive a request entity too large response
+
Scenario: Uploading a content being authenticated
When "username@domain.tld" upload a content
Then the user should receive a created response
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[5/5] james-project git commit: JAMES-1788 Store uploaded content
Posted by ad...@apache.org.
JAMES-1788 Store uploaded content
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/57edcaa4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/57edcaa4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/57edcaa4
Branch: refs/heads/master
Commit: 57edcaa4fa2021199c102c3c28ffd5fba179d3de
Parents: 5fc0e78
Author: Raphael Ouazana <ra...@linagora.com>
Authored: Fri Jul 1 17:33:31 2016 +0200
Committer: Raphael Ouazana <ra...@linagora.com>
Committed: Mon Jul 4 14:57:38 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/james/jmap/JMAPModule.java | 1 +
.../integration/cucumber/UploadStepdefs.java | 53 ++++++-
.../resources/cucumber/UploadEndpoint.feature | 13 ++
.../org/apache/james/jmap/UploadHandler.java | 75 ++++++++++
.../org/apache/james/jmap/UploadServlet.java | 32 ++++-
.../apache/james/jmap/model/UploadResponse.java | 144 +++++++++++++++++++
6 files changed, 315 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/57edcaa4/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
index bc27408..6fd9c1f 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -59,6 +59,7 @@ public class JMAPModule extends AbstractModule {
install(new MethodsModule());
bind(JMAPServer.class).in(Scopes.SINGLETON);
bind(RequestHandler.class).in(Scopes.SINGLETON);
+ bind(UploadHandler.class).in(Scopes.SINGLETON);
bind(MailboxBasedHtmlTextExtractor.class).in(Scopes.SINGLETON);
bind(HtmlTextExtractor.class).to(MailboxBasedHtmlTextExtractor.class);
http://git-wip-us.apache.org/repos/asf/james-project/blob/57edcaa4/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
index 10023ac..4d97af4 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
@@ -20,6 +20,8 @@
package org.apache.james.jmap.methods.integration.cucumber;
import static com.jayway.restassured.RestAssured.with;
+import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
+import static org.hamcrest.Matchers.equalTo;
import java.io.BufferedInputStream;
import java.io.InputStream;
@@ -28,6 +30,9 @@ import javax.inject.Inject;
import org.apache.james.jmap.api.access.AccessToken;
+import com.google.common.base.Charsets;
+import com.jayway.restassured.config.EncoderConfig;
+import com.jayway.restassured.config.RestAssuredConfig;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.response.Response;
import com.jayway.restassured.specification.RequestSpecification;
@@ -38,6 +43,8 @@ import cucumber.runtime.java.guice.ScenarioScoped;
@ScenarioScoped
public class UploadStepdefs {
+ private static final RestAssuredConfig NO_CHARSET = newConfig().encoderConfig(EncoderConfig.encoderConfig().appendDefaultContentCharsetToContentTypeIfUndefined(false));
+ private static final String _1M_ZEROED_FILE_BLOB_ID = "3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3";
private static final int _1M = 1024 * 1024;
private static final int _10M = 10 * _1M;
@@ -57,6 +64,23 @@ public class UploadStepdefs {
with.header("Authorization", accessToken.serialize());
}
response = with
+ .config(NO_CHARSET)
+ .contentType(ContentType.BINARY)
+ .content(new BufferedInputStream(new ZeroedInputStream(_1M), _1M))
+ .post("/upload");
+ }
+
+ @When("^\"([^\"]*)\" upload a content without content type$")
+ public void userUploadContentWithoutContentType(String username) throws Throwable {
+ AccessToken accessToken = userStepdefs.tokenByUser.get(username);
+ RequestSpecification with = with();
+ if (accessToken != null) {
+ with.header("Authorization", accessToken.serialize());
+ }
+ response = with
+ .config(NO_CHARSET)
+ .contentType("")
+ .content("some text".getBytes(Charsets.UTF_8))
.post("/upload");
}
@@ -96,6 +120,12 @@ public class UploadStepdefs {
.statusCode(201);
}
+ @Then("^the user should receive bad request response$")
+ public void httpBadRequestStatus() throws Throwable {
+ response.then()
+ .statusCode(400);
+ }
+
@Then("^the user should receive a not authorized response$")
public void httpUnauthorizedStatus() throws Exception {
response.then()
@@ -108,6 +138,28 @@ public class UploadStepdefs {
.statusCode(413);
}
+ @Then("^the user should receive a specified JSON content$")
+ public void jsonResponse() throws Exception {
+ response.then()
+ .contentType(ContentType.JSON)
+ .body("blobId", equalTo(_1M_ZEROED_FILE_BLOB_ID))
+ .body("type", equalTo("application/octet-stream"))
+ .body("size", equalTo(_1M));
+ }
+
+ @Then("^\"([^\"]*)\" should be able to retrieve the content$")
+ public void contentShouldBeRetrievable(String username) throws Exception {
+ AccessToken accessToken = userStepdefs.tokenByUser.get(username);
+ RequestSpecification with = with();
+ if (accessToken != null) {
+ with.header("Authorization", accessToken.serialize());
+ }
+ with
+ .get("/download/" + _1M_ZEROED_FILE_BLOB_ID)
+ .then()
+ .statusCode(200);
+ }
+
public static class ZeroedInputStream extends InputStream {
public static final int RETURNED_VALUE = 0;
@@ -128,5 +180,4 @@ public class UploadStepdefs {
return -1;
}
}
-
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/57edcaa4/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
index 1379ddf..4edb949 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
@@ -26,3 +26,16 @@ Feature: An upload endpoint should be available to upload contents
Scenario: Uploading a content being authenticated
When "username@domain.tld" upload a content
Then the user should receive a created response
+
+ Scenario: Uploading a content without content type should be denied
+ When "username@domain.tld" upload a content without content type
+ Then the user should receive bad request response
+
+ Scenario: Uploading a content, the content should be retrievable
+ When "username@domain.tld" upload a content
+ Then "username@domain.tld" should be able to retrieve the content
+
+ Scenario: Uploading a content, the server should respond specified JSON
+ When "username@domain.tld" upload a content
+ Then the user should receive a specified JSON content
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/james-project/blob/57edcaa4/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadHandler.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadHandler.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadHandler.java
new file mode 100644
index 0000000..1bd5af3
--- /dev/null
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadHandler.java
@@ -0,0 +1,75 @@
+/****************************************************************
+ * 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.jmap;
+
+import static javax.servlet.http.HttpServletResponse.SC_CREATED;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.james.jmap.json.ObjectMapperFactory;
+import org.apache.james.jmap.model.UploadResponse;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
+import org.apache.james.mailbox.store.mail.AttachmentMapper;
+import org.apache.james.mailbox.store.mail.model.Attachment;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.io.ByteStreams;
+
+public class UploadHandler {
+ private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
+ private final ObjectMapper objectMapper;
+
+ @Inject
+ private UploadHandler(MailboxSessionMapperFactory mailboxSessionMapperFactory, ObjectMapperFactory objectMapperFactory) {
+ this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
+ this.objectMapper = objectMapperFactory.forWriting();
+ }
+
+ public void handle(String contentType, InputStream content, HttpServletResponse response) throws IOException, MailboxException {
+ UploadResponse storedContent = uploadContent(contentType, content);
+ buildResponse(response, storedContent);
+ }
+
+ private UploadResponse uploadContent(String contentType, InputStream inputStream) throws IOException, MailboxException {
+ MailboxSession session = null;
+ AttachmentMapper attachmentMapper = mailboxSessionMapperFactory.createAttachmentMapper(session);
+ Attachment attachment = Attachment.builder()
+ .bytes(ByteStreams.toByteArray(inputStream))
+ .type(contentType)
+ .build();
+ attachmentMapper.storeAttachment(attachment);
+ return UploadResponse.builder()
+ .blobId(attachment.getAttachmentId().getId())
+ .type(attachment.getType())
+ .size(attachment.getSize())
+ .build();
+ }
+
+ private void buildResponse(HttpServletResponse resp, UploadResponse storedContent) throws IOException {
+ resp.setContentType(JMAPServlet.JSON_CONTENT_TYPE_UTF8);
+ resp.setStatus(SC_CREATED);
+ objectMapper.writeValue(resp.getOutputStream(), storedContent);
+ }
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/57edcaa4/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
index c7e9ed0..a0635a3 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UploadServlet.java
@@ -18,17 +18,45 @@
****************************************************************/
package org.apache.james.jmap;
-import static javax.servlet.http.HttpServletResponse.SC_CREATED;
+import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
+import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+import java.io.IOException;
+
+import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Strings;
+
public class UploadServlet extends HttpServlet {
+ private static final Logger LOGGER = LoggerFactory.getLogger(UploadServlet.class);
+
+ private final UploadHandler uploadHandler;
+
+ @Inject
+ private UploadServlet(UploadHandler uploadHandler) {
+ this.uploadHandler = uploadHandler;
+ }
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
- resp.setStatus(SC_CREATED);
+ String contentType = req.getContentType();
+ if (Strings.isNullOrEmpty(contentType)) {
+ resp.setStatus(SC_BAD_REQUEST);
+ } else {
+ try {
+ uploadHandler.handle(contentType, req.getInputStream(), resp);
+ } catch (IOException | MailboxException e) {
+ LOGGER.error("Error while uploading content", e);
+ resp.setStatus(SC_INTERNAL_SERVER_ERROR);
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/57edcaa4/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/UploadResponse.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/UploadResponse.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/UploadResponse.java
new file mode 100644
index 0000000..1868122
--- /dev/null
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/UploadResponse.java
@@ -0,0 +1,144 @@
+/****************************************************************
+ * 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.jmap.model;
+
+import java.time.ZonedDateTime;
+import java.util.Optional;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+
+@JsonDeserialize(builder = UploadResponse.Builder.class)
+public class UploadResponse {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonPOJOBuilder(withPrefix = "")
+ public static class Builder {
+ private String accountId;
+ private String blobId;
+ private String type;
+ private Long size;
+ private ZonedDateTime expires;
+
+ public Builder accountId(String accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ public Builder blobId(String blobId) {
+ this.blobId = blobId;
+ return this;
+ }
+
+ public Builder type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public Builder size(long size) {
+ this.size = size;
+ return this;
+ }
+
+ public Builder expires(ZonedDateTime expires) {
+ this.expires = expires;
+ return this;
+ }
+
+ public UploadResponse build() {
+ Preconditions.checkState(!Strings.isNullOrEmpty(blobId), "'blobId' is mandatory");
+ Preconditions.checkState(!Strings.isNullOrEmpty(type), "'type' is mandatory");
+ Preconditions.checkState(size != null, "'size' is mandatory");
+ return new UploadResponse(Optional.ofNullable(accountId), blobId, type, size, Optional.ofNullable(expires));
+ }
+ }
+
+ private final Optional<String> accountId;
+ private final String blobId;
+ private final String type;
+ private final Long size;
+ private final Optional<ZonedDateTime> expires;
+
+ @VisibleForTesting UploadResponse(Optional<String> accountId, String blobId, String type, long size, Optional<ZonedDateTime> expires) {
+ this.accountId = accountId;
+ this.blobId = blobId;
+ this.type = type;
+ this.size = size;
+ this.expires = expires;
+ }
+
+ public Optional<String> getAccountId() {
+ return accountId;
+ }
+
+ public String getBlobId() {
+ return blobId;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public long getSize() {
+ return size;
+ }
+
+ public Optional<ZonedDateTime> getExpires() {
+ return expires;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof UploadResponse) {
+ UploadResponse other = (UploadResponse) obj;
+ return Objects.equal(accountId, accountId)
+ && Objects.equal(blobId, other.blobId)
+ && Objects.equal(type, other.type)
+ && Objects.equal(size, other.size)
+ && Objects.equal(expires, other.expires);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(accountId, blobId, type, size, expires);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects
+ .toStringHelper(this)
+ .add("accountId", accountId)
+ .add("blobId", blobId)
+ .add("type", type)
+ .add("size", size)
+ .add("expires", expires)
+ .toString();
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[3/5] james-project git commit: JAMES-1783 Add missing Cassandra test
Posted by ad...@apache.org.
JAMES-1783 Add missing Cassandra test
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/f26d8cba
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/f26d8cba
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/f26d8cba
Branch: refs/heads/master
Commit: f26d8cba17e627886625c08a1b40dd1eb9cd0b70
Parents: aba9b92
Author: Raphael Ouazana <ra...@linagora.com>
Authored: Thu Jun 30 16:43:32 2016 +0200
Committer: Raphael Ouazana <ra...@linagora.com>
Committed: Mon Jul 4 14:57:37 2016 +0200
----------------------------------------------------------------------
.../jmap/cassandra/cucumber/CassandraDownloadCucumberTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/f26d8cba/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraDownloadCucumberTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraDownloadCucumberTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraDownloadCucumberTest.java
index bbf56bc..e8c62e6 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraDownloadCucumberTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraDownloadCucumberTest.java
@@ -25,7 +25,7 @@ import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
-@CucumberOptions(features={"classpath:cucumber/DownloadEndpoint.feature", "classpath:cucumber/DownloadGet.feature"},
+@CucumberOptions(features={"classpath:cucumber/DownloadEndpoint.feature", "classpath:cucumber/DownloadGet.feature", "classpath:cucumber/DownloadPost.feature"},
glue={"org.apache.james.jmap.methods.integration", "org.apache.james.jmap.cassandra.cucumber"},
tags = {"~@Ignore"},
strict = true)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org