You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/11/22 07:11:52 UTC

[james-project] 07/12: JAMES-3858 Alter CREATE responses to include mailboxId from the answer

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 02a1240b597e21e5a3a66aab77f3ef073811ca7e
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 17 23:13:43 2022 +0700

    JAMES-3858 Alter CREATE responses to include mailboxId from the answer
---
 .../org/apache/james/imap/scripts/Append.test      |  2 +-
 .../apache/james/imap/scripts/AppendExpunge.test   |  2 +-
 .../james/imap/scripts/AppendToSelected.test       |  2 +-
 .../james/imap/scripts/BodyPartialFetch.test       |  2 +-
 .../org/apache/james/imap/scripts/ComplexMail.test |  2 +-
 .../scripts/ConcurrentAppendUIDToMSNMapping.test   |  2 +-
 .../james/imap/scripts/ConcurrentCrossExpunge.test |  2 +-
 .../imap/scripts/ConcurrentDeleteSelected.test     |  2 +-
 .../imap/scripts/ConcurrentExistsResponse.test     |  4 +--
 .../imap/scripts/ConcurrentExpungeResponse.test    |  2 +-
 .../scripts/ConcurrentExpungeUIDToMSNMapping.test  |  2 +-
 .../imap/scripts/ConcurrentFetchResponse.test      |  4 +--
 .../imap/scripts/ConcurrentRenameSelected.test     |  2 +-
 .../imap/scripts/ConcurrentRenameSelectedSub.test  |  4 +--
 .../org/apache/james/imap/scripts/Copy.test        |  2 +-
 .../org/apache/james/imap/scripts/Create.test      | 16 +++++------
 .../imap/scripts/CreateErrorWithLongName.test      |  2 +-
 .../org/apache/james/imap/scripts/Delete.test      |  8 +++---
 .../apache/james/imap/scripts/ExamineEmpty.test    |  8 +++---
 .../apache/james/imap/scripts/ExpungeBasics.test   |  2 +-
 .../james/imap/scripts/FetchHeaderFields.test      |  2 +-
 .../james/imap/scripts/FetchHeaderFieldsNot.test   |  2 +-
 .../imap/scripts/FetchMultipartAlternative.test    |  2 +-
 .../imap/scripts/FetchMultipartBodyStructure.test  |  2 +-
 .../james/imap/scripts/FetchMultipartMixed.test    |  2 +-
 .../imap/scripts/FetchMultipartMixedComplex.test   |  2 +-
 .../james/imap/scripts/FetchRFC822Mixed.test       |  2 +-
 .../imap/scripts/FetchSimpleBodyStructure.test     |  2 +-
 .../james/imap/scripts/FetchStructureComplex.test  |  2 +-
 .../james/imap/scripts/FetchStructureEmbedded.test |  2 +-
 .../james/imap/scripts/HeaderPartialFetch.test     |  2 +-
 .../apache/james/imap/scripts/ListMailboxes.test   |  8 +++---
 .../org/apache/james/imap/scripts/ListOnly.test    |  8 +++---
 .../james/imap/scripts/ListPercentWildcard.test    | 10 +++----
 .../org/apache/james/imap/scripts/ListPlus.test    | 16 +++++------
 .../org/apache/james/imap/scripts/Metadata.test    |  4 +--
 .../james/imap/scripts/MetadataWithLimitation.test |  2 +-
 .../james/imap/scripts/MimePartialFetch.test       |  2 +-
 .../org/apache/james/imap/scripts/Move.test        |  2 +-
 .../imap/scripts/PeekMultipartAlternative.test     |  2 +-
 .../james/imap/scripts/PeekMultipartMixed.test     |  2 +-
 .../imap/scripts/PeekMultipartMixedComplex.test    |  2 +-
 .../org/apache/james/imap/scripts/Quota.test       |  2 +-
 .../org/apache/james/imap/scripts/Recent.test      |  2 +-
 .../org/apache/james/imap/scripts/Rename.test      |  6 ++--
 .../apache/james/imap/scripts/RenameHierarchy.test |  8 +++---
 .../apache/james/imap/scripts/RenameSelected.test  |  2 +-
 .../org/apache/james/imap/scripts/Search.test      |  2 +-
 .../org/apache/james/imap/scripts/SearchAtoms.test |  2 +-
 .../james/imap/scripts/SearchCombinations.test     |  2 +-
 .../imap/scripts/SearchOptionAggregations.test     |  2 +-
 .../james/imap/scripts/SearchOptionSave.test       |  2 +-
 .../apache/james/imap/scripts/SelectAppend.test    |  2 +-
 .../org/apache/james/imap/scripts/SelectEmpty.test |  8 +++---
 .../apache/james/imap/scripts/SelectUnseen.test    |  4 +--
 .../james/imap/scripts/SelectedStateSetup.test     |  2 +-
 .../apache/james/imap/scripts/SharedMailbox.test   |  6 ++--
 .../org/apache/james/imap/scripts/Status.test      |  2 +-
 .../org/apache/james/imap/scripts/StringArgs.test  |  2 +-
 .../org/apache/james/imap/scripts/Subscribe.test   |  8 +++---
 .../james/imap/scripts/TextPartialFetch.test       |  2 +-
 .../org/apache/james/imap/scripts/Uid.test         |  2 +-
 .../apache/james/imap/scripts/UidSearchAtoms.test  |  2 +-
 .../james/imap/scripts/UidSearchAtomsIndexer.test  |  4 +--
 .../james/imap/scripts/UidSearchCombinations.test  |  2 +-
 .../james/imap/scripts/UserFlagsSupport.test       |  2 +-
 .../org/apache/james/imap/scripts/XList.test       |  8 +++---
 .../imap/api/message/response/StatusResponse.java  |  6 ++++
 .../james/imap/processor/CreateProcessor.java      | 32 ++++++++++++----------
 69 files changed, 142 insertions(+), 134 deletions(-)

diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Append.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Append.test
index 58279ad92e..bf6b5876ed 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Append.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Append.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: a1 CREATE appendBox
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: A003 APPEND appendBox {310}
 # Use command continuation request
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendExpunge.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendExpunge.test
index 1ac9b4a067..4fb7fe5211 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendExpunge.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendExpunge.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: 10 CREATE appendexpunge
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a001 STATUS appendexpunge (MESSAGES)
 S: \* STATUS "appendexpunge" \(MESSAGES 0\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendToSelected.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendToSelected.test
index c195060282..6517800621 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendToSelected.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AppendToSelected.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: a1 CREATE appendBox
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: A003 APPEND appendBox {310}
 # Use command continuation request
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/BodyPartialFetch.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/BodyPartialFetch.test
index 2e2e6ff69c..9253ff3335 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/BodyPartialFetch.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/BodyPartialFetch.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ComplexMail.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ComplexMail.test
index 908f2c2e85..9e2b5bc9fb 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ComplexMail.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ComplexMail.test
@@ -21,7 +21,7 @@
 # TODO: use Mime4J
 #
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentAppendUIDToMSNMapping.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentAppendUIDToMSNMapping.test
index bed1e7832c..cc41dd277b 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentAppendUIDToMSNMapping.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentAppendUIDToMSNMapping.test
@@ -24,7 +24,7 @@
 ### PROVISIONING
 SESSION: 1
 C: 1a CREATE expungeresponse
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND expungeresponse (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentCrossExpunge.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentCrossExpunge.test
index 84af95d1f3..15dadd5cec 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentCrossExpunge.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentCrossExpunge.test
@@ -18,7 +18,7 @@
 ################################################################
 SESSION: 1
 C: 1a CREATE alpha
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND alpha (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentDeleteSelected.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentDeleteSelected.test
index 209c1c017e..a4de264f8e 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentDeleteSelected.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentDeleteSelected.test
@@ -24,7 +24,7 @@
 
 SESSION: 1
 C: 1a CREATE deleteconcurrent
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND deleteconcurrent (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExistsResponse.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExistsResponse.test
index 698d205f53..7638139f6d 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExistsResponse.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExistsResponse.test
@@ -20,7 +20,7 @@
 # in a concurrent session on the same mailbox
 SESSION: 1
 C: 1a CREATE existsresponse
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b STATUS existsresponse (MESSAGES)
 S: \* STATUS \"existsresponse\" \(MESSAGES 0\)
@@ -103,7 +103,7 @@ C: 4b CREATE another
 S: \* 1 EXISTS
 S: \* 1 RECENT
 S: \* 1 FETCH \(FLAGS \(\\Flagged \\Recent\)\)
-S: 4b OK CREATE completed.
+S: 4b OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 4c DELETE another
 S: 4c OK DELETE completed.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeResponse.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeResponse.test
index c69248f200..0dca5b85b4 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeResponse.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeResponse.test
@@ -18,7 +18,7 @@
 ################################################################
 SESSION: 1
 C: 1a CREATE expungeresponse
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND expungeresponse (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeUIDToMSNMapping.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeUIDToMSNMapping.test
index 967562c713..6270947ef4 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeUIDToMSNMapping.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentExpungeUIDToMSNMapping.test
@@ -24,7 +24,7 @@
 ### PROVISIONING
 SESSION: 1
 C: 1a CREATE expungeresponse
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND expungeresponse (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentFetchResponse.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentFetchResponse.test
index 210052eebf..e70216da4a 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentFetchResponse.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentFetchResponse.test
@@ -20,7 +20,7 @@
 # in a concurrent session on the same mailbox
 SESSION: 1
 C: 1a CREATE multibox
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b STATUS multibox (MESSAGES)
 S: \* STATUS "multibox" \(MESSAGES 0\)
@@ -134,7 +134,7 @@ SESSION: 4
 C: 4b CREATE another
 S: \* 1 FETCH \(FLAGS \(\\Flagged\)\)
 S: \* 2 FETCH \(FLAGS \(\\Flagged\)\)
-S: 4b OK CREATE completed.
+S: 4b OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 4c DELETE another
 S: 4c OK DELETE completed.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelected.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelected.test
index 19bb654003..5bbed67054 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelected.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelected.test
@@ -23,7 +23,7 @@
 
 SESSION: 1
 C: 1a CREATE renameconcurrent
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND renameconcurrent (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelectedSub.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelectedSub.test
index 17a274184f..cbc3b13aa8 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelectedSub.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ConcurrentRenameSelectedSub.test
@@ -23,9 +23,9 @@
 
 SESSION: 1
 C: 1a CREATE parent
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 1a CREATE parent.child
-S: 1a OK CREATE completed.
+S: 1a OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 1b APPEND parent.child (\Deleted) {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Copy.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Copy.test
index 8fdc9c8e41..1c84125f5c 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Copy.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Copy.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: a1 CREATE copied
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a2 STATUS copied (MESSAGES)
 S: \* STATUS "copied" \(MESSAGES 0\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Create.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Create.test
index 67445f709d..4f47c8b1fb 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Create.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Create.test
@@ -18,19 +18,19 @@
 ################################################################
 # Create a simple name
 C: 10 CREATE test
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 # Create a subfolder with simple name
 C: 11 CREATE test.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 # Create a fully qualified folder
 C: 12 CREATE test1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 # Create a fully qualified sub folder
 C: 13 CREATE test1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 # Create quoted
 C: 14 CREATE "Pepe juan"
-S: 14 OK CREATE completed.
+S: 14 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 15 CREATE ..
 S: 15 BAD CREATE failed. Illegal arguments.
@@ -40,7 +40,7 @@ S: 15 BAD CREATE failed. Illegal arguments.
 # When mailbox name is suffixed with hierarchy separator
 # name created must remove tailing delimiter
 C: 15 CREATE another.test.
-S: 15 OK CREATE completed.
+S: 15 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 16 LIST "" another*
 S: \* LIST \(\\HasChildren\) "." "another"
 S: \* LIST \(\\HasNoChildren\) "." "another.test"
@@ -49,7 +49,7 @@ S: 16 OK LIST completed.
 # RFC3501@6.3.3p2
 # Intermediary mailboxes which don't exist should be created
 C: 17 CREATE alpha.beta.gamma
-S: 17 OK CREATE completed.
+S: 17 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 18 LIST "" alpha*
 S: \* LIST \(\\HasChildren\) "." "alpha"
 S: \* LIST \(\\HasChildren\) "." "alpha.beta"
@@ -67,7 +67,7 @@ S: 19 NO CREATE failed. Mailbox already exists.
 # The creation should succeed as if trying to create a folder and its subfolder
 #
 C: 20 CREATE "one&AC4-two"
-S: 20 OK CREATE completed.
+S: 20 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 21 LIST "" one*
 S: \* LIST \(\\HasChildren\) "." "one"
 S: \* LIST \(\\HasNoChildren\) "." "one.two"
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/CreateErrorWithLongName.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/CreateErrorWithLongName.test
index 3e87a5c068..4ec17a4d1d 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/CreateErrorWithLongName.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/CreateErrorWithLongName.test
@@ -21,7 +21,7 @@ C: A1 CREATE 123456789x123456789x123456789x123456789x123456789x123456789x1234567
 S: A1 BAD CREATE too long mailbox name. Illegal arguments.
 
 C: A3 CREATE newmailbox
-S: A3 OK CREATE completed.
+S: A3 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: A4 RENAME newmailbox 123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x1
 S: A4 BAD RENAME too long mailbox name. Illegal arguments.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Delete.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Delete.test
index 095aaf91c0..ce540cb239 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Delete.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Delete.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE deletetest
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE deletetest.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE deletetest1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE deletetest1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 # Delete subfolder, then folder
 C: 10 DELETE deletetest.subfolder
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExamineEmpty.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExamineEmpty.test
index 0876052c65..ddfae06e7f 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExamineEmpty.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExamineEmpty.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE test
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE test.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE test1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE test1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: abcd EXAMINE test
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExpungeBasics.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExpungeBasics.test
index 9304597e79..7f5f113a26 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExpungeBasics.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ExpungeBasics.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFields.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFields.test
index 8aa5193576..4be4020bd1 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFields.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFields.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFieldsNot.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFieldsNot.test
index 90dca4499b..f33359ec55 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFieldsNot.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchHeaderFieldsNot.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartAlternative.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartAlternative.test
index 0bc4f874d0..017fb1eee4 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartAlternative.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartAlternative.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
index 52dbe37766..3a04c4c5d1 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
@@ -1,5 +1,5 @@
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixed.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixed.test
index 1db220cc13..712e41dc35 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixed.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixed.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixedComplex.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixedComplex.test
index 2066fd22f2..47359f0403 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixedComplex.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartMixedComplex.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchRFC822Mixed.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchRFC822Mixed.test
index d33edaca70..e6ac4b6848 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchRFC822Mixed.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchRFC822Mixed.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
index 7525d31f47..f169be703d 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureComplex.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureComplex.test
index 529b1614b9..e93a605d23 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureComplex.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureComplex.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureEmbedded.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureEmbedded.test
index 78504aa9da..2af758fac0 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureEmbedded.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchStructureEmbedded.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/HeaderPartialFetch.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/HeaderPartialFetch.test
index c2fb088ca0..883e7e4049 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/HeaderPartialFetch.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/HeaderPartialFetch.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListMailboxes.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListMailboxes.test
index 1a9b8d9522..d1221d6d74 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListMailboxes.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListMailboxes.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE listtest
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE listtest.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE listtest1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE listtest1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 # Empty 1st arg searches default context (#mail)
 C: 10 LIST "" listtest
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListOnly.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListOnly.test
index 1c20a5e74e..269da2c5d0 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListOnly.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListOnly.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE listtest
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE listtest.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE listtest1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE listtest1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 # Empty 1st arg searches default context (#mail)
 C: 10 LIST "" listtest
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPercentWildcard.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPercentWildcard.test
index 11ee2cd0aa..9bec9c9fb4 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPercentWildcard.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPercentWildcard.test
@@ -17,15 +17,15 @@
 # under the License.                                           #
 ################################################################
 C: A01 CREATE one
-S: A01 OK CREATE completed.
+S: A01 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: A02 CREATE two
-S: A02 OK CREATE completed.
+S: A02 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: A03 CREATE three.sub
-S: A03 OK CREATE completed.
+S: A03 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: A04 CREATE four.sub.sub
-S: A04 OK CREATE completed.
+S: A04 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: A05 CREATE five
-S: A05 OK CREATE completed.
+S: A05 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: A06 LIST "" %
 SUB {
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPlus.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPlus.test
index a32c413a89..cda476cbf0 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPlus.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListPlus.test
@@ -18,21 +18,21 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE listtest
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE listtest.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE listtest1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE listtest1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 14 CREATE funny
-S: 14 OK CREATE completed.
+S: 14 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 15 CREATE "funny.name with gaps"
-S: 15 OK CREATE completed.
+S: 15 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 16 CREATE "funny.name"
-S: 16 OK CREATE completed.
+S: 16 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 17 CREATE "funny.name with gaps.more"
-S: 17 OK CREATE completed.
+S: 17 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 # Empty 1st arg searches default context (#mail)
 C: 10 LIST "" listtest
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Metadata.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Metadata.test
index 1d97a189eb..7e247345a5 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Metadata.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Metadata.test
@@ -160,7 +160,7 @@ S: a24 OK SETMETADATA completed.
 
 ######Delete mailbox should delete its annotation#######
 C: m01 CREATE mailboxTest
-S: m01 OK CREATE completed.
+S: m01 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: m02 SETMETADATA mailboxTest (/private/comment "The mailboxTest private comment")
 S: m02 OK SETMETADATA completed.
@@ -179,7 +179,7 @@ C: m06 GETMETADATA "mailboxTest"
 S: m06 NO \[TRYCREATE\] GETMETADATA failed. No such mailbox.
 
 C: m07 CREATE mailboxTest
-S: m07 OK CREATE completed.
+S: m07 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: m08 GETMETADATA "mailboxTest"
 S: \* METADATA "mailboxTest"
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MetadataWithLimitation.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MetadataWithLimitation.test
index 3f973f5f85..7aad719e6a 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MetadataWithLimitation.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MetadataWithLimitation.test
@@ -33,7 +33,7 @@ C: a2 SETMETADATA INBOX (/private/comment1 "Comment" /private/comment2 "Comment"
 S: a2 OK SETMETADATA completed.
 
 C: 10 CREATE TRASK
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a3 SETMETADATA TRASK (/private/comment "My comment")
 S: a3 OK SETMETADATA completed.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MimePartialFetch.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MimePartialFetch.test
index 5ef953c059..ba950ff44a 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MimePartialFetch.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/MimePartialFetch.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
index de6067cf9c..a10ce4f479 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
@@ -22,7 +22,7 @@ S: \* CAPABILITY .* MOVE .*
 S: a0 OK CAPABILITY completed.
 
 C: a1 CREATE moved
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a2 STATUS moved (MESSAGES)
 S: \* STATUS "moved" \(MESSAGES 0\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartAlternative.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartAlternative.test
index 6f7779eb69..ac7a2a47d8 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartAlternative.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartAlternative.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK Create completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] Create completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft\)
 S: \* OK \[PERMANENTFLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft \\\*\)\] Flags permitted\.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixed.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixed.test
index 30c2680b8e..c09fdb7db5 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixed.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixed.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK Create completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] Create completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft\)
 S: \* OK \[PERMANENTFLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft \\\*\)\] Flags permitted\.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixedComplex.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixedComplex.test
index 493307eddb..e4fa013c0a 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixedComplex.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/PeekMultipartMixedComplex.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK Create completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] Create completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft\)
 S: \* OK \[PERMANENTFLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft \\\*\)\] Flags permitted\.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test
index 857d2e352d..b2b3559e6b 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: 10 CREATE #private.imapuser.test
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: A002 SELECT #private.imapuser.test
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Recent.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Recent.test
index 803e80f441..fdff2f3b66 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Recent.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Recent.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 
 C: A5 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Rename.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Rename.test
index 734448d4c5..48fa8f1ec5 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Rename.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Rename.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
@@ -2072,7 +2072,7 @@ S:
 S: \)
 S: A101 OK FETCH completed\.
 C: A102 CREATE other
-S: A102 OK CREATE completed\.
+S: A102 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A103 SELECT other
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
@@ -2337,7 +2337,7 @@ S: \* 1 EXISTS
 S: \* 1 RECENT
 S: A104 OK (\[.+\] )?APPEND completed\.
 C: A105 CREATE base
-S: A105 OK CREATE completed\.
+S: A105 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A106 SELECT base
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameHierarchy.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameHierarchy.test
index 7b3b12e40d..77c2fa37b5 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameHierarchy.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameHierarchy.test
@@ -17,13 +17,13 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE one
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 CREATE one.two
-S: A3 OK CREATE completed\.
+S: A3 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A4 CREATE one.two.three
-S: A4 OK CREATE completed\.
+S: A4 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A5 CREATE one.two.three.four
-S: A5 OK CREATE completed\.
+S: A5 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A6 LIST "" "*"
 S: \* LIST \(\\HasNoChildren\) "\." "INBOX"
 S: \* LIST \(\\HasChildren\) "\." "one"
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameSelected.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameSelected.test
index e196ac3c76..c3f91c4130 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameSelected.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/RenameSelected.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Search.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Search.test
index 032096faab..c0289ca6dd 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Search.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Search.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: f CREATE anothermailbox
-S: f OK CREATE completed\.
+S: f OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: g APPEND anothermailbox {704+}
 C: Received: by 10.114.81.13 with HTTP; Sat, 2 Feb 2008 05:14:19 -0800 (PST)
 C: Message-ID: <f4...@mail.gmail.com>
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchAtoms.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchAtoms.test
index 99374eb2be..635913fb70 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchAtoms.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchAtoms.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchCombinations.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchCombinations.test
index fb579eb498..8ea41bb0d3 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchCombinations.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchCombinations.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
index 68ea2df83c..965a80096b 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
@@ -20,7 +20,7 @@
 # https://datatracker.ietf.org/doc/html/rfc4731
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionSave.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionSave.test
index ed13f9951c..735929db85 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionSave.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionSave.test
@@ -20,7 +20,7 @@
 # https://datatracker.ietf.org/doc/html/rfc5182
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectAppend.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectAppend.test
index 0bd0cd2439..c504829060 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectAppend.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectAppend.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: 10 CREATE selectappend
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 10 SELECT selectappend
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectEmpty.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectEmpty.test
index 34663b58f2..201deb60fe 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectEmpty.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectEmpty.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE test
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE test.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE test1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE test1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: abcd SELECT test
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectUnseen.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectUnseen.test
index c7acc42a3e..989cd6c02f 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectUnseen.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectUnseen.test
@@ -17,10 +17,10 @@
 # under the License.                                           #
 ################################################################
 C: 10 CREATE selectappend
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 10 CREATE another
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 10 SELECT selectappend
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectedStateSetup.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectedStateSetup.test
index df88ffce40..1d8781cb03 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectedStateSetup.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SelectedStateSetup.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: a1 CREATE selected
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: A003 APPEND selected {254+}
 C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test
index c86a90039e..7c08af9851 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test
@@ -23,13 +23,13 @@ C: a001 LOGIN imapuser password
 S: a001 OK LOGIN completed.
 
 C: a002 CREATE test
-S: a002 OK CREATE completed.
+S: a002 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a003 CREATE #private.test2
-S: a003 OK CREATE completed.
+S: a003 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a004 CREATE #private.other.test3
-S: a004 OK CREATE completed.
+S: a004 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a005 CREATE #any.hello
 S: a005 NO CREATE You can not access a mailbox that does not belong to you
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Status.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Status.test
index 66cddc0794..e134f271e9 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Status.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Status.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: a1 CREATE statustest
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 # Tests for the STATUS command
 C: a001 STATUS statustest (MESSAGES)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/StringArgs.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/StringArgs.test
index 57dbb17ffd..704ee26245 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/StringArgs.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/StringArgs.test
@@ -39,7 +39,7 @@ S: a1 NO CREATE failed. Mailbox already exists.
 
 # Tests with an atomic mailbox name.
 C: a1 CREATE atomMailbox
-S: a1 OK CREATE completed.
+S: a1 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 # atom
 C: a001 STATUS atomMailbox (MESSAGES)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Subscribe.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Subscribe.test
index 9b8b9b8c4f..461d067b8b 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Subscribe.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Subscribe.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE subscribetest
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE subscribetest.subfolder
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE subscribetest1
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE subscribetest1.subfolder1
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a01 LSUB "" "*"
 S: a01 OK LSUB completed.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/TextPartialFetch.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/TextPartialFetch.test
index 1d5a82fd19..2a55940fe3 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/TextPartialFetch.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/TextPartialFetch.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Uid.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Uid.test
index 79c35a5155..c20dd048d1 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Uid.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Uid.test
@@ -57,7 +57,7 @@ S: a2 OK FETCH completed.
 
 # CREATE and do a UID COPY
 C: a3 CREATE copied
-S: a3 OK CREATE completed.
+S: a3 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: a4 UID COPY 2 copied
 S: a4 OK (\[.+\] )?COPY completed.
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtoms.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtoms.test
index f5bced3399..fd64d991a2 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtoms.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtoms.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test
index 539a933d9b..b5ee419685 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
@@ -2291,7 +2291,7 @@ S: A136 OK SEARCH completed\.
 # S: A139 OK SEARCH completed\.
 
 C: A200 CREATE secondmailbox
-S: A200 OK CREATE completed\.
+S: A200 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 
 C: A201 SELECT secondmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchCombinations.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchCombinations.test
index fceefa42e7..b90f339909 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchCombinations.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchCombinations.test
@@ -17,7 +17,7 @@
 # under the License.                                           #
 ################################################################
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
 S: \* 0 EXISTS
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UserFlagsSupport.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UserFlagsSupport.test
index 9acf452f13..8bbe074a57 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UserFlagsSupport.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UserFlagsSupport.test
@@ -18,7 +18,7 @@
 ################################################################
 
 C: A2 CREATE testmailbox
-S: A2 OK CREATE completed\.
+S: A2 OK \[MAILBOXID \(.+\)\] CREATE completed\.
 
 C: A3 SELECT testmailbox
 S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/XList.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/XList.test
index 7a76bf1e46..57ed556f05 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/XList.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/XList.test
@@ -18,13 +18,13 @@
 ################################################################
 # Create a few folders
 C: 10 CREATE Spam
-S: 10 OK CREATE completed.
+S: 10 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 11 CREATE Trash
-S: 11 OK CREATE completed.
+S: 11 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 12 CREATE Sent
-S: 12 OK CREATE completed.
+S: 12 OK \[MAILBOXID \(.+\)\] CREATE completed.
 C: 13 CREATE Drafts
-S: 13 OK CREATE completed.
+S: 13 OK \[MAILBOXID \(.+\)\] CREATE completed.
 
 C: 10 XLIST "" *
 SUB {
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/message/response/StatusResponse.java b/protocols/imap/src/main/java/org/apache/james/imap/api/message/response/StatusResponse.java
index ec4becc973..519f8cadb5 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/message/response/StatusResponse.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/message/response/StatusResponse.java
@@ -38,8 +38,10 @@ import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.mailbox.MessageSequenceNumber;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.ModSeq;
+import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.UidValidity;
 
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
 /**
@@ -165,6 +167,10 @@ public interface StatusResponse extends ImapResponseMessage {
             return new ResponseCode("APPENDUID", Arrays.asList(uidParam), uidValidity.asLong(), false);
         }
 
+        public static ResponseCode mailboxId(MailboxId mailboxId) {
+            return new ResponseCode("MAILBOXID", ImmutableList.of(mailboxId.serialize()), NO_NUMBER, true);
+        }
+
         /** RFC4315 <code>COPYUID</code> response code */
         public static ResponseCode copyUid(UidValidity uidValidity, IdRange[] sourceRanges, IdRange[] targetRanges) {
             String source = formatRanges(sourceRanges);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/CreateProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/CreateProcessor.java
index 8a3bbc827b..390ff10087 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/CreateProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/CreateProcessor.java
@@ -20,6 +20,8 @@
 package org.apache.james.imap.processor;
 
 import org.apache.james.imap.api.display.HumanReadableText;
+import org.apache.james.imap.api.message.UidRange;
+import org.apache.james.imap.api.message.response.StatusResponse;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.main.PathConverter;
@@ -49,21 +51,21 @@ public class CreateProcessor extends AbstractMailboxProcessor<CreateRequest> {
 
         return Mono.fromCallable(() -> PathConverter.forSession(session).buildFullPath(request.getMailboxName()))
             .flatMap(mailboxPath -> Mono.from(mailboxManager.createMailboxReactive(mailboxPath, session.getMailboxSession()))
-            .then(unsolicitedResponses(session, responder, false))
-            .then(Mono.fromRunnable(() -> okComplete(request, responder)))
-            .onErrorResume(MailboxExistsException.class, e -> {
-                no(request, responder, HumanReadableText.MAILBOX_EXISTS);
-                return ReactorUtils.logAsMono(() -> LOGGER.debug("Create failed for mailbox {} as it already exists", mailboxPath, e));
-            })
-            .onErrorResume(TooLongMailboxNameException.class, e -> {
-                taggedBad(request, responder, HumanReadableText.FAILURE_MAILBOX_NAME);
-                return ReactorUtils.logAsMono(() -> LOGGER.debug("The mailbox name length is over limit: {}", mailboxPath.getName(), e));
-            })
-            .onErrorResume(TooLongMailboxNameException.class, e -> {
-                no(request, responder, HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING);
-                return ReactorUtils.logAsMono(() -> LOGGER.error("Create failed for mailbox {}", mailboxPath, e));
-            })
-            .then());
+                .flatMap(mailboxId -> unsolicitedResponses(session, responder, false)
+                    .then(Mono.fromRunnable(() -> okComplete(request, StatusResponse.ResponseCode.mailboxId(mailboxId), responder))))
+                .onErrorResume(MailboxExistsException.class, e -> {
+                    no(request, responder, HumanReadableText.MAILBOX_EXISTS);
+                    return ReactorUtils.logAsMono(() -> LOGGER.debug("Create failed for mailbox {} as it already exists", mailboxPath, e));
+                })
+                .onErrorResume(TooLongMailboxNameException.class, e -> {
+                    taggedBad(request, responder, HumanReadableText.FAILURE_MAILBOX_NAME);
+                    return ReactorUtils.logAsMono(() -> LOGGER.debug("The mailbox name length is over limit: {}", mailboxPath.getName(), e));
+                })
+                .onErrorResume(TooLongMailboxNameException.class, e -> {
+                    no(request, responder, HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING);
+                    return ReactorUtils.logAsMono(() -> LOGGER.error("Create failed for mailbox {}", mailboxPath, e));
+                })
+                .then());
     }
 
     @Override


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