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 bt...@apache.org on 2019/11/07 06:44:31 UTC

[james-project] branch master updated (2c11c36 -> 78fc056)

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from 2c11c36  Upgrade Linshare images from 2.2.3 to 2.3.2
     new 0be9f77  [Refactoring] fix a typo on AbstractStatusResponseFactory
     new e7ef562  [Refactoring] calling super() when only parent is Object is pointless
     new f727d76  [Refactoring] use the usual naming scheme for test classes
     new 12f8f05  [Refactoring] port AbstractStatusResponseFactoryTest to junit5
     new 2a0f6e6  [Refactoring] implement the one-action-per-test golden rule
     new 84f817f  JAMES-2971 Let the caller of Event Delivery decide where and how to execute the delivery
     new 918abe0  JAMES-2970 Add SetErrorMessage mailet
     new 0cb21fd  JAMES-2956 Fix a typo in webadmin documentation
     new 0cbbc88  JAMES-2961 Document SSL security within RemoteDelivery javaDoc
     new ce4405f  JAMES-2961 Link remoteDelivery in security section for outgoing SMTP
     new 0720c9a  JAMES-2961 Document startTls configuration for remoteDelivery
     new 78fc056  JAMES-2945 Make Sender case insensitive in SMTP

The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../mailbox/events/delivery/InVmEventDelivery.java |   5 -
 .../james/transport/mailets/SetErrorMessage.java   |  22 ++--
 .../transport/mailets/SetErrorMessageTest.java     |  86 ++++++++++++++
 ...ory.java => AbstractStatusResponseFactory.java} |   5 +-
 .../response/UnpooledStatusResponseFactory.java    |   2 +-
 ...java => AbstractStatusResponseFactoryTest.java} | 130 ++++++++++++---------
 .../UnpooledStatusResponseFactoryTest.java         |  20 +++-
 ...ractSenderAuthIdentifyVerificationRcptHook.java |  12 +-
 .../james/mailets/SmtpAuthIntegrationTest.java     |  11 ++
 .../james/transport/mailets/RemoteDelivery.java    |  14 ++-
 .../SenderAuthIdentifyVerificationRcptHook.java    |   9 ++
 src/site/markdown/server/manage-webadmin.md        |   2 +-
 src/site/xdoc/server/feature-security.xml          |   3 +
 13 files changed, 228 insertions(+), 93 deletions(-)
 copy server/container/guice/testing/custom-mailets/src/main/java/org/apache/james/transport/mailets/CustomMailetWithCustomDependencyInConstructor.java => mailet/standard/src/main/java/org/apache/james/transport/mailets/SetErrorMessage.java (77%)
 create mode 100644 mailet/standard/src/test/java/org/apache/james/transport/mailets/SetErrorMessageTest.java
 rename protocols/imap/src/main/java/org/apache/james/imap/message/response/{AbstactStatusResponseFactory.java => AbstractStatusResponseFactory.java} (96%)
 rename protocols/imap/src/test/java/org/apache/james/imap/api/message/response/{AbstractTestForStatusResponseFactory.java => AbstractStatusResponseFactoryTest.java} (68%)


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


[james-project] 07/12: JAMES-2970 Add SetErrorMessage mailet

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 918abe0426a1cab6dd368a55e33bda92a66bebcb
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Nov 6 14:38:03 2019 +0700

    JAMES-2970 Add SetErrorMessage mailet
    
    This allows one to position errorMessage on email through mailetContainer.xml
    configuration.
    
    This is usefull also to "simulate" emails with errorMessage set for feature development.
---
 .../james/transport/mailets/SetErrorMessage.java   | 41 +++++++++++
 .../transport/mailets/SetErrorMessageTest.java     | 86 ++++++++++++++++++++++
 2 files changed, 127 insertions(+)

diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/SetErrorMessage.java b/mailet/standard/src/main/java/org/apache/james/transport/mailets/SetErrorMessage.java
new file mode 100644
index 0000000..d6acfb4
--- /dev/null
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/SetErrorMessage.java
@@ -0,0 +1,41 @@
+/****************************************************************
+ * 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.transport.mailets;
+
+import javax.mail.MessagingException;
+
+import org.apache.mailet.Mail;
+import org.apache.mailet.base.GenericMailet;
+
+public class SetErrorMessage extends GenericMailet {
+    private String errorMessage;
+
+    @Override
+    public void init() throws MessagingException {
+        errorMessage = getInitParameterAsOptional("errorMessage")
+            .filter(string -> !string.isEmpty())
+            .orElseThrow(() -> new IllegalStateException("'errorMessage' needs to be specified and cannot be empty"));
+    }
+
+    @Override
+    public void service(Mail mail) throws MessagingException {
+        mail.setErrorMessage(errorMessage);
+    }
+}
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/SetErrorMessageTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/SetErrorMessageTest.java
new file mode 100644
index 0000000..ec5e2d2
--- /dev/null
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/SetErrorMessageTest.java
@@ -0,0 +1,86 @@
+/****************************************************************
+ * 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.transport.mailets;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import org.apache.mailet.Mailet;
+import org.apache.mailet.base.test.FakeMail;
+import org.apache.mailet.base.test.FakeMailetConfig;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+class SetErrorMessageTest {
+    private static final String MY_MESSAGE = "my message";
+
+    private Mailet testee;
+
+    @BeforeEach
+    void setUp() {
+        testee = new SetErrorMessage();
+    }
+
+    @Test
+    void initShouldThrowWhenNoErrorMessage() {
+        assertThatThrownBy(() -> testee.init(FakeMailetConfig.builder().build()))
+            .isInstanceOf(IllegalStateException.class)
+            .hasMessage("'errorMessage' needs to be specified and cannot be empty");
+    }
+
+    @Test
+    void initShouldThrowOnEmptyErrorMessage() {
+        assertThatThrownBy(() ->
+            testee.init(FakeMailetConfig.builder()
+                .setProperty("errorMessage", "")
+                .build()))
+            .isInstanceOf(IllegalStateException.class)
+            .hasMessage("'errorMessage' needs to be specified and cannot be empty");
+    }
+
+    @Test
+    void serviceShouldPositionErrorMessage() throws Exception {
+        testee.init(FakeMailetConfig.builder()
+            .setProperty("errorMessage", MY_MESSAGE)
+            .build());
+
+        FakeMail myMail = FakeMail.builder()
+            .name("myMail")
+            .build();
+        testee.service(myMail);
+
+        assertThat(myMail.getErrorMessage()).isEqualTo(MY_MESSAGE);
+    }
+
+    @Test
+    void serviceShouldOverwriteErrorMessage() throws Exception {
+        testee.init(FakeMailetConfig.builder()
+            .setProperty("errorMessage", MY_MESSAGE)
+            .build());
+
+        FakeMail myMail = FakeMail.builder()
+            .name("myMail")
+            .errorMessage("Old error message")
+            .build();
+        testee.service(myMail);
+
+        assertThat(myMail.getErrorMessage()).isEqualTo(MY_MESSAGE);
+    }
+}
\ No newline at end of file


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


[james-project] 05/12: [Refactoring] implement the one-action-per-test golden rule

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 2a0f6e68ff4e2c9ab89a2af46de2aa94debb7a81
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Nov 6 15:37:40 2019 +0100

    [Refactoring] implement the one-action-per-test golden rule
---
 .../AbstractStatusResponseFactoryTest.java         | 72 +++++++++++++++-------
 1 file changed, 51 insertions(+), 21 deletions(-)

diff --git a/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java b/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
index e76e2fe..22fd26c 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
@@ -35,7 +35,7 @@ public interface AbstractStatusResponseFactoryTest {
     StatusResponseFactory factory();
     
     @Test
-    default void testTaggedOk() {
+    default void taggedOkShouldBuildCorrectResponse() {
         StatusResponse response = factory().taggedOk(TAG, COMMAND, KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
@@ -43,7 +43,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getCommand()).isEqualTo(COMMAND);
         assertThat(response.getResponseCode()).isNull();
-        response = factory().taggedOk(TAG, COMMAND, KEY, CODE);
+    }
+
+    @Test
+    default void taggedOkWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().taggedOk(TAG, COMMAND, KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
         assertThat(response.getTag()).isEqualTo(TAG);
@@ -53,7 +57,7 @@ public interface AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    default void testTaggedNo() {
+    default void taggedNoShouldBuildCorrectResponse() {
         StatusResponse response = factory().taggedNo(TAG, COMMAND, KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
@@ -61,7 +65,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getCommand()).isEqualTo(COMMAND);
         assertThat(response.getResponseCode()).isNull();
-        response = factory().taggedNo(TAG, COMMAND, KEY, CODE);
+    }
+
+    @Test
+    default void taggedNoWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().taggedNo(TAG, COMMAND, KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
         assertThat(response.getTag()).isEqualTo(TAG);
@@ -69,9 +77,9 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getResponseCode()).isEqualTo(CODE);
         assertThat(response.getCommand()).isEqualTo(COMMAND);
     }
-    
+
     @Test
-    default void testTaggedBad() {
+    default void taggedBadShouldBuildCorrectResponse() {
         StatusResponse response = factory().taggedBad(TAG, COMMAND, KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
@@ -79,7 +87,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isEqualTo(COMMAND);
-        response = factory().taggedBad(TAG, COMMAND, KEY, CODE);
+    }
+
+    @Test
+    default void taggedBadWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().taggedBad(TAG, COMMAND, KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
         assertThat(response.getTag()).isEqualTo(TAG);
@@ -89,7 +101,7 @@ public interface AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    default void testUntaggedOk() {
+    default void untaggedOkShouldBuildCorrectResponse() {
         StatusResponse response = factory().untaggedOk(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
@@ -97,7 +109,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory().untaggedOk(KEY, CODE);
+    }
+
+    @Test
+    default void untaggedOkWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().untaggedOk(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
         assertThat(response.getTag()).isNull();
@@ -108,7 +124,7 @@ public interface AbstractStatusResponseFactoryTest {
 
 
     @Test
-    default void testUntaggedNo() {
+    default void untaggedNoShouldBuildCorrectResponse() {
         StatusResponse response = factory().untaggedNo(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
@@ -116,7 +132,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory().untaggedNo(KEY, CODE);
+    }
+
+    @Test
+    default void untaggedNoWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().untaggedNo(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
         assertThat(response.getTag()).isNull();
@@ -126,7 +146,7 @@ public interface AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    default void testUntaggedBad() {
+    default void untaggedBadShouldBuildCorrectResponse() {
         StatusResponse response = factory().untaggedBad(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
@@ -134,7 +154,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory().untaggedBad(KEY, CODE);
+    }
+
+    @Test
+    default void untaggedBadWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().untaggedBad(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
         assertThat(response.getTag()).isNull();
@@ -144,19 +168,21 @@ public interface AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    default void testPreauth() {
+    default void preauthShouldBuildCorrectResponse() {
         StatusResponse response = factory().preauth(KEY);
         assertThat(response).isNotNull();
-        assertThat(response
-                .getServerResponseType()).isEqualTo(StatusResponse.Type.PREAUTH);
+        assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.PREAUTH);
         assertThat(response.getTag()).isNull();
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory().preauth(KEY, CODE);
+    }
+
+    @Test
+    default void preauthWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().preauth(KEY, CODE);
         assertThat(response).isNotNull();
-        assertThat(response
-                .getServerResponseType()).isEqualTo(StatusResponse.Type.PREAUTH);
+        assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.PREAUTH);
         assertThat(response.getTag()).isNull();
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isEqualTo(CODE);
@@ -164,7 +190,7 @@ public interface AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    default void testBye() {
+    default void byeShouldBuildCorrectResponse() {
         StatusResponse response = factory().bye(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BYE);
@@ -172,7 +198,11 @@ public interface AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory().bye(KEY, CODE);
+    }
+
+    @Test
+    default void byeWithCodeShouldBuildCorrectResponse() {
+        StatusResponse response = factory().bye(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BYE);
         assertThat(response.getTag()).isNull();


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


[james-project] 04/12: [Refactoring] port AbstractStatusResponseFactoryTest to junit5

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 12f8f054e79a3f7053e244bc73b96e7a01d771e2
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Nov 6 15:31:00 2019 +0100

    [Refactoring] port AbstractStatusResponseFactoryTest to junit5
---
 .../AbstractStatusResponseFactoryTest.java         | 90 +++++++++-------------
 .../UnpooledStatusResponseFactoryTest.java         | 17 +++-
 2 files changed, 51 insertions(+), 56 deletions(-)

diff --git a/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java b/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
index b233dc8..e76e2fe 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
@@ -23,95 +23,81 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.display.HumanReadableText;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public abstract class AbstractStatusResponseFactoryTest {
+public interface AbstractStatusResponseFactoryTest {
 
-    private static final String TAG = "ATAG";
-
-    private static final HumanReadableText KEY = new HumanReadableText(
-            "KEY", "TEXT");
-
-    private static final StatusResponse.ResponseCode CODE = StatusResponse.ResponseCode
-            .alert();
-
-    private ImapCommand command;
-
-    StatusResponseFactory factory;
-
-    protected abstract StatusResponseFactory createInstance();
-
-    @Before
-    public void setUp() throws Exception {
-        factory = createInstance();
-        command = ImapCommand.anyStateCommand("Command");
-    }
+    String TAG = "ATAG";
+    HumanReadableText KEY = new HumanReadableText("KEY", "TEXT");
+    StatusResponse.ResponseCode CODE = StatusResponse.ResponseCode.alert();
+    ImapCommand COMMAND = ImapCommand.anyStateCommand("Command");
 
+    StatusResponseFactory factory();
+    
     @Test
-    public void testTaggedOk() {
-        StatusResponse response = factory.taggedOk(TAG, command, KEY);
+    default void testTaggedOk() {
+        StatusResponse response = factory().taggedOk(TAG, COMMAND, KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
         assertThat(response.getTag()).isEqualTo(TAG);
         assertThat(response.getTextKey()).isEqualTo(KEY);
-        assertThat(response.getCommand()).isEqualTo(command);
+        assertThat(response.getCommand()).isEqualTo(COMMAND);
         assertThat(response.getResponseCode()).isNull();
-        response = factory.taggedOk(TAG, command, KEY, CODE);
+        response = factory().taggedOk(TAG, COMMAND, KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
         assertThat(response.getTag()).isEqualTo(TAG);
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isEqualTo(CODE);
-        assertThat(response.getCommand()).isEqualTo(command);
+        assertThat(response.getCommand()).isEqualTo(COMMAND);
     }
 
     @Test
-    public void testTaggedNo() {
-        StatusResponse response = factory.taggedNo(TAG, command, KEY);
+    default void testTaggedNo() {
+        StatusResponse response = factory().taggedNo(TAG, COMMAND, KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
         assertThat(response.getTag()).isEqualTo(TAG);
         assertThat(response.getTextKey()).isEqualTo(KEY);
-        assertThat(response.getCommand()).isEqualTo(command);
+        assertThat(response.getCommand()).isEqualTo(COMMAND);
         assertThat(response.getResponseCode()).isNull();
-        response = factory.taggedNo(TAG, command, KEY, CODE);
+        response = factory().taggedNo(TAG, COMMAND, KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
         assertThat(response.getTag()).isEqualTo(TAG);
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isEqualTo(CODE);
-        assertThat(response.getCommand()).isEqualTo(command);
+        assertThat(response.getCommand()).isEqualTo(COMMAND);
     }
     
     @Test
-    public void testTaggedBad() {
-        StatusResponse response = factory.taggedBad(TAG, command, KEY);
+    default void testTaggedBad() {
+        StatusResponse response = factory().taggedBad(TAG, COMMAND, KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
         assertThat(response.getTag()).isEqualTo(TAG);
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
-        assertThat(response.getCommand()).isEqualTo(command);
-        response = factory.taggedBad(TAG, command, KEY, CODE);
+        assertThat(response.getCommand()).isEqualTo(COMMAND);
+        response = factory().taggedBad(TAG, COMMAND, KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
         assertThat(response.getTag()).isEqualTo(TAG);
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isEqualTo(CODE);
-        assertThat(response.getCommand()).isEqualTo(command);
+        assertThat(response.getCommand()).isEqualTo(COMMAND);
     }
 
     @Test
-    public void testUntaggedOk() {
-        StatusResponse response = factory.untaggedOk(KEY);
+    default void testUntaggedOk() {
+        StatusResponse response = factory().untaggedOk(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
         assertThat(response.getTag()).isNull();
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory.untaggedOk(KEY, CODE);
+        response = factory().untaggedOk(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.OK);
         assertThat(response.getTag()).isNull();
@@ -122,15 +108,15 @@ public abstract class AbstractStatusResponseFactoryTest {
 
 
     @Test
-    public void testUntaggedNo() {
-        StatusResponse response = factory.untaggedNo(KEY);
+    default void testUntaggedNo() {
+        StatusResponse response = factory().untaggedNo(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
         assertThat(response.getTag()).isNull();
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory.untaggedNo(KEY, CODE);
+        response = factory().untaggedNo(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.NO);
         assertThat(response.getTag()).isNull();
@@ -140,15 +126,15 @@ public abstract class AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    public void testUntaggedBad() {
-        StatusResponse response = factory.untaggedBad(KEY);
+    default void testUntaggedBad() {
+        StatusResponse response = factory().untaggedBad(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
         assertThat(response.getTag()).isNull();
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory.untaggedBad(KEY, CODE);
+        response = factory().untaggedBad(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BAD);
         assertThat(response.getTag()).isNull();
@@ -158,8 +144,8 @@ public abstract class AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    public void testPreauth() {
-        StatusResponse response = factory.preauth(KEY);
+    default void testPreauth() {
+        StatusResponse response = factory().preauth(KEY);
         assertThat(response).isNotNull();
         assertThat(response
                 .getServerResponseType()).isEqualTo(StatusResponse.Type.PREAUTH);
@@ -167,7 +153,7 @@ public abstract class AbstractStatusResponseFactoryTest {
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory.preauth(KEY, CODE);
+        response = factory().preauth(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response
                 .getServerResponseType()).isEqualTo(StatusResponse.Type.PREAUTH);
@@ -178,15 +164,15 @@ public abstract class AbstractStatusResponseFactoryTest {
     }
 
     @Test
-    public void testBye() {
-        StatusResponse response = factory.bye(KEY);
+    default void testBye() {
+        StatusResponse response = factory().bye(KEY);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BYE);
         assertThat(response.getTag()).isNull();
         assertThat(response.getTextKey()).isEqualTo(KEY);
         assertThat(response.getResponseCode()).isNull();
         assertThat(response.getCommand()).isNull();
-        response = factory.bye(KEY, CODE);
+        response = factory().bye(KEY, CODE);
         assertThat(response).isNotNull();
         assertThat(response.getServerResponseType()).isEqualTo(StatusResponse.Type.BYE);
         assertThat(response.getTag()).isNull();
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java b/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java
index bd5370d..6447354 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java
@@ -19,15 +19,24 @@
 
 package org.apache.james.imap.message.response;
 
+import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.message.response.AbstractStatusResponseFactoryTest;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
+import org.junit.jupiter.api.BeforeEach;
 
-public class UnpooledStatusResponseFactoryTest extends
-    AbstractStatusResponseFactoryTest {
+class UnpooledStatusResponseFactoryTest implements AbstractStatusResponseFactoryTest {
+
+    StatusResponseFactory factory;
+
+
+    @BeforeEach
+    void setUp() throws Exception {
+        factory = new UnpooledStatusResponseFactory();
+    }
 
     @Override
-    protected StatusResponseFactory createInstance() {
-        return new UnpooledStatusResponseFactory();
+    public StatusResponseFactory factory() {
+        return factory;
     }
 
 }


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


[james-project] 10/12: JAMES-2961 Link remoteDelivery in security section for outgoing SMTP

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit ce4405f62212b0ee7a06d55d15e292071628b0d7
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Nov 4 15:56:29 2019 +0700

    JAMES-2961 Link remoteDelivery in security section for outgoing SMTP
---
 src/site/xdoc/server/feature-security.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/site/xdoc/server/feature-security.xml b/src/site/xdoc/server/feature-security.xml
index ba06743..6171249 100644
--- a/src/site/xdoc/server/feature-security.xml
+++ b/src/site/xdoc/server/feature-security.xml
@@ -31,6 +31,9 @@
     
     <p>SMTP Auth and "Verify Identity" options are enabled when you install James (<a href="config-smtp-lmtp.html">read more</a>).</p>
 
+    <p>SMTP outgoing traffic can be transmitted via SSL by default. Check <a href="http://james.apache.org/server/dev-provided-mailets.html#RemoteDelivery">RemoteDelivery</a> documentation for
+    further explanations.</p>
+
   </section>
   
   <section name="Encryption Security">


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


[james-project] 02/12: [Refactoring] calling super() when only parent is Object is pointless

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit e7ef562cad58808346c14f0efcd9c4f21c7cebe9
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Nov 6 15:17:58 2019 +0100

    [Refactoring] calling super() when only parent is Object is pointless
---
 .../james/imap/message/response/AbstractStatusResponseFactory.java       | 1 -
 1 file changed, 1 deletion(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java b/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java
index 9bc2098..41b685e 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java
@@ -28,7 +28,6 @@ import org.apache.james.imap.api.message.response.StatusResponseFactory;
 public abstract class AbstractStatusResponseFactory implements StatusResponseFactory {
 
     AbstractStatusResponseFactory() {
-        super();
     }
 
     protected abstract StatusResponse createResponse(StatusResponse.Type type, String tag, ImapCommand command, HumanReadableText displayTextKey, ResponseCode code);


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


[james-project] 12/12: JAMES-2945 Make Sender case insensitive in SMTP

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 78fc0569b6f49c99ae2bbf0e5faf08565d445205
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Wed Oct 30 11:29:11 2019 +0100

    JAMES-2945 Make Sender case insensitive in SMTP
---
 .../core/AbstractSenderAuthIdentifyVerificationRcptHook.java | 12 +++++++-----
 .../org/apache/james/mailets/SmtpAuthIntegrationTest.java    | 11 +++++++++++
 .../smtpserver/SenderAuthIdentifyVerificationRcptHook.java   |  9 +++++++++
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java
index 9265833..4a60cfc 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java
@@ -18,8 +18,6 @@
  ****************************************************************/
 package org.apache.james.protocols.smtp.core;
 
-import java.util.Locale;
-
 import org.apache.james.core.Domain;
 import org.apache.james.core.MailAddress;
 import org.apache.james.core.MaybeSender;
@@ -68,10 +66,10 @@ public abstract class AbstractSenderAuthIdentifyVerificationRcptHook implements
     private boolean senderMatchSessionUser(MaybeSender maybeSender, SMTPSession session) {
         Preconditions.checkArgument(!maybeSender.isNullSender());
 
-        String authUser = session.getUser().toLowerCase(Locale.US);
-        String username = getUser(maybeSender.get());
+        String authUser = session.getUser();
+        String sender = getUser(maybeSender.get());
 
-        return username.equals(authUser);
+        return isSenderAllowed(authUser, sender);
     }
 
     private boolean belongsToLocalDomain(MaybeSender maybeSender) {
@@ -94,4 +92,8 @@ public abstract class AbstractSenderAuthIdentifyVerificationRcptHook implements
      */
     protected abstract String getUser(MailAddress mailAddress);
 
+    /**
+     * Is a given sender allowed for a user
+     */
+    protected abstract boolean isSenderAllowed(String user, String sender);
 }
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
index d96391b..40c5215 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
@@ -126,4 +126,15 @@ public class SmtpAuthIntegrationTest {
             .isFalse();
     }
 
+    @Test
+    public void mixedCaseSenderMailShouldBeDelivered() throws Exception {
+        messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+            .authenticate(FROM, PASSWORD)
+            .sendMessage("FROMUSER@" + DEFAULT_DOMAIN, FROM);
+
+        imapMessageReader.connect(LOCALHOST_IP, jamesServer.getProbe(ImapGuiceProbe.class).getImapPort())
+            .login(FROM, PASSWORD)
+            .select(IMAPMessageReader.INBOX)
+            .awaitMessage(awaitAtMostOneMinute);
+    }
 }
diff --git a/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java b/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java
index 0de9ccf..f56ee43 100644
--- a/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java
+++ b/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java
@@ -18,6 +18,9 @@
  ****************************************************************/
 package org.apache.james.smtpserver;
 
+import java.text.Collator;
+import java.util.Locale;
+
 import javax.inject.Inject;
 
 import org.apache.james.core.Domain;
@@ -77,4 +80,10 @@ public class SenderAuthIdentifyVerificationRcptHook extends AbstractSenderAuthId
         }
     }
 
+    @Override
+    protected boolean isSenderAllowed(String user, String sender) {
+        Collator collator = Collator.getInstance(Locale.US);
+        collator.setStrength(Collator.PRIMARY);
+        return collator.compare(user, sender) == 0;
+    }
 }


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


[james-project] 01/12: [Refactoring] fix a typo on AbstractStatusResponseFactory

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 0be9f77198b71deb8e1c91222e7057967bb31ea1
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Nov 6 15:17:28 2019 +0100

    [Refactoring] fix a typo on AbstractStatusResponseFactory
---
 ...tStatusResponseFactory.java => AbstractStatusResponseFactory.java} | 4 ++--
 .../james/imap/message/response/UnpooledStatusResponseFactory.java    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstactStatusResponseFactory.java b/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java
similarity index 97%
rename from protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstactStatusResponseFactory.java
rename to protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java
index b291ee9..9bc2098 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstactStatusResponseFactory.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/message/response/AbstractStatusResponseFactory.java
@@ -25,9 +25,9 @@ import org.apache.james.imap.api.message.response.StatusResponse;
 import org.apache.james.imap.api.message.response.StatusResponse.ResponseCode;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 
-public abstract class AbstactStatusResponseFactory implements StatusResponseFactory {
+public abstract class AbstractStatusResponseFactory implements StatusResponseFactory {
 
-    public AbstactStatusResponseFactory() {
+    AbstractStatusResponseFactory() {
         super();
     }
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactory.java b/protocols/imap/src/main/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactory.java
index 0bc17c6..6ef6a42 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactory.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactory.java
@@ -26,7 +26,7 @@ import org.apache.james.imap.api.message.response.StatusResponse.ResponseCode;
 import org.apache.james.imap.api.message.response.StatusResponse.Type;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 
-public class UnpooledStatusResponseFactory extends AbstactStatusResponseFactory implements StatusResponseFactory {
+public class UnpooledStatusResponseFactory extends AbstractStatusResponseFactory implements StatusResponseFactory {
 
     @Override
     protected StatusResponse createResponse(Type type, String tag, ImapCommand command, HumanReadableText displayTextKey, ResponseCode code) {


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


[james-project] 08/12: JAMES-2956 Fix a typo in webadmin documentation

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 0cb21fd90491de5e249a477d71c1d1ba018f9d01
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Nov 6 13:35:50 2019 +0700

    JAMES-2956 Fix a typo in webadmin documentation
---
 src/site/markdown/server/manage-webadmin.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/markdown/server/manage-webadmin.md b/src/site/markdown/server/manage-webadmin.md
index 1f6aac7..886c229 100644
--- a/src/site/markdown/server/manage-webadmin.md
+++ b/src/site/markdown/server/manage-webadmin.md
@@ -24,7 +24,7 @@ In case of any error, the system will return an error message which is json form
 Also be aware that, in case things go wrong, all endpoints might return a 500 internal error (with a JSON body formatted
 as exposed above). To avoid information duplication, this is ommited on endpoint specific documentation.
 
-Finally, please note that in case of a malformed URL the 400 bad request response will contains an HTML body.
+Finally, please note that in case of a malformed URL the 400 bad request response will contain an HTML body.
 
 ## Navigation menu
 


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


[james-project] 09/12: JAMES-2961 Document SSL security within RemoteDelivery javaDoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 0cbbc88410b35e15c49e074b5a1baa6ed32f722b
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Nov 4 14:50:21 2019 +0700

    JAMES-2961 Document SSL security within RemoteDelivery javaDoc
---
 .../org/apache/james/transport/mailets/RemoteDelivery.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
index 471f87c..cc70a6b 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
@@ -105,7 +105,7 @@ import com.google.common.collect.HashMultimap;
  * <li><b>heloName</b> (optional) - a String containing the name used in the SMTP HELO and EHLO commands. Default is the default domain,
  * which is typically <code>localhost</code>.</li>
  * <li><b>mail.*</b> (optional) - Any property beginning with <code>mail.</code> described in the Javadoc for package
- * <a href="http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html"><code>com.sun.mail.smtp</code></a>
+ * <a href="https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html"><code>com.sun.mail.smtp</code></a>
  * can be set with a parameter of the corresponding name. For example the parameter
  * <code>&lt;mail.smtp.ssl.enable&gt;true&lt;/mail.smtp.ssl.enable&gt;</code> is equivalent to the Java code
  * <code>props.put("mail.smtp.ssl.enable", "true");</code>. Properties set by this facility override settings made
@@ -114,6 +114,15 @@ import com.google.common.collect.HashMultimap;
  * the ability to perform their own problem resolutions.</li>
  * <li><b>debug</b> (optional) - a Boolean (true/false) indicating whether debugging is on. Default is false.</li>
  * </ul>
+ * <br/>
+ * <b>Security:</b><br/>
+ * You can use the <i>mail.smtp.ssl.enable</i> javax property described above to force SMTP outgoing delivery to default to SSL
+ * encrypted traffic. <br/>
+ * When enabling SSL, you might need to specify <i>mail.smtp.ssl.checkserveridentity</i> and <i>mail.smtp.ssl.trust</i>
+ * properties. You can also control ciphersuites and protocols via <i>mail.smtp.ssl.ciphersuites</i> and
+ * <i>mail.smtp.ssl.protocols</i> properties.<br/>
+ * Read <a href="https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html"><code>com.sun.mail.smtp</code></a>
+ * for full information.
  */
 public class RemoteDelivery extends GenericMailet {
     private static final Logger LOGGER = LoggerFactory.getLogger(RemoteDelivery.class);


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


[james-project] 03/12: [Refactoring] use the usual naming scheme for test classes

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit f727d766f933cdf10a56a954a8db55192dff05cd
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Nov 6 15:19:09 2019 +0100

    [Refactoring] use the usual naming scheme for test classes
---
 ...usResponseFactory.java => AbstractStatusResponseFactoryTest.java} | 2 +-
 .../imap/message/response/UnpooledStatusResponseFactoryTest.java     | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractTestForStatusResponseFactory.java b/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
similarity index 99%
rename from protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractTestForStatusResponseFactory.java
rename to protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
index 67f47e2..b233dc8 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractTestForStatusResponseFactory.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/api/message/response/AbstractStatusResponseFactoryTest.java
@@ -26,7 +26,7 @@ import org.apache.james.imap.api.display.HumanReadableText;
 import org.junit.Before;
 import org.junit.Test;
 
-public abstract class AbstractTestForStatusResponseFactory  {
+public abstract class AbstractStatusResponseFactoryTest {
 
     private static final String TAG = "ATAG";
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java b/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java
index 0efc955..bd5370d 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/message/response/UnpooledStatusResponseFactoryTest.java
@@ -19,12 +19,11 @@
 
 package org.apache.james.imap.message.response;
 
-import org.apache.james.imap.api.message.response.AbstractTestForStatusResponseFactory;
+import org.apache.james.imap.api.message.response.AbstractStatusResponseFactoryTest;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
-import org.apache.james.imap.message.response.UnpooledStatusResponseFactory;
 
 public class UnpooledStatusResponseFactoryTest extends
-        AbstractTestForStatusResponseFactory {
+    AbstractStatusResponseFactoryTest {
 
     @Override
     protected StatusResponseFactory createInstance() {


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


[james-project] 11/12: JAMES-2961 Document startTls configuration for remoteDelivery

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 0720c9af8b53b4d0cff3e84376b4765bc029d75c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Nov 5 10:42:01 2019 +0700

    JAMES-2961 Document startTls configuration for remoteDelivery
---
 .../main/java/org/apache/james/transport/mailets/RemoteDelivery.java   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
index cc70a6b..ab597e9 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
@@ -121,6 +121,9 @@ import com.google.common.collect.HashMultimap;
  * When enabling SSL, you might need to specify <i>mail.smtp.ssl.checkserveridentity</i> and <i>mail.smtp.ssl.trust</i>
  * properties. You can also control ciphersuites and protocols via <i>mail.smtp.ssl.ciphersuites</i> and
  * <i>mail.smtp.ssl.protocols</i> properties.<br/>
+ * <b>startTls</b> can alternatively be enabled upon sending a mail. For this, use the <i>startTls</i> configuration property, serving as a shortcut for
+ * javax <i>mail.smtp.starttls.enable</i> property. Depending on how strict your security policy is, you might consider
+ * <i>mail.smtp.starttls.required</i> as well. Be aware that configuring trust will then be required.<br/>
  * Read <a href="https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html"><code>com.sun.mail.smtp</code></a>
  * for full information.
  */


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


[james-project] 06/12: JAMES-2971 Let the caller of Event Delivery decide where and how to execute the delivery

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 84f817fd87bd54422ca68fe9b7bd321db584093e
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Nov 6 10:39:01 2019 +0100

    JAMES-2971 Let the caller of Event Delivery decide where and how to execute the delivery
---
 .../org/apache/james/mailbox/events/delivery/InVmEventDelivery.java  | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/mailbox/event/event-memory/src/main/java/org/apache/james/mailbox/events/delivery/InVmEventDelivery.java b/mailbox/event/event-memory/src/main/java/org/apache/james/mailbox/events/delivery/InVmEventDelivery.java
index da23d3a..9a538d2 100644
--- a/mailbox/event/event-memory/src/main/java/org/apache/james/mailbox/events/delivery/InVmEventDelivery.java
+++ b/mailbox/event/event-memory/src/main/java/org/apache/james/mailbox/events/delivery/InVmEventDelivery.java
@@ -38,8 +38,6 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.VisibleForTesting;
 import reactor.core.publisher.Mono;
-import reactor.core.publisher.MonoProcessor;
-import reactor.core.scheduler.Schedulers;
 
 public class InVmEventDelivery implements EventDelivery {
     private static final Logger LOGGER = LoggerFactory.getLogger(InVmEventDelivery.class);
@@ -71,13 +69,10 @@ public class InVmEventDelivery implements EventDelivery {
         Mono<Void> deliveryToListener = Mono.fromRunnable(() -> doDeliverToListener(listener, event))
             .doOnError(throwable -> structuredLogger(event, listener)
                 .log(logger -> logger.error("Error while processing listener", throwable)))
-            .subscribeOn(Schedulers.boundedElastic())
             .then();
 
         return deliveryOption.getRetrier().doRetry(deliveryToListener, event)
             .onErrorResume(throwable -> deliveryOption.getPermanentFailureHandler().handle(event))
-            .subscribeWith(MonoProcessor.create())
-            .subscribeOn(Schedulers.boundedElastic())
             .then();
     }
 


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