You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/11/15 10:16:43 UTC

[GitHub] [james-project] ottoka opened a new pull request #748: JAMES-3670 : Configurable restore location for deleted messages

ottoka opened a new pull request #748:
URL: https://github.com/apache/james-project/pull/748


   James should have an option to specify which mailbox receives any restored messages from the Deleted Messages Vault, i.e. something other than the default of 'Restored-Messages'.
   
   This is necessary to use the Deleted Messages Vault in combination with POP3, since POP3 users cannot access any other mailboxes than 'INBOX'.
   
   The solution is to add an extra configuration option 'restoreLocation' within deletedMessagesVault.properties, which can be injected into the RestoreService for this purpose.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] Arsnael merged pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
Arsnael merged pull request #748:
URL: https://github.com/apache/james-project/pull/748


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #748:
URL: https://github.com/apache/james-project/pull/748#issuecomment-968881312


   (Note that i am globally fine with the code here, just proposing tiny enhancements to improve it...)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] ottoka commented on a change in pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
ottoka commented on a change in pull request #748:
URL: https://github.com/apache/james-project/pull/748#discussion_r749405060



##########
File path: server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
##########
@@ -198,7 +199,7 @@ void beforeEach() throws Exception {
         taskManager = new MemoryTaskManager(new Hostname("foo"));
         JsonTransformer jsonTransformer = new JsonTransformer();
 
-        RestoreService vaultRestore = new RestoreService(vault, mailboxManager);
+        RestoreService vaultRestore = new RestoreService(vault, mailboxManager, RestoreLocationConfiguration.DEFAULT);

Review comment:
       Done, see latest push. RetentionConfiguration now is VaultConfiguration and contains both config options.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] ottoka commented on a change in pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
ottoka commented on a change in pull request #748:
URL: https://github.com/apache/james-project/pull/748#discussion_r749405060



##########
File path: server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
##########
@@ -198,7 +199,7 @@ void beforeEach() throws Exception {
         taskManager = new MemoryTaskManager(new Hostname("foo"));
         JsonTransformer jsonTransformer = new JsonTransformer();
 
-        RestoreService vaultRestore = new RestoreService(vault, mailboxManager);
+        RestoreService vaultRestore = new RestoreService(vault, mailboxManager, RestoreLocationConfiguration.DEFAULT);

Review comment:
       Done, see latest push.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] ottoka commented on a change in pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
ottoka commented on a change in pull request #748:
URL: https://github.com/apache/james-project/pull/748#discussion_r749303828



##########
File path: server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
##########
@@ -198,7 +199,7 @@ void beforeEach() throws Exception {
         taskManager = new MemoryTaskManager(new Hostname("foo"));
         JsonTransformer jsonTransformer = new JsonTransformer();
 
-        RestoreService vaultRestore = new RestoreService(vault, mailboxManager);
+        RestoreService vaultRestore = new RestoreService(vault, mailboxManager, RestoreLocationConfiguration.DEFAULT);

Review comment:
       I was keeping them separate since they are used in different locations in the code base. And initially did not want to introduce more change impact than necessary, while it all was a private patch. But of course I can merge it all together now, which will also eliminate the extra module you commented on above.

##########
File path: server/container/guice/mailbox-plugin-deleted-messages-vault/src/main/java/org/apache/james/modules/vault/DeletedMessageVaultModule.java
##########
@@ -30,6 +30,7 @@
     @Override
     protected void configure() {
         install(new DeletedMessageVaultRetentionModule());
+        install(new DeletedMessagesVaultRestoreModule());

Review comment:
       Less change impact / smaller diff set originally, but see below.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #748:
URL: https://github.com/apache/james-project/pull/748#discussion_r749313776



##########
File path: server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
##########
@@ -198,7 +199,7 @@ void beforeEach() throws Exception {
         taskManager = new MemoryTaskManager(new Hostname("foo"));
         JsonTransformer jsonTransformer = new JsonTransformer();
 
-        RestoreService vaultRestore = new RestoreService(vault, mailboxManager);
+        RestoreService vaultRestore = new RestoreService(vault, mailboxManager, RestoreLocationConfiguration.DEFAULT);

Review comment:
       I am globally ok with the patch as off today but would prefer a single pojo ;-)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] ottoka commented on a change in pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
ottoka commented on a change in pull request #748:
URL: https://github.com/apache/james-project/pull/748#discussion_r749304422



##########
File path: server/container/guice/mailbox-plugin-deleted-messages-vault/src/main/java/org/apache/james/modules/vault/DeletedMessagesVaultRestoreModule.java
##########
@@ -0,0 +1,54 @@
+/****************************************************************
+ * 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.modules.vault;
+
+import java.io.FileNotFoundException;
+
+import javax.inject.Singleton;
+
+import org.apache.commons.configuration2.Configuration;
+import org.apache.james.utils.PropertiesProvider;
+import org.apache.james.vault.RestoreLocationConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.ConfigurationException;
+import com.google.inject.Provides;
+
+public class DeletedMessagesVaultRestoreModule extends AbstractModule {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DeletedMessagesVaultRestoreModule.class);
+
+    @Override
+    protected void configure() {
+    }

Review comment:
       Huh, missed that one, will remove it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #748: JAMES-3670 : Configurable restore location for deleted messages

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #748:
URL: https://github.com/apache/james-project/pull/748#discussion_r749297051



##########
File path: server/container/guice/mailbox-plugin-deleted-messages-vault/src/main/java/org/apache/james/modules/vault/DeletedMessageVaultModule.java
##########
@@ -30,6 +30,7 @@
     @Override
     protected void configure() {
         install(new DeletedMessageVaultRetentionModule());
+        install(new DeletedMessagesVaultRestoreModule());

Review comment:
       Why creating a seperate module instead of putting the binding here?

##########
File path: server/container/guice/mailbox-plugin-deleted-messages-vault/src/main/java/org/apache/james/modules/vault/DeletedMessagesVaultRestoreModule.java
##########
@@ -0,0 +1,54 @@
+/****************************************************************
+ * 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.modules.vault;
+
+import java.io.FileNotFoundException;
+
+import javax.inject.Singleton;
+
+import org.apache.commons.configuration2.Configuration;
+import org.apache.james.utils.PropertiesProvider;
+import org.apache.james.vault.RestoreLocationConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.ConfigurationException;
+import com.google.inject.Provides;
+
+public class DeletedMessagesVaultRestoreModule extends AbstractModule {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DeletedMessagesVaultRestoreModule.class);
+
+    @Override
+    protected void configure() {
+    }

Review comment:
       We likely do not need this empty configure method...

##########
File path: server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
##########
@@ -198,7 +199,7 @@ void beforeEach() throws Exception {
         taskManager = new MemoryTaskManager(new Hostname("foo"));
         JsonTransformer jsonTransformer = new JsonTransformer();
 
-        RestoreService vaultRestore = new RestoreService(vault, mailboxManager);
+        RestoreService vaultRestore = new RestoreService(vault, mailboxManager, RestoreLocationConfiguration.DEFAULT);

Review comment:
       Shouldn't we merge `RestoreLocation` and `RetentionConfiguration` pojos into a single DeletedMessageVaultConfiguration pojo with 2 fields?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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