You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "Arsnael (via GitHub)" <gi...@apache.org> on 2026/05/15 09:55:23 UTC
[PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Arsnael opened a new pull request, #3041:
URL: https://github.com/apache/james-project/pull/3041
(no comment)
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #3041:
URL: https://github.com/apache/james-project/pull/3041#discussion_r3247987301
##########
docs/modules/servers/partials/operate/webadmin.adoc:
##########
@@ -1759,6 +1759,33 @@ and the following `additionalInformation`:
}
....
+=== Restoring user mailboxes
+
+....
+curl -XPOST http://ip:port/users/{usernameToBeUsed}/mailboxes?task=restore --data-binary @backup.zip
+....
+
+Resource name `usernameToBeUsed` should be an existing user. The request body must contain the ZIP backup data.
+
+Response codes:
+
+* 201: Success. Corresponding task id is returned
+* 400: The request body is empty
+* 404: The user name does not exist
+
+The scheduled task will have the following type `MailboxesRestoreTask`
+and the following `additionalInformation`:
+
+....
+{
+ "type":"MailboxesRestoreTask",
+ "timestamp":"2007-12-03T10:15:30Z",
+ "username": "user"
+}
+....
+
+Note: The account must be empty for the restore to succeed. If the user already has mailboxes, the task will fail.
Review Comment:
If we can sneak a commit about it a `?force` parameter to skip that check it would be GREAT
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on code in PR #3041:
URL: https://github.com/apache/james-project/pull/3041#discussion_r3255978868
##########
docs/modules/servers/partials/operate/webadmin.adoc:
##########
@@ -1759,6 +1759,33 @@ and the following `additionalInformation`:
}
....
+=== Restoring user mailboxes
+
+....
+curl -XPOST http://ip:port/users/{usernameToBeUsed}/mailboxes?task=restore --data-binary @backup.zip
+....
+
+Resource name `usernameToBeUsed` should be an existing user. The request body must contain the ZIP backup data.
+
+Response codes:
+
+* 201: Success. Corresponding task id is returned
+* 400: The request body is empty
+* 404: The user name does not exist
+
+The scheduled task will have the following type `MailboxesRestoreTask`
+and the following `additionalInformation`:
+
+....
+{
+ "type":"MailboxesRestoreTask",
+ "timestamp":"2007-12-03T10:15:30Z",
+ "username": "user"
+}
+....
+
+Note: The account must be empty for the restore to succeed. If the user already has mailboxes, the task will fail.
Review Comment:
Makes sense, thanks for the suggestion
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #3041:
URL: https://github.com/apache/james-project/pull/3041#discussion_r3247993587
##########
server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java:
##########
@@ -456,6 +456,32 @@ void mailboxesExportTasksShouldBeExposed() throws Exception {
.body("type", is("MailboxesExportTask"));
}
+ @Test
+ void mailboxesRestoreTasksShouldBeExposed() throws Exception {
+ dataProbe.addUser(USERNAME, "anyPassword");
+
+ java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
+ try (java.util.zip.ZipOutputStream zos = new java.util.zip.ZipOutputStream(baos)) {
Review Comment:
Why do we need FQDN ?
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #3041:
URL: https://github.com/apache/james-project/pull/3041#discussion_r3266441743
##########
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/MailboxesRestoreTaskDTO.java:
##########
@@ -73,7 +73,7 @@ public static TaskDTOModule<MailboxesRestoreTask, MailboxesRestoreTaskDTO> modul
}
public MailboxesRestoreTask fromDTO(RestoreService service, BlobId.Factory blobIdFactory) {
- return new MailboxesRestoreTask(service, Username.of(username), blobIdFactory.of(blobId), force);
+ return new MailboxesRestoreTask(service, Username.of(username), blobIdFactory.parse(blobId), force != null && force);
Review Comment:
Why is force nullable in the first place ? Have it as Optional.
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #3041:
URL: https://github.com/apache/james-project/pull/3041#discussion_r3247987301
##########
docs/modules/servers/partials/operate/webadmin.adoc:
##########
@@ -1759,6 +1759,33 @@ and the following `additionalInformation`:
}
....
+=== Restoring user mailboxes
+
+....
+curl -XPOST http://ip:port/users/{usernameToBeUsed}/mailboxes?task=restore --data-binary @backup.zip
+....
+
+Resource name `usernameToBeUsed` should be an existing user. The request body must contain the ZIP backup data.
+
+Response codes:
+
+* 201: Success. Corresponding task id is returned
+* 400: The request body is empty
+* 404: The user name does not exist
+
+The scheduled task will have the following type `MailboxesRestoreTask`
+and the following `additionalInformation`:
+
+....
+{
+ "type":"MailboxesRestoreTask",
+ "timestamp":"2007-12-03T10:15:30Z",
+ "username": "user"
+}
+....
+
+Note: The account must be empty for the restore to succeed. If the user already has mailboxes, the task will fail.
Review Comment:
If we can sneak a commit about it a ?force parameter would be GREAT
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #3041:
URL: https://github.com/apache/james-project/pull/3041#issuecomment-4486474066
https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-3041/4/testReport/org.apache.james.webadmin.integration.rabbitmq/RabbitMQWebAdminServerIntegrationTest/mailboxesRestoreTasksShouldBeExposed/
Will investigate...
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #3041:
URL: https://github.com/apache/james-project/pull/3041#issuecomment-4458806980
So... welll technically the message isn't working yet. For the simple reason that the message restoration logic... is missing^^" : https://github.com/apache/james-project/blob/master/mailbox/backup/src/main/java/org/apache/james/mailbox/backup/ZipMailArchiveRestorer.java#L87
Will tackle it later...
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael merged PR #3041:
URL: https://github.com/apache/james-project/pull/3041
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #3041:
URL: https://github.com/apache/james-project/pull/3041#discussion_r3264294523
##########
docs/modules/servers/partials/operate/webadmin.adoc:
##########
@@ -1759,6 +1759,33 @@ and the following `additionalInformation`:
}
....
+=== Restoring user mailboxes
+
+....
+curl -XPOST http://ip:port/users/{usernameToBeUsed}/mailboxes?task=restore --data-binary @backup.zip
+....
+
+Resource name `usernameToBeUsed` should be an existing user. The request body must contain the ZIP backup data.
+
+Response codes:
+
+* 201: Success. Corresponding task id is returned
+* 400: The request body is empty
+* 404: The user name does not exist
+
+The scheduled task will have the following type `MailboxesRestoreTask`
+and the following `additionalInformation`:
+
+....
+{
+ "type":"MailboxesRestoreTask",
+ "timestamp":"2007-12-03T10:15:30Z",
+ "username": "user"
+}
+....
+
+Note: The account must be empty for the restore to succeed. If the user already has mailboxes, the task will fail.
+
Review Comment:
Please document `?force` parameter
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #3041:
URL: https://github.com/apache/james-project/pull/3041#issuecomment-4485698197
Squashed the fixups and added the force param to the doc
--
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
Re: [PR] JAMES-4204 Webadmin endpoint for restore mailbox backup [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #3041:
URL: https://github.com/apache/james-project/pull/3041#issuecomment-4495392391
It's green. Final approval and I will squash the fixups :)
--
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