You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2024/04/15 03:20:15 UTC

(james-project) branch master updated (23d1bc4363 -> 0a34f3c0db)

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

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


    from 23d1bc4363 Fix warning deprecate new URL in java 21 (#2193)
     new 2da2e8eb38 [GUICE BINDING] Eager load FilteringManagement to avoid Guice circle dependency error
     new 732f872aba JAMES-4025 Update JMAP server test cases after remove jmap draft
     new d176f77154 JAMES-4025 Drop JMAP draft guice binding
     new ffdd89290e JAMES-4025 Drop artifact james-server-jmap-draft-integration-testing
     new 349ae75283 JAMES-4025 Drop artifact james-server-jmap-draft
     new 99ea88c1cc JAMES-4025 Drop AccessToken authentication strategy and related classes
     new e63edfa809 JAMES-4025 Drop Jmap draft - update document
     new ddf95a97db JAMES-4025 Drop Jmap draft - remove unused classes
     new 69f0a9ddeb JAMES-4025 Relocate JmapJamesServerContract, JMAPModuleTest, MailetPreconditionTest
     new 0a34f3c0db JAMES-4025 Remove JMAP Version.DRAFT

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


Summary of changes:
 code-coverage-report/pom.xml                       |   17 -
 examples/oidc/james/jmap.properties                |    4 -
 pom.xml                                            |   16 -
 server/apps/cassandra-app/pom.xml                  |    6 -
 .../sample-configuration/jmap.properties           |    4 -
 .../james/CassandraDuplicatingJamesServerTest.java |    2 +-
 .../org/apache/james/CassandraJamesServerTest.java |    2 +-
 .../james/CassandraLdapJmapJamesServerTest.java    |    2 +-
 .../james/CassandraLegacyQuotaJamesServerTest.java |    2 +-
 .../james/WithCassandraBlobStoreImmutableTest.java |    2 +-
 .../src/test/resources/eml/htmlMail.eml            |  162 +-
 .../modules/ROOT/pages/architecture/index.adoc     |    4 -
 .../ROOT/pages/benchmark/james-benchmark.adoc      |    1 -
 .../docs/modules/ROOT/pages/configure/jmap.adoc    |   15 +-
 server/apps/distributed-app/pom.xml                |    6 -
 .../sample-configuration/jmap.properties           |    4 -
 .../james/CassandraPulsarJamesServerTest.java      |    2 +-
 .../CassandraRabbitMQLdapJmapJamesServerTest.java  |    2 +-
 ...assandraRabbitMQLegacyQuotaJamesServerTest.java |    2 +-
 .../org/apache/james/WithCacheImmutableTest.java   |    2 +-
 ...ssandraDeduplicationBlobStoreImmutableTest.java |    2 +-
 ...CassandraPassThroughBlobStoreImmutableTest.java |    2 +-
 .../james/WithDefaultAwsS3ImmutableTest.java       |    2 +-
 .../james/WithEncryptedBlobStoreImmutableTest.java |    2 +-
 .../james/WithScanningSearchImmutableTest.java     |    2 +-
 .../james/WithoutMailQueueViewImmutableTest.java   |    2 +-
 server/apps/distributed-pop3-app/pom.xml           |    6 -
 .../sample-configuration/jmap.properties           |    4 -
 .../java/org/apache/james/DisabledSpoolerTest.java |    2 +-
 .../apache/james/MemoryJmapJamesServerTest.java    |   60 +-
 .../james/modules/data/CassandraJmapModule.java    |   12 +-
 .../james/modules/data/MemoryDataJmapModule.java   |    5 -
 server/container/guice/protocols/jmap/pom.xml      |    6 +-
 .../java/org/apache/james/jmap/JMAPModule.java     |   39 +-
 .../james/jmap/JMAPWithoutDraftCommonModule.java   |   20 -
 .../james/jmap/draft/DraftMethodsModule.java       |  127 -
 .../jmap/draft/JMAPConfigurationStartUpCheck.java  |   75 -
 .../james/jmap/draft/JMAPDraftCommonModule.java    |   80 -
 .../jmap/draft/JmapConfigurationSanitizer.java     |   66 -
 .../james/modules/protocols/JMAPServerModule.java  |   23 +-
 .../james/jmap/{draft => }/JMAPModuleTest.java     |    2 +-
 .../jmap/{draft => }/JmapJamesServerContract.java  |   10 +-
 .../jmap/{draft => }/MailetPreconditionTest.java   |    2 +-
 .../apache/james/modules/TestJMAPServerModule.java |   40 +-
 .../cassandra/access/CassandraAccessModule.java    |   39 -
 .../cassandra/access/CassandraAccessTokenDAO.java  |   95 -
 .../access/CassandraAccessTokenRepository.java     |   64 -
 .../access/table/CassandraAccessTokenTable.java    |   31 -
 .../access/CassandraAccessTokenRepositoryTest.java |   46 -
 .../apache/james/jmap/api/access/AccessToken.java  |   65 -
 .../jmap/api/access/AccessTokenRepository.java     |   37 -
 .../api/access/exceptions/InvalidAccessToken.java  |   29 -
 .../exceptions/NotAnAccessTokenException.java      |   27 -
 .../memory/access/MemoryAccessTokenRepository.java |   74 -
 .../api/access/AccessTokenRepositoryContract.java  |   85 -
 .../james/jmap/api/access/AccessTokenTest.java     |   43 -
 .../access/MemoryAccessTokenRepositoryTest.java    |   38 -
 server/pom.xml                                     |    2 -
 .../jmap-draft-integration-testing-common/pom.xml  |  162 -
 .../james/jmap/AllowAuthenticationStrategy.java    |   55 -
 .../java/org/apache/james/jmap/ContainerTest.java  |   57 -
 .../james/jmap/DenyAuthenticationStrategy.java     |   43 -
 .../james/jmap/FixedDateZonedDateTimeProvider.java |   39 -
 .../apache/james/jmap/JMAPAuthenticationTest.java  |  520 --
 .../java/org/apache/james/jmap/JmapURIBuilder.java |   32 -
 .../org/apache/james/jmap/MessageAppender.java     |   57 -
 .../org/apache/james/jmap/MockSmtpTestRule.java    |   74 -
 ...ularizeJmapDraftAuthenticationStrategyTest.java |  209 -
 .../org/apache/james/jmap/ProvisioningTest.java    |  118 -
 .../org/apache/james/jmap/UserCredentials.java     |   66 -
 .../apache/james/jmap/VacationIntegrationTest.java |  437 --
 .../james/jmap/VacationRelayIntegrationTest.java   |  132 -
 .../apache/james/jmap/categories/BasicFeature.java |   27 -
 .../categories/CassandraAndOpenSearchCategory.java |   27 -
 .../james/jmap/categories/EnableCucumber.java      |   27 -
 .../methods/integration/CorsHeaderAPITest.java     |   83 -
 .../jmap/draft/methods/integration/FilterTest.java | 2449 --------
 .../integration/GetMailboxesMethodTest.java        |  916 ---
 .../integration/GetMessageListMethodTest.java      | 2454 --------
 .../integration/GetVacationResponseTest.java       |  268 -
 .../methods/integration/QuotaMailingTest.java      |  189 -
 .../methods/integration/SendMDNMethodTest.java     |  446 --
 .../integration/SetMailboxesMethodTest.java        | 2439 --------
 .../SetMessagesMethodReRoutingTest.java            |  241 -
 .../methods/integration/SetMessagesMethodTest.java | 6320 --------------------
 .../SetMessagesOutboxFlagUpdateTest.java           |  208 -
 .../integration/SetVacationResponseTest.java       |  427 --
 .../methods/integration/cucumber/ContentType.java  |   49 -
 .../integration/cucumber/DownloadStepdefs.java     |  528 --
 .../cucumber/GetMailboxesMethodStepdefs.java       |  147 -
 .../cucumber/GetMessageListMethodStepdefs.java     |  133 -
 .../cucumber/GetMessagesMethodStepdefs.java        |  770 ---
 .../methods/integration/cucumber/HttpClient.java   |   58 -
 .../methods/integration/cucumber/ImapStepdefs.java |  153 -
 .../methods/integration/cucumber/MainStepdefs.java |   87 -
 .../integration/cucumber/MessageIdStepdefs.java    |   49 -
 .../cucumber/SetMailboxesMethodStepdefs.java       |  342 --
 .../cucumber/SetMessagesMethodStepdefs.java        |  332 -
 .../integration/cucumber/StringListToFlags.java    |   61 -
 .../cucumber/StringListToFlagsTest.java            |   81 -
 .../integration/cucumber/UploadStepdefs.java       |  231 -
 .../methods/integration/cucumber/UserStepdefs.java |  137 -
 .../cucumber/util/BooleanFromString.java           |   34 -
 .../cucumber/util/IntegerFromString.java           |   35 -
 .../cucumber/util/ObjectFromString.java            |   27 -
 .../cucumber/util/ObjectFromStringExtractor.java   |   41 -
 .../cucumber/util/StringFromString.java            |   35 -
 .../integration/cucumber/util/TableRow.java        |   50 -
 .../attachment/nonIndexableAttachment.html         |  827 ---
 .../resources/cucumber/DownloadEndpoint.feature    |  100 -
 .../test/resources/cucumber/DownloadGet.feature    |   99 -
 .../test/resources/cucumber/DownloadPost.feature   |   43 -
 .../test/resources/cucumber/GetMessages.feature    |  444 --
 .../cucumber/ImapKeywordsConsistency.feature       |  138 -
 ...etMessagesMailboxesUpdatesCompatibility.feature |   67 -
 .../resources/cucumber/MailboxModification.feature |   41 -
 .../test/resources/cucumber/SetMessages.feature    |  111 -
 .../test/resources/cucumber/UploadEndpoint.feature |   66 -
 .../cucumber/sharing/CopyAndSharing.feature        |   58 -
 .../cucumber/sharing/DownloadAndSharing.feature    |   43 -
 .../cucumber/sharing/GetMessageAndSharing.feature  |   49 -
 .../sharing/GetMessageListAndSharing.feature       |   60 -
 .../KeywordsConsistencyOnDelegationMailbox.feature |  140 -
 .../sharing/MailboxCreationAndSharing.feature      |   40 -
 .../sharing/MailboxDeletionAndSharing.feature      |   36 -
 .../cucumber/sharing/MoveMailboxAndSharing.feature |   77 -
 .../cucumber/sharing/MoveMessageAndSharing.feature |  149 -
 .../sharing/RenamingMailboxAndSharing.feature      |   49 -
 .../cucumber/sharing/SetFlagAndSharing.feature     |   62 -
 .../sharing/SetMessagesOnSharedMailbox.feature     |  112 -
 .../SharingChildrenWithoutSharingParent.feature    |   42 -
 .../sharing/SharingMailboxWithOtherDomain.feature  |   31 -
 ...ringParentMailboxWithAndWithoutChildren.feature |  112 -
 .../src/test/resources/eml/attachment.pdf          |  Bin 9404 -> 0 bytes
 .../src/test/resources/eml/calendar.eml            |   42 -
 .../embeddedMultipartWithInlineTextAttachment.eml  |   42 -
 .../eml/htmlAndTextMultipartWithOneAttachment.eml  |   64 -
 .../resources/eml/htmlBodyWithManyEmptyTags.eml    |  105 -
 .../eml/htmlWithLongAndComplicatedContent.eml      | 1995 ------
 .../src/test/resources/eml/ics_in_header.eml       |   46 -
 .../src/test/resources/eml/inlinedMultipart.eml    |   36 -
 .../eml/inlinedWithoutContentDisposition.eml       |   69 -
 .../test/resources/eml/inlinedWithoutContentID.eml |   60 -
 .../src/test/resources/eml/longLine.eml            |    1 -
 .../eml/mailWithInlinedAttachmentAndBlankCid.eml   |   74 -
 .../eml/mailWithInlinedAttachmentButNoCid.eml      |   72 -
 .../src/test/resources/eml/mailWithRecipients.eml  |   14 -
 .../src/test/resources/eml/multipartRelated.eml    |   38 -
 .../test/resources/eml/noTextBodyButHtmlBody.eml   |   84 -
 .../src/test/resources/eml/oneAttachment-part1.eml |   30 -
 .../src/test/resources/eml/oneAttachment-part2.eml |    9 -
 .../src/test/resources/eml/oneAttachment.eml       |   38 -
 .../src/test/resources/eml/oneInlinedImage.eml     |   82 -
 .../oneInlinedImageWithoutContentDisposition.eml   |   72 -
 .../src/test/resources/eml/sameInlinedImages.eml   |   84 -
 .../textInMainMultipartHtmlInInnerMultipart.eml    |   43 -
 .../src/test/resources/eml/twoAttachments.eml      |   74 -
 .../test/resources/eml/twoAttachmentsTextPlain.eml |   73 -
 .../src/test/resources/eml/twoSameAttachments.eml  |   77 -
 .../src/test/resources/eml/windows1252charset.eml  |   43 -
 .../memory-jmap-draft-integration-testing/pom.xml  |  176 -
 .../james/jmap/memory/MemoryCorsHeaderAPITest.java |   37 -
 .../apache/james/jmap/memory/MemoryFilterTest.java |   47 -
 .../jmap/memory/MemoryGetMailboxesMethodTest.java  |   39 -
 .../memory/MemoryGetMessageListMethodTest.java     |   64 -
 .../MemoryGetVacationResponseMethodTest.java       |   39 -
 .../jmap/memory/MemoryJmapAuthenticationTest.java  |   41 -
 ...ularizeJmapDraftAuthenticationStrategyTest.java |   46 -
 .../james/jmap/memory/MemoryProvisioningTest.java  |   37 -
 .../james/jmap/memory/MemoryQuotaMailingTest.java  |   38 -
 .../james/jmap/memory/MemorySendMDNMethodTest.java |   52 -
 .../jmap/memory/MemorySetMailboxesMethodTest.java  |   37 -
 .../MemorySetMessagesMethodReRoutingTest.java      |   37 -
 .../jmap/memory/MemorySetMessagesMethodTest.java   |   45 -
 .../MemorySetMessagesOutboxFlagUpdateTest.java     |   57 -
 .../MemorySetVacationResponseMethodTest.java       |   37 -
 .../jmap/memory/MemoryVacationIntegrationTest.java |   37 -
 .../memory/MemoryVacationRelayIntegrationTest.java |   47 -
 .../MemoryDownloadEnpointCucumberTest.java         |   36 -
 .../cucumber/MemoryDownloadGetCucumberTest.java    |   36 -
 .../cucumber/MemoryDownloadPostCucumberTest.java   |   36 -
 .../cucumber/MemoryGetMessagesMethodTest.java      |   36 -
 .../MemoryIMAPKeywordsInconsistenciesTest.java     |   36 -
 .../MemoryIMAPSetMessagesCompatibilityTest.java    |   36 -
 .../MemorySetMailboxesMethodCucumberTest.java      |   36 -
 .../MemorySetMessagesMethodCucumberTest.java       |   36 -
 .../jmap/memory/cucumber/MemorySharingTest.java    |   36 -
 .../james/jmap/memory/cucumber/MemoryStepdefs.java |   75 -
 .../memory/cucumber/MemoryUploadCucumberTest.java  |   36 -
 .../src/test/resources/dnsservice.xml              |   25 -
 .../src/test/resources/domainlist.xml              |   24 -
 .../src/test/resources/imapserver.xml              |   41 -
 .../src/test/resources/keystore                    |  Bin 2245 -> 0 bytes
 .../src/test/resources/listeners.xml               |   50 -
 .../src/test/resources/lmtpserver.xml              |   23 -
 .../src/test/resources/mailetcontainer.xml         |  127 -
 .../src/test/resources/mailrepositorystore.xml     |   30 -
 .../src/test/resources/managesieveserver.xml       |   32 -
 .../src/test/resources/pop3server.xml              |   23 -
 .../src/test/resources/smtpserver.xml              |   53 -
 .../src/test/resources/usersrepository.xml         |   25 -
 .../jmap-draft-integration-testing/pom.xml         |   50 -
 .../pom.xml                                        |  193 -
 .../jmap/rabbitmq/RabbitMQAwsS3FilterTest.java     |   50 -
 .../RabbitMQAwsS3GetMailboxesMethodTest.java       |   44 -
 .../RabbitMQAwsS3GetMessageListMethodTest.java     |   55 -
 .../RabbitMQAwsS3GetVacationResponseTest.java      |   44 -
 .../RabbitMQAwsS3JmapAuthenticationTest.java       |   49 -
 .../rabbitmq/RabbitMQAwsS3ProvisioningTest.java    |   44 -
 .../rabbitmq/RabbitMQAwsS3QuotaMailingTest.java    |   42 -
 .../rabbitmq/RabbitMQAwsS3SendMDNMethodTest.java   |   66 -
 .../RabbitMQAwsS3SetMailboxesMethodTest.java       |   45 -
 ...abbitMQAwsS3SetMessagesMethodReRoutingTest.java |   42 -
 .../RabbitMQAwsS3SetMessagesMethodTest.java        |   59 -
 .../RabbitMQAwsS3SetVacationResponseTest.java      |   43 -
 .../RabbitMQAwsS3VacationIntegrationTest.java      |   43 -
 .../RabbitMQAwsS3VacationRelayIntegrationTest.java |   54 -
 .../src/test/resources/dnsservice.xml              |   25 -
 .../src/test/resources/domainlist.xml              |   24 -
 .../src/test/resources/imapserver.xml              |   57 -
 .../src/test/resources/keystore                    |  Bin 2245 -> 0 bytes
 .../src/test/resources/listeners.xml               |   53 -
 .../src/test/resources/lmtpserver.xml              |   42 -
 .../src/test/resources/mailetcontainer.xml         |  126 -
 .../src/test/resources/mailrepositorystore.xml     |   30 -
 .../src/test/resources/pop3server.xml              |   43 -
 .../src/test/resources/smtpserver.xml              |  109 -
 server/protocols/jmap-draft/doc/Dockerfile         |   19 -
 server/protocols/jmap-draft/doc/README.md          |   15 -
 server/protocols/jmap-draft/doc/annotation.css     |   16 -
 server/protocols/jmap-draft/doc/mkdocs.yml         |    6 -
 server/protocols/jmap-draft/doc/specs/LICENSE.md   |  190 -
 server/protocols/jmap-draft/doc/specs/README       |    8 -
 .../doc/specs/client-guide/jmap-client-guide.mdwn  |  653 --
 .../protocols/jmap-draft/doc/specs/home/faq.mdwn   |   49 -
 .../doc/specs/server-guide/jmap-server-guide.mdwn  |  312 -
 .../jmap-draft/doc/specs/software/software.mdwn    |   19 -
 .../jmap-draft/doc/specs/spec/account.mdwn         |  119 -
 .../jmap-draft/doc/specs/spec/apimodel.mdwn        |  259 -
 .../jmap-draft/doc/specs/spec/authentication.mdwn  |  193 -
 .../jmap-draft/doc/specs/spec/calendar.mdwn        |  195 -
 .../jmap-draft/doc/specs/spec/calendarevent.mdwn   |  305 -
 .../doc/specs/spec/calendareventlist.mdwn          |   97 -
 .../jmap-draft/doc/specs/spec/contact.mdwn         |  246 -
 .../jmap-draft/doc/specs/spec/contactgroup.mdwn    |  138 -
 .../jmap-draft/doc/specs/spec/contactlist.mdwn     |  114 -
 .../jmap-draft/doc/specs/spec/datamodel.mdwn       |   39 -
 .../jmap-draft/doc/specs/spec/mailbox.mdwn         |  342 --
 .../jmap-draft/doc/specs/spec/message.mdwn         |  533 --
 .../jmap-draft/doc/specs/spec/messagelist.mdwn     |  341 --
 .../protocols/jmap-draft/doc/specs/spec/push.mdwn  |   65 -
 .../jmap-draft/doc/specs/spec/searchsnippet.mdwn   |   44 -
 .../jmap-draft/doc/specs/spec/thread.mdwn          |  123 -
 .../jmap-draft/doc/specs/spec/upload.mdwn          |   53 -
 .../doc/specs/spec/vacationresponse.mdwn           |   71 -
 server/protocols/jmap-draft/pom.xml                |  328 -
 .../james/jmap/draft/JMAPDraftConfiguration.java   |  168 -
 .../james/jmap/draft/api/AccessTokenManager.java   |   37 -
 .../james/jmap/draft/api/SimpleTokenFactory.java   |   29 -
 .../james/jmap/draft/api/SimpleTokenManager.java   |   34 -
 .../jmap/draft/crypto/AccessTokenManagerImpl.java  |   72 -
 .../james/jmap/draft/crypto/AsymmetricKeys.java    |   42 -
 .../jmap/draft/crypto/JamesSignatureHandler.java   |   86 -
 .../james/jmap/draft/crypto/SecurityKeyLoader.java |  114 -
 .../james/jmap/draft/crypto/SignatureHandler.java  |   30 -
 .../jmap/draft/crypto/SignedTokenFactory.java      |   73 -
 .../jmap/draft/crypto/SignedTokenManager.java      |   66 -
 .../exceptions/AttachmentsNotFoundException.java   |   40 -
 .../jmap/draft/exceptions/BadRequestException.java |   30 -
 .../draft/exceptions/InternalErrorException.java   |   30 -
 .../exceptions/InvalidDraftKeywordsException.java  |   26 -
 .../InvalidMailboxForCreationException.java        |   30 -
 .../InvalidOriginMessageForMDNException.java       |   38 -
 .../exceptions/InvalidOutboxMoveException.java     |   26 -
 .../exceptions/JmapFieldNotSupportedException.java |   41 -
 .../draft/exceptions/MailboxHasChildException.java |   23 -
 .../draft/exceptions/MailboxNotOwnedException.java |   29 -
 .../exceptions/MailboxParentNotFoundException.java |   42 -
 .../MalformedContinuationTokenException.java       |   31 -
 .../draft/exceptions/MessageNotFoundException.java |   23 -
 .../draft/exceptions/SizeExceededException.java    |   26 -
 .../SystemMailboxNotUpdatableException.java        |   23 -
 .../jmap/draft/json/FieldNamePropertyFilter.java   |   40 -
 .../james/jmap/draft/json/FilterDeserializer.java  |   62 -
 .../draft/json/MultipleClassesDeserializer.java    |   66 -
 .../draft/json/MultipleObjectMapperBuilder.java    |   40 -
 .../json/OptionalZonedDateTimeDeserializer.java    |   37 -
 .../json/OptionalZonedDateTimeSerializer.java      |   39 -
 .../james/jmap/draft/methods/GetFilterMethod.java  |  117 -
 .../jmap/draft/methods/GetMailboxesMethod.java     |  180 -
 .../jmap/draft/methods/GetMessageListMethod.java   |  312 -
 .../jmap/draft/methods/GetMessagesMethod.java      |  145 -
 .../draft/methods/GetVacationResponseMethod.java   |  104 -
 .../jmap/draft/methods/JmapRequestParser.java      |   34 -
 .../jmap/draft/methods/JmapRequestParserImpl.java  |   51 -
 .../jmap/draft/methods/MIMEMessageConverter.java   |  371 --
 .../MailboxInvalidMessageCreationException.java    |   26 -
 .../methods/MailboxSendingNotAllowedException.java |   45 -
 .../james/jmap/draft/methods/MessageAppender.java  |  199 -
 .../james/jmap/draft/methods/MessageSender.java    |   98 -
 .../james/jmap/draft/methods/ReferenceUpdater.java |  112 -
 .../james/jmap/draft/methods/RequestHandler.java   |  117 -
 .../james/jmap/draft/methods/SendMDNProcessor.java |  180 -
 .../james/jmap/draft/methods/SetFilterMethod.java  |  245 -
 .../methods/SetMailboxesCreationProcessor.java     |  226 -
 .../methods/SetMailboxesDestructionProcessor.java  |  170 -
 .../jmap/draft/methods/SetMailboxesMethod.java     |  102 -
 .../jmap/draft/methods/SetMailboxesProcessor.java  |   38 -
 .../draft/methods/SetMailboxesUpdateProcessor.java |  305 -
 .../methods/SetMessagesCreationProcessor.java      |  351 --
 .../methods/SetMessagesDestructionProcessor.java   |   97 -
 .../jmap/draft/methods/SetMessagesMethod.java      |   95 -
 .../jmap/draft/methods/SetMessagesProcessor.java   |   38 -
 .../draft/methods/SetMessagesUpdateProcessor.java  |  498 --
 .../draft/methods/SetVacationResponseMethod.java   |  134 -
 .../draft/methods/UpdateMessagePatchConverter.java |   59 -
 .../draft/methods/UpdateMessagePatchValidator.java |   80 -
 .../james/jmap/draft/methods/ValidationResult.java |   94 -
 .../apache/james/jmap/draft/methods/Validator.java |   28 -
 .../james/jmap/draft/methods/ValueWithId.java      |   79 -
 .../james/jmap/draft/model/AccessTokenRequest.java |   87 -
 .../jmap/draft/model/AccessTokenResponse.java      |  104 -
 .../jmap/draft/model/AttachmentAccessToken.java    |  180 -
 .../jmap/draft/model/AuthenticatedRequest.java     |   39 -
 .../james/jmap/draft/model/ContinuationToken.java  |  160 -
 .../jmap/draft/model/ContinuationTokenRequest.java |   97 -
 .../draft/model/ContinuationTokenResponse.java     |  104 -
 .../james/jmap/draft/model/CreationMessage.java    |  513 --
 .../james/jmap/draft/model/CreationMessageId.java  |   67 -
 .../james/jmap/draft/model/EndPointsResponse.java  |   89 -
 .../james/jmap/draft/model/EnvelopeUtils.java      |   53 -
 .../org/apache/james/jmap/draft/model/Filter.java  |   70 -
 .../james/jmap/draft/model/FilterCondition.java    |  492 --
 .../james/jmap/draft/model/FilterOperator.java     |  136 -
 .../james/jmap/draft/model/GetFilterRequest.java   |   58 -
 .../james/jmap/draft/model/GetFilterResponse.java  |   88 -
 .../jmap/draft/model/GetMailboxesRequest.java      |  102 -
 .../jmap/draft/model/GetMailboxesResponse.java     |  113 -
 .../jmap/draft/model/GetMessageListRequest.java    |  205 -
 .../jmap/draft/model/GetMessageListResponse.java   |  179 -
 .../james/jmap/draft/model/GetMessagesRequest.java |   94 -
 .../jmap/draft/model/GetMessagesResponse.java      |  105 -
 .../james/jmap/draft/model/GetVacationRequest.java |   51 -
 .../jmap/draft/model/GetVacationResponse.java      |   89 -
 .../org/apache/james/jmap/draft/model/Header.java  |   76 -
 .../james/jmap/draft/model/InvocationRequest.java  |   59 -
 .../org/apache/james/jmap/draft/model/JmapMDN.java |  231 -
 .../apache/james/jmap/draft/model/JmapRuleDTO.java |  191 -
 .../james/jmap/draft/model/MDNDisposition.java     |  119 -
 .../james/jmap/draft/model/MailboxCreationId.java  |   63 -
 .../james/jmap/draft/model/MailboxFactory.java     |  248 -
 .../james/jmap/draft/model/MailboxProperty.java    |   71 -
 .../apache/james/jmap/draft/model/OldKeyword.java  |  218 -
 .../apache/james/jmap/draft/model/Operator.java    |   32 -
 .../apache/james/jmap/draft/model/SetError.java    |  158 -
 .../james/jmap/draft/model/SetFilterRequest.java   |   81 -
 .../james/jmap/draft/model/SetFilterResponse.java  |   56 -
 .../jmap/draft/model/SetMailboxesRequest.java      |  117 -
 .../jmap/draft/model/SetMailboxesResponse.java     |  192 -
 .../james/jmap/draft/model/SetMessagesError.java   |   93 -
 .../james/jmap/draft/model/SetMessagesRequest.java |  178 -
 .../jmap/draft/model/SetMessagesResponse.java      |  265 -
 .../james/jmap/draft/model/SetVacationRequest.java |   84 -
 .../jmap/draft/model/SetVacationResponse.java      |   98 -
 .../jmap/draft/model/SignedExpiringToken.java      |   32 -
 .../james/jmap/draft/model/UpdateMessagePatch.java |  197 -
 .../james/jmap/draft/model/UploadResponse.java     |  146 -
 .../james/jmap/draft/model/VacationResponse.java   |  235 -
 .../deserialization/JmapRuleDTODeserializer.java   |   57 -
 .../james/jmap/draft/model/mailbox/Mailbox.java    |  382 --
 .../draft/model/mailbox/MailboxCreateRequest.java  |  160 -
 .../jmap/draft/model/mailbox/MailboxNamespace.java |   94 -
 .../draft/model/mailbox/MailboxUpdateRequest.java  |  162 -
 .../james/jmap/draft/model/mailbox/Quotas.java     |  133 -
 .../james/jmap/draft/model/mailbox/SortOrder.java  |   96 -
 .../apache/james/jmap/draft/send/MailSpool.java    |   72 -
 .../send/exception/MessageIdNotFoundException.java |   30 -
 .../james/jmap/draft/utils/DependencyGraph.java    |   69 -
 .../james/jmap/draft/utils/DownloadPath.java       |   48 -
 .../james/jmap/draft/utils/FilterToCriteria.java   |  123 -
 .../james/jmap/draft/utils/MailboxUtils.java       |   59 -
 .../james/jmap/draft/utils/SortConverter.java      |   92 -
 .../utils/SortingHierarchicalCollections.java      |   64 -
 .../draft/utils/quotas/DefaultQuotaLoader.java     |   55 -
 .../james/jmap/draft/utils/quotas/QuotaLoader.java |   56 -
 .../quotas/QuotaLoaderWithDefaultPreloaded.java    |   72 -
 .../http/AccessTokenAuthenticationStrategy.java    |   66 -
 .../james/jmap/http/AuthenticationRoutes.java      |  316 -
 .../jmap/http/DefaultMailboxesProvisioner.java     |   85 -
 .../org/apache/james/jmap/http/DownloadRoutes.java |  259 -
 .../org/apache/james/jmap/http/InjectionKeys.java  |   24 -
 .../org/apache/james/jmap/http/JMAPApiRoutes.java  |  148 -
 .../org/apache/james/jmap/http/LoggingHelper.java  |   49 -
 ...ParameterAccessTokenAuthenticationStrategy.java |   94 -
 .../org/apache/james/jmap/http/UploadRoutes.java   |  165 -
 .../apache/james/jmap/http/UserProvisioner.java    |   82 -
 .../jmap-draft/src/main/resources/jwt-public.der   |    0
 .../MessageFastViewProjectionItemFactoryTest.java  |  144 -
 .../org/apache/james/jmap/PreviewFactoryTest.java  |   73 -
 .../org/apache/james/jmap/draft/BeansTest.java     |   34 -
 .../jmap/draft/FixedDateZonedDateTimeProvider.java |   39 -
 .../jmap/draft/JMAPDraftConfigurationTest.java     |  119 -
 .../draft/crypto/AccessTokenManagerImplTest.java   |  151 -
 .../draft/crypto/JamesSignatureHandlerFixture.java |   54 -
 .../draft/crypto/JamesSignatureHandlerTest.java    |   84 -
 .../jmap/draft/crypto/SecurityKeyLoaderTest.java   |  149 -
 .../jmap/draft/crypto/SignedTokenFactoryTest.java  |   79 -
 .../jmap/draft/crypto/SignedTokenManagerTest.java  |  182 -
 .../jmap/draft/json/MultipleObjectMapperTest.java  |   90 -
 .../json/OperatorSerializeDeserializeTest.java     |   55 -
 .../jmap/draft/json/ParsingWritingObjects.java     |  109 -
 .../jmap/draft/json/ParsingWritingObjectsTest.java |   92 -
 .../jmap/draft/methods/ErrorResponseTest.java      |   90 -
 .../jmap/draft/methods/GetMailboxesMethodTest.java |  460 --
 .../jmap/draft/methods/GetMessagesMethodTest.java  |  777 ---
 .../methods/GetVacationResponseMethodTest.java     |  192 -
 .../draft/methods/JmapRequestParserImplTest.java   |   81 -
 .../draft/methods/JmapResponseWriterImplTest.java  |  272 -
 .../draft/methods/MIMEMessageConverterTest.java    | 1182 ----
 .../jmap/draft/methods/MessageSenderTest.java      |  125 -
 .../jmap/draft/methods/RequestHandlerTest.java     |  227 -
 .../methods/SetMailboxesCreationProcessorTest.java |   78 -
 .../jmap/draft/methods/SetMailboxesMethodTest.java |  146 -
 .../methods/SetMailboxesUpdateProcessorTest.java   |  128 -
 .../methods/SetMessagesCreationProcessorTest.java  |  507 --
 .../methods/SetMessagesUpdateProcessorTest.java    |  290 -
 .../methods/SetVacationResponseMethodTest.java     |  222 -
 .../methods/UpdateMessagePatchConverterTest.java   |   74 -
 .../methods/UpdateMessagePatchValidatorTest.java   |  100 -
 .../draft/model/AttachmentAccessTokenTest.java     |  127 -
 .../jmap/draft/model/ContinuationTokenTest.java    |   97 -
 .../jmap/draft/model/CreationMessageTest.java      |  228 -
 .../jmap/draft/model/FilterConditionTest.java      |  204 -
 .../james/jmap/draft/model/FilterOperatorTest.java |  127 -
 .../apache/james/jmap/draft/model/FilterTest.java  |  192 -
 .../model/GetMailboxMessageListResponseTest.java   |   89 -
 .../jmap/draft/model/GetMailboxesRequestTest.java  |   85 -
 .../draft/model/GetMessageListRequestTest.java     |   92 -
 .../jmap/draft/model/GetMessagesRequestTest.java   |   93 -
 .../jmap/draft/model/GetVacationRequestTest.java   |   32 -
 .../jmap/draft/model/GetVacationResponseTest.java  |   53 -
 .../apache/james/jmap/draft/model/HeaderTest.java  |   71 -
 .../jmap/draft/model/InvocationRequestTest.java    |   95 -
 .../jmap/draft/model/InvocationResponseTest.java   |   61 -
 .../apache/james/jmap/draft/model/JmapMDNTest.java |  185 -
 .../james/jmap/draft/model/MDNDispositionTest.java |   83 -
 .../james/jmap/draft/model/MailboxFactoryTest.java |  397 --
 .../jmap/draft/model/MailboxPropertyTest.java      |   46 -
 .../draft/model/MessageHeaderPropertyTest.java     |   86 -
 .../jmap/draft/model/MessagePropertiesTest.java    |  203 -
 .../jmap/draft/model/MessagePropertyTest.java      |   44 -
 .../apache/james/jmap/draft/model/NumberTest.java  |   67 -
 .../james/jmap/draft/model/OldKeywordTest.java     |  218 -
 .../james/jmap/draft/model/SetErrorTest.java       |  133 -
 .../jmap/draft/model/SetMailboxesRequestTest.java  |   70 -
 .../jmap/draft/model/SetMailboxesResponseTest.java |  119 -
 .../jmap/draft/model/SetMessagesRequestTest.java   |   65 -
 .../jmap/draft/model/SetMessagesResponseTest.java  |  187 -
 .../jmap/draft/model/SetVacationRequestTest.java   |   65 -
 .../jmap/draft/model/SetVacationResponseTest.java  |   46 -
 .../jmap/draft/model/UpdateMessagePatchTest.java   |  269 -
 .../james/jmap/draft/model/UploadResponseTest.java |   31 -
 .../jmap/draft/model/VacationResponseTest.java     |  126 -
 .../model/mailbox/MailboxCreateRequestTest.java    |   81 -
 .../draft/model/mailbox/MailboxNamespaceTest.java  |   72 -
 .../jmap/draft/model/mailbox/MailboxTest.java      |  240 -
 .../model/mailbox/MailboxUpdateRequestTest.java    |   62 -
 .../jmap/draft/model/mailbox/QuotaIdTest.java      |   32 -
 .../jmap/draft/model/mailbox/SortOrderTest.java    |   56 -
 .../james/jmap/draft/send/MailSpoolTest.java       |   87 -
 .../jmap/draft/utils/DependencyGraphTest.java      |  182 -
 .../jmap/draft/utils/FilterToCriteriaTest.java     |  457 --
 .../james/jmap/draft/utils/MailboxUtilsTest.java   |   69 -
 .../james/jmap/draft/utils/SortConverterTest.java  |  138 -
 .../utils/SortingHierarchicalCollectionsTest.java  |  148 -
 .../AccessTokenAuthenticationStrategyTest.java     |  151 -
 .../apache/james/jmap/http/AuthenticatorTest.java  |  178 -
 .../jmap/http/DefaultMailboxesProvisionerTest.java |  100 -
 .../DefaultMailboxesProvisionerThreadTest.java     |   69 -
 .../apache/james/jmap/http/DownloadRoutesTest.java |   61 -
 .../apache/james/jmap/http/JMAPApiRoutesTest.java  |  163 -
 .../jmap/http/JWTAuthenticationStrategyTest.java   |  170 -
 ...meterAccessTokenAuthenticationStrategyTest.java |   63 -
 .../james/jmap/http/UserProvisionerTest.java       |   95 -
 .../james/jmap/http/UserProvisionerThreadTest.java |   57 -
 .../jmap/http/XUserAuthenticationStrategyTest.java |  128 -
 .../jmap-draft/src/test/resources/badAliasKeystore |  Bin 2246 -> 0 bytes
 .../jmap-draft/src/test/resources/calendar.eml     |   42 -
 .../emptyBodyMessageWithOneAttachment.eml          |   52 -
 .../jmap-draft/src/test/resources/example.html     |   21 -
 .../jmap-draft/src/test/resources/fullMessage.eml  |   60 -
 .../src/test/resources/inlineAttachment.eml        |   24 -
 .../src/test/resources/json/message.json           |   28 -
 .../src/test/resources/json/subMessage.json        |   14 -
 .../jmap-draft/src/test/resources/key.pub          |    9 -
 .../jmap-draft/src/test/resources/keystore         |  Bin 2245 -> 0 bytes
 .../jmap-draft/src/test/resources/keystoreJava11   |  Bin 2581 -> 0 bytes
 .../jmap-draft/src/test/resources/keystoreJava7    |  Bin 2239 -> 0 bytes
 .../jmap-draft/src/test/resources/noReplyTo.eml    |   69 -
 .../src/test/resources/oneAttachment.eml           |   16 -
 .../src/test/resources/private.nopass.key          |   27 -
 .../jmap-draft/src/test/resources/spamMail.eml     |  135 -
 .../jmap/exceptions/BlobNotFoundException.java     |   41 -
 .../james/jmap/json/ObjectMapperFactory.java       |  295 -
 .../java/org/apache/james/jmap/json/RoleMixIn.java |   28 -
 .../org/apache/james/jmap/methods/BlobManager.java |   35 -
 .../apache/james/jmap/methods/BlobManagerImpl.java |  217 -
 .../apache/james/jmap/methods/ErrorResponse.java   |   88 -
 .../org/apache/james/jmap/methods/JmapRequest.java |   23 -
 .../apache/james/jmap/methods/JmapResponse.java    |  167 -
 .../james/jmap/methods/JmapResponseWriter.java     |   30 -
 .../james/jmap/methods/JmapResponseWriterImpl.java |  142 -
 .../java/org/apache/james/jmap/methods/Method.java |  135 -
 .../org/apache/james/jmap/model/Attachment.java    |  228 -
 .../java/org/apache/james/jmap/model/Blob.java     |  157 -
 .../java/org/apache/james/jmap/model/BlobId.java   |   92 -
 .../java/org/apache/james/jmap/model/Emailer.java  |  198 -
 .../james/jmap/model/InvocationResponse.java       |   57 -
 .../java/org/apache/james/jmap/model/Keyword.java  |  146 -
 .../java/org/apache/james/jmap/model/Keywords.java |  222 -
 .../apache/james/jmap/model/MessageProperties.java |  319 -
 .../org/apache/james/jmap/model/MethodCallId.java  |   59 -
 .../java/org/apache/james/jmap/model/Number.java   |  104 -
 .../org/apache/james/jmap/model/PreviewDTO.java    |   84 -
 .../java/org/apache/james/jmap/model/Property.java |   24 -
 .../apache/james/jmap/model/mailbox/Rights.java    |  264 -
 .../jmap/model/message/view/MessageFastView.java   |  130 -
 .../model/message/view/MessageFastViewFactory.java |  152 -
 .../jmap/model/message/view/MessageFullView.java   |  177 -
 .../model/message/view/MessageFullViewFactory.java |  409 --
 .../jmap/model/message/view/MessageHeaderView.java |  207 -
 .../message/view/MessageHeaderViewFactory.java     |   94 -
 .../model/message/view/MessageMetadataView.java    |  170 -
 .../message/view/MessageMetadataViewFactory.java   |   76 -
 .../james/jmap/model/message/view/MessageView.java |   26 -
 .../model/message/view/MessageViewFactory.java     |  161 -
 .../model/message/view/MetaMessageViewFactory.java |   55 -
 .../james/jmap/model/message/view/SubMessage.java  |  233 -
 .../apache/james/jmap/utils/KeywordsCombiner.java  |   64 -
 ...mputeMessageFastViewProjectionListenerTest.java |   18 +-
 .../james/jmap/json/ObjectMapperFactoryTest.java   |  288 -
 .../james/jmap/methods/BlobManagerImplTest.java    |  255 -
 .../apache/james/jmap/model/AttachmentTest.java    |  125 -
 .../java/org/apache/james/jmap/model/BlobTest.java |   89 -
 .../org/apache/james/jmap/model/EmailerTest.java   |  173 -
 .../org/apache/james/jmap/model/KeywordTest.java   |  207 -
 .../org/apache/james/jmap/model/KeywordsTest.java  |  209 -
 .../apache/james/jmap/model/MethodCallIdTest.java  |   47 -
 .../apache/james/jmap/model/PreviewDTOTest.java    |   71 -
 .../james/jmap/model/mailbox/RightsTest.java       |  331 -
 .../james/jmap/model/message/view/BlobIdTest.java  |   51 -
 .../message/view/MessageFastViewFactoryTest.java   |  252 -
 .../message/view/MessageFullViewFactoryTest.java   |  951 ---
 .../model/message/view/MessageFullViewTest.java    |  468 --
 .../message/view/MessageHeaderViewFactoryTest.java |  127 -
 .../view/MessageMetadataViewFactoryTest.java       |  135 -
 .../model/message/view/MessageViewFixture.java     |   48 -
 .../jmap/model/message/view/SubMessageTest.java    |  163 -
 .../james/jmap/utils/KeywordsCombinerTest.java     |  132 -
 .../james/jmap/routes/JMAPApiRoutesTest.scala      |   32 +-
 .../james/jmap/routes/SessionRoutesTest.scala      |    2 +-
 .../org/apache/james/jmap/JMAPConfiguration.java   |    2 +-
 .../main/java/org/apache/james/jmap/Version.java   |    1 -
 .../apache/james/jmap/JMAPConfigurationTest.java   |    6 +-
 .../java/org/apache/james/jmap/JMAPServerTest.java |   19 +-
 .../org/apache/james/jmap/VersionParserTest.java   |    1 -
 .../java/org/apache/james/jmap/AccessToken.java    |   40 -
 .../apache/james/jmap/HttpJmapAuthentication.java  |   76 -
 .../org/apache/james/jmap/JmapCommonRequests.java  |  214 -
 src/site/xdoc/server/config-jmap.xml               |   32 +-
 570 files changed, 149 insertions(+), 77135 deletions(-)
 rename server/{protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common => apps/cassandra-app}/src/test/resources/eml/htmlMail.eml (98%)
 delete mode 100644 server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/DraftMethodsModule.java
 delete mode 100644 server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPConfigurationStartUpCheck.java
 delete mode 100644 server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPDraftCommonModule.java
 delete mode 100644 server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapConfigurationSanitizer.java
 rename server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/{draft => }/JMAPModuleTest.java (99%)
 rename server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/{draft => }/JmapJamesServerContract.java (90%)
 rename server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/{draft => }/MailetPreconditionTest.java (99%)
 delete mode 100644 server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessModule.java
 delete mode 100644 server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenDAO.java
 delete mode 100644 server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepository.java
 delete mode 100644 server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/table/CassandraAccessTokenTable.java
 delete mode 100644 server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepositoryTest.java
 delete mode 100644 server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessToken.java
 delete mode 100644 server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessTokenRepository.java
 delete mode 100644 server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/InvalidAccessToken.java
 delete mode 100644 server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/NotAnAccessTokenException.java
 delete mode 100644 server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepository.java
 delete mode 100644 server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenRepositoryContract.java
 delete mode 100644 server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenTest.java
 delete mode 100644 server/data/data-jmap/src/test/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepositoryTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/pom.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/AllowAuthenticationStrategy.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/DenyAuthenticationStrategy.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JmapURIBuilder.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MessageAppender.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MockSmtpTestRule.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ModularizeJmapDraftAuthenticationStrategyTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ProvisioningTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/UserCredentials.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationRelayIntegrationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/BasicFeature.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/CassandraAndOpenSearchCategory.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/EnableCucumber.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/CorsHeaderAPITest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesMethodReRoutingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesOutboxFlagUpdateTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetVacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/ContentType.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/DownloadStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/GetMailboxesMethodStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/GetMessageListMethodStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/GetMessagesMethodStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/HttpClient.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/ImapStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/MainStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/MessageIdStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/SetMessagesMethodStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/StringListToFlags.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/StringListToFlagsTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/UploadStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/UserStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/util/BooleanFromString.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/util/IntegerFromString.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/util/ObjectFromString.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/util/ObjectFromStringExtractor.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/util/StringFromString.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/cucumber/util/TableRow.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/attachment/nonIndexableAttachment.html
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/DownloadEndpoint.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/DownloadGet.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/DownloadPost.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/GetMessages.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/ImapKeywordsConsistency.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/ImapSetMessagesMailboxesUpdatesCompatibility.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/MailboxModification.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/SetMessages.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/UploadEndpoint.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/CopyAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/DownloadAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/GetMessageAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/GetMessageListAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/KeywordsConsistencyOnDelegationMailbox.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/MailboxCreationAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/MailboxDeletionAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/MoveMailboxAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/MoveMessageAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/RenamingMailboxAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/SetFlagAndSharing.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/SetMessagesOnSharedMailbox.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/SharingChildrenWithoutSharingParent.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/SharingMailboxWithOtherDomain.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/cucumber/sharing/SharingParentMailboxWithAndWithoutChildren.feature
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/attachment.pdf
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/calendar.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/embeddedMultipartWithInlineTextAttachment.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/htmlAndTextMultipartWithOneAttachment.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/htmlBodyWithManyEmptyTags.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/htmlWithLongAndComplicatedContent.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/ics_in_header.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/inlinedMultipart.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/inlinedWithoutContentDisposition.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/inlinedWithoutContentID.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/longLine.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/mailWithInlinedAttachmentAndBlankCid.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/mailWithInlinedAttachmentButNoCid.eml
 delete mode 100755 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/mailWithRecipients.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/multipartRelated.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/noTextBodyButHtmlBody.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/oneAttachment-part1.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/oneAttachment-part2.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/oneAttachment.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/oneInlinedImage.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/oneInlinedImageWithoutContentDisposition.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/sameInlinedImages.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/textInMainMultipartHtmlInInnerMultipart.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/twoAttachments.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/twoAttachmentsTextPlain.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/twoSameAttachments.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/windows1252charset.eml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/pom.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryCorsHeaderAPITest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryFilterTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryModularizeJmapDraftAuthenticationStrategyTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryProvisioningTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryQuotaMailingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySendMDNMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodReRoutingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesOutboxFlagUpdateTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationRelayIntegrationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryDownloadEnpointCucumberTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryDownloadGetCucumberTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryDownloadPostCucumberTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryGetMessagesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryIMAPKeywordsInconsistenciesTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryIMAPSetMessagesCompatibilityTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemorySetMailboxesMethodCucumberTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemorySetMessagesMethodCucumberTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemorySharingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryUploadCucumberTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/dnsservice.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/domainlist.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/imapserver.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/keystore
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/listeners.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/lmtpserver.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/mailetcontainer.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/mailrepositorystore.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/managesieveserver.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/pop3server.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/smtpserver.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/usersrepository.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/pom.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/pom.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3FilterTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3GetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3GetMessageListMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3GetVacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3JmapAuthenticationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3ProvisioningTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3QuotaMailingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3SendMDNMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3SetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3SetMessagesMethodReRoutingTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3SetMessagesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3SetVacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3VacationIntegrationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/RabbitMQAwsS3VacationRelayIntegrationTest.java
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/dnsservice.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/domainlist.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/imapserver.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/keystore
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/listeners.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/lmtpserver.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/mailetcontainer.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/mailrepositorystore.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/pop3server.xml
 delete mode 100644 server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/smtpserver.xml
 delete mode 100644 server/protocols/jmap-draft/doc/Dockerfile
 delete mode 100644 server/protocols/jmap-draft/doc/README.md
 delete mode 100644 server/protocols/jmap-draft/doc/annotation.css
 delete mode 100644 server/protocols/jmap-draft/doc/mkdocs.yml
 delete mode 100644 server/protocols/jmap-draft/doc/specs/LICENSE.md
 delete mode 100644 server/protocols/jmap-draft/doc/specs/README
 delete mode 100644 server/protocols/jmap-draft/doc/specs/client-guide/jmap-client-guide.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/home/faq.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/server-guide/jmap-server-guide.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/software/software.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/account.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/apimodel.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/authentication.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/calendar.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/calendarevent.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/calendareventlist.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/contact.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/contactgroup.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/contactlist.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/datamodel.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/mailbox.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/message.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/messagelist.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/push.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/searchsnippet.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/thread.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/upload.mdwn
 delete mode 100644 server/protocols/jmap-draft/doc/specs/spec/vacationresponse.mdwn
 delete mode 100644 server/protocols/jmap-draft/pom.xml
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/JMAPDraftConfiguration.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/AccessTokenManager.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenFactory.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenManager.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AccessTokenManagerImpl.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AsymmetricKeys.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/JamesSignatureHandler.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignatureHandler.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenFactory.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenManager.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/AttachmentsNotFoundException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/BadRequestException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InternalErrorException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidDraftKeywordsException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidMailboxForCreationException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOriginMessageForMDNException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOutboxMoveException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/JmapFieldNotSupportedException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxHasChildException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxNotOwnedException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxParentNotFoundException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MalformedContinuationTokenException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MessageNotFoundException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SizeExceededException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SystemMailboxNotUpdatableException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FieldNamePropertyFilter.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FilterDeserializer.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleClassesDeserializer.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleObjectMapperBuilder.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeDeserializer.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeSerializer.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetFilterMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMailboxesMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessageListMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessagesMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetVacationResponseMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParser.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParserImpl.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MIMEMessageConverter.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxInvalidMessageCreationException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxSendingNotAllowedException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageAppender.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageSender.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/ReferenceUpdater.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/RequestHandler.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SendMDNProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetFilterMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesCreationProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesDestructionProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesUpdateProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMessagesCreationProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMessagesDestructionProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMessagesMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMessagesProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMessagesUpdateProcessor.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetVacationResponseMethod.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/UpdateMessagePatchConverter.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/UpdateMessagePatchValidator.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/ValidationResult.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/Validator.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/ValueWithId.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/AccessTokenRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/AccessTokenResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/AttachmentAccessToken.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/AuthenticatedRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/ContinuationToken.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/ContinuationTokenRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/ContinuationTokenResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/CreationMessage.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/CreationMessageId.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/EndPointsResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/EnvelopeUtils.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/Filter.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/FilterCondition.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/FilterOperator.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetFilterRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetFilterResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetMailboxesRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetMailboxesResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetMessageListRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetMessageListResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetMessagesRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetMessagesResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetVacationRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/GetVacationResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/Header.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/InvocationRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/JmapMDN.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/JmapRuleDTO.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/MDNDisposition.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/MailboxCreationId.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/MailboxFactory.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/MailboxProperty.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/OldKeyword.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/Operator.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetError.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetFilterRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetFilterResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetMailboxesRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetMailboxesResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetMessagesError.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetMessagesRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetMessagesResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetVacationRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SetVacationResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/SignedExpiringToken.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/UpdateMessagePatch.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/UploadResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/VacationResponse.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/deserialization/JmapRuleDTODeserializer.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/mailbox/Mailbox.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/mailbox/MailboxCreateRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/mailbox/MailboxNamespace.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/mailbox/MailboxUpdateRequest.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/mailbox/Quotas.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/mailbox/SortOrder.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/send/MailSpool.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/send/exception/MessageIdNotFoundException.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/DependencyGraph.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/DownloadPath.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/FilterToCriteria.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/MailboxUtils.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/SortConverter.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/SortingHierarchicalCollections.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/quotas/DefaultQuotaLoader.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/quotas/QuotaLoader.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/utils/quotas/QuotaLoaderWithDefaultPreloaded.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/AccessTokenAuthenticationStrategy.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/AuthenticationRoutes.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/DefaultMailboxesProvisioner.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/DownloadRoutes.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/InjectionKeys.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/JMAPApiRoutes.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/LoggingHelper.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/QueryParameterAccessTokenAuthenticationStrategy.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/UploadRoutes.java
 delete mode 100644 server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/http/UserProvisioner.java
 delete mode 100644 server/protocols/jmap-draft/src/main/resources/jwt-public.der
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/MessageFastViewProjectionItemFactoryTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/PreviewFactoryTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/BeansTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/FixedDateZonedDateTimeProvider.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/JMAPDraftConfigurationTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/crypto/AccessTokenManagerImplTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/crypto/JamesSignatureHandlerFixture.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/crypto/JamesSignatureHandlerTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoaderTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/crypto/SignedTokenFactoryTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/crypto/SignedTokenManagerTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/json/MultipleObjectMapperTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/json/OperatorSerializeDeserializeTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/json/ParsingWritingObjects.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/json/ParsingWritingObjectsTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/ErrorResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/GetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/GetMessagesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/GetVacationResponseMethodTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/JmapRequestParserImplTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/JmapResponseWriterImplTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/MIMEMessageConverterTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/MessageSenderTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/RequestHandlerTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMailboxesCreationProcessorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMailboxesMethodTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMailboxesUpdateProcessorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesCreationProcessorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesUpdateProcessorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetVacationResponseMethodTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/UpdateMessagePatchConverterTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/UpdateMessagePatchValidatorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/AttachmentAccessTokenTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/ContinuationTokenTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/CreationMessageTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/FilterConditionTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/FilterOperatorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/FilterTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/GetMailboxMessageListResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/GetMailboxesRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/GetMessageListRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/GetMessagesRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/GetVacationRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/GetVacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/HeaderTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/InvocationRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/InvocationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/JmapMDNTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/MDNDispositionTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/MailboxFactoryTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/MailboxPropertyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/MessageHeaderPropertyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/MessagePropertiesTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/MessagePropertyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/NumberTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/OldKeywordTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetErrorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetMailboxesRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetMailboxesResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetMessagesRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetMessagesResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetVacationRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/SetVacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/UpdateMessagePatchTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/UploadResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/VacationResponseTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/mailbox/MailboxCreateRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/mailbox/MailboxNamespaceTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/mailbox/MailboxTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/mailbox/MailboxUpdateRequestTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/mailbox/QuotaIdTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/mailbox/SortOrderTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/send/MailSpoolTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/utils/DependencyGraphTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/utils/FilterToCriteriaTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/utils/MailboxUtilsTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/utils/SortConverterTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/utils/SortingHierarchicalCollectionsTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/AccessTokenAuthenticationStrategyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/AuthenticatorTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/DefaultMailboxesProvisionerTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/DefaultMailboxesProvisionerThreadTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/DownloadRoutesTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/JMAPApiRoutesTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/JWTAuthenticationStrategyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/QueryParameterAccessTokenAuthenticationStrategyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/UserProvisionerTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/UserProvisionerThreadTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/http/XUserAuthenticationStrategyTest.java
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/badAliasKeystore
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/calendar.eml
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/emptyBodyMessageWithOneAttachment.eml
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/example.html
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/fullMessage.eml
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/inlineAttachment.eml
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/json/message.json
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/json/subMessage.json
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/key.pub
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/keystore
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/keystoreJava11
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/keystoreJava7
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/noReplyTo.eml
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/oneAttachment.eml
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/private.nopass.key
 delete mode 100644 server/protocols/jmap-draft/src/test/resources/spamMail.eml
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/exceptions/BlobNotFoundException.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/ObjectMapperFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/RoleMixIn.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManager.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManagerImpl.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/ErrorResponse.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapRequest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponse.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriter.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriterImpl.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/Method.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Attachment.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Blob.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/BlobId.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Emailer.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/InvocationResponse.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keyword.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keywords.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MethodCallId.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Number.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/PreviewDTO.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Property.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/mailbox/Rights.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastView.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastViewFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullView.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullViewFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderView.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataView.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageView.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageViewFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MetaMessageViewFactory.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/SubMessage.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/utils/KeywordsCombiner.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/json/ObjectMapperFactoryTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/methods/BlobManagerImplTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/AttachmentTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/BlobTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/EmailerTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/MethodCallIdTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/PreviewDTOTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/mailbox/RightsTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/BlobIdTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFastViewFactoryTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewFactoryTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactoryTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactoryTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageViewFixture.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/SubMessageTest.java
 delete mode 100644 server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
 delete mode 100644 server/testing/src/main/java/org/apache/james/jmap/AccessToken.java
 delete mode 100644 server/testing/src/main/java/org/apache/james/jmap/HttpJmapAuthentication.java
 delete mode 100644 server/testing/src/main/java/org/apache/james/jmap/JmapCommonRequests.java


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


(james-project) 09/10: JAMES-4025 Relocate JmapJamesServerContract, JMAPModuleTest, MailetPreconditionTest

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

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

commit 69f0a9ddebdcabf05d8da8ecbeb01d9a378feee6
Author: vttran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Relocate JmapJamesServerContract, JMAPModuleTest, MailetPreconditionTest
---
 .../test/java/org/apache/james/CassandraDuplicatingJamesServerTest.java | 2 +-
 .../src/test/java/org/apache/james/CassandraJamesServerTest.java        | 2 +-
 .../test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java    | 2 +-
 .../test/java/org/apache/james/CassandraLegacyQuotaJamesServerTest.java | 2 +-
 .../test/java/org/apache/james/WithCassandraBlobStoreImmutableTest.java | 2 +-
 .../src/test/java/org/apache/james/CassandraPulsarJamesServerTest.java  | 2 +-
 .../java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java | 2 +-
 .../org/apache/james/CassandraRabbitMQLegacyQuotaJamesServerTest.java   | 2 +-
 .../src/test/java/org/apache/james/WithCacheImmutableTest.java          | 2 +-
 .../apache/james/WithCassandraDeduplicationBlobStoreImmutableTest.java  | 2 +-
 .../apache/james/WithCassandraPassThroughBlobStoreImmutableTest.java    | 2 +-
 .../src/test/java/org/apache/james/WithDefaultAwsS3ImmutableTest.java   | 2 +-
 .../test/java/org/apache/james/WithEncryptedBlobStoreImmutableTest.java | 2 +-
 .../src/test/java/org/apache/james/WithScanningSearchImmutableTest.java | 2 +-
 .../test/java/org/apache/james/WithoutMailQueueViewImmutableTest.java   | 2 +-
 .../memory-app/src/test/java/org/apache/james/DisabledSpoolerTest.java  | 2 +-
 .../src/test/java/org/apache/james/MemoryJmapJamesServerTest.java       | 2 +-
 .../src/test/java/org/apache/james/jmap/{draft => }/JMAPModuleTest.java | 2 +-
 .../java/org/apache/james/jmap/{draft => }/JmapJamesServerContract.java | 2 +-
 .../java/org/apache/james/jmap/{draft => }/MailetPreconditionTest.java  | 2 +-
 20 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraDuplicatingJamesServerTest.java b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraDuplicatingJamesServerTest.java
index 63c3f7868d..1a634eca87 100644
--- a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraDuplicatingJamesServerTest.java
+++ b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraDuplicatingJamesServerTest.java
@@ -21,7 +21,7 @@ package org.apache.james;
 
 import java.util.Optional;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.server.blob.deduplication.StorageStrategy;
 import org.junit.jupiter.api.extension.RegisterExtension;
diff --git a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 735b110c39..b138310558 100644
--- a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -21,7 +21,7 @@ package org.apache.james;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.ConfigurationProbe;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.jupiter.api.Test;
diff --git a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
index be6aea3756..58eaf9de9f 100644
--- a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
+++ b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
@@ -21,7 +21,7 @@ package org.apache.james;
 
 import org.apache.james.data.LdapTestExtension;
 import org.apache.james.data.UsersRepositoryModuleChooser;
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
diff --git a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLegacyQuotaJamesServerTest.java b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLegacyQuotaJamesServerTest.java
index bc38057525..5c593e2747 100644
--- a/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLegacyQuotaJamesServerTest.java
+++ b/server/apps/cassandra-app/src/test/java/org/apache/james/CassandraLegacyQuotaJamesServerTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
diff --git a/server/apps/cassandra-app/src/test/java/org/apache/james/WithCassandraBlobStoreImmutableTest.java b/server/apps/cassandra-app/src/test/java/org/apache/james/WithCassandraBlobStoreImmutableTest.java
index 88f3aa9490..366f1b4857 100644
--- a/server/apps/cassandra-app/src/test/java/org/apache/james/WithCassandraBlobStoreImmutableTest.java
+++ b/server/apps/cassandra-app/src/test/java/org/apache/james/WithCassandraBlobStoreImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/CassandraPulsarJamesServerTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/CassandraPulsarJamesServerTest.java
index 6b24a1a700..4cac5055a6 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/CassandraPulsarJamesServerTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/CassandraPulsarJamesServerTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.blobstore.BlobStoreConfiguration;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
index 8827d5131f..89f46c98ff 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import static org.apache.james.jmap.draft.JmapJamesServerContract.JAMES_SERVER_HOST;
+import static org.apache.james.jmap.JmapJamesServerContract.JAMES_SERVER_HOST;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLegacyQuotaJamesServerTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLegacyQuotaJamesServerTest.java
index 6701ec6fd5..c2336dad14 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLegacyQuotaJamesServerTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/CassandraRabbitMQLegacyQuotaJamesServerTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.jupiter.api.extension.RegisterExtension;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithCacheImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithCacheImmutableTest.java
index a47752bab9..0dd225a359 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithCacheImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithCacheImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraDeduplicationBlobStoreImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraDeduplicationBlobStoreImmutableTest.java
index 38dfb4f992..a7db5ff20d 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraDeduplicationBlobStoreImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraDeduplicationBlobStoreImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.blobstore.BlobStoreConfiguration;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraPassThroughBlobStoreImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraPassThroughBlobStoreImmutableTest.java
index 144161535c..bb5f10b2b7 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraPassThroughBlobStoreImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithCassandraPassThroughBlobStoreImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.blobstore.BlobStoreConfiguration;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithDefaultAwsS3ImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithDefaultAwsS3ImmutableTest.java
index 36e009dee6..8515f00607 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithDefaultAwsS3ImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithDefaultAwsS3ImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithEncryptedBlobStoreImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithEncryptedBlobStoreImmutableTest.java
index 62b51f5c8f..a8263b735f 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithEncryptedBlobStoreImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithEncryptedBlobStoreImmutableTest.java
@@ -20,7 +20,7 @@
 package org.apache.james;
 
 import org.apache.james.blob.aes.CryptoConfig;
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java
index c5bfcbcab2..9b5b055650 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
diff --git a/server/apps/distributed-app/src/test/java/org/apache/james/WithoutMailQueueViewImmutableTest.java b/server/apps/distributed-app/src/test/java/org/apache/james/WithoutMailQueueViewImmutableTest.java
index 5414fc77c7..73abe8e56a 100644
--- a/server/apps/distributed-app/src/test/java/org/apache/james/WithoutMailQueueViewImmutableTest.java
+++ b/server/apps/distributed-app/src/test/java/org/apache/james/WithoutMailQueueViewImmutableTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
diff --git a/server/apps/memory-app/src/test/java/org/apache/james/DisabledSpoolerTest.java b/server/apps/memory-app/src/test/java/org/apache/james/DisabledSpoolerTest.java
index 1098c5041f..a6acec52a7 100644
--- a/server/apps/memory-app/src/test/java/org/apache/james/DisabledSpoolerTest.java
+++ b/server/apps/memory-app/src/test/java/org/apache/james/DisabledSpoolerTest.java
@@ -26,7 +26,7 @@ import static org.apache.james.jmap.JMAPTestingConstants.BOB;
 import static org.apache.james.jmap.JMAPTestingConstants.BOB_PASSWORD;
 import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
 import static org.apache.james.jmap.JMAPTestingConstants.LOCALHOST_IP;
-import static org.apache.james.jmap.draft.JmapJamesServerContract.JAMES_SERVER_HOST;
+import static org.apache.james.jmap.JmapJamesServerContract.JAMES_SERVER_HOST;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.james.mailbox.model.MailboxConstants;
diff --git a/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java b/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java
index 1f905555ef..1bd027254c 100644
--- a/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java
+++ b/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java
@@ -21,7 +21,7 @@ package org.apache.james;
 
 import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT;
 
-import org.apache.james.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.JmapJamesServerContract;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.protocols.ImapGuiceProbe;
 import org.apache.james.modules.protocols.SmtpGuiceProbe;
diff --git a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPModuleTest.java
similarity index 99%
rename from server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java
rename to server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPModuleTest.java
index 3777bccb56..8192451e0b 100644
--- a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java
+++ b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPModuleTest.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.jmap.draft;
+package org.apache.james.jmap;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
diff --git a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/JmapJamesServerContract.java
similarity index 98%
rename from server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java
rename to server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/JmapJamesServerContract.java
index 5a9a2d0c84..7224e34991 100644
--- a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java
+++ b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/JmapJamesServerContract.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.jmap.draft;
+package org.apache.james.jmap;
 
 import static io.restassured.RestAssured.given;
 import static io.restassured.config.EncoderConfig.encoderConfig;
diff --git a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/MailetPreconditionTest.java b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
similarity index 99%
rename from server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/MailetPreconditionTest.java
rename to server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
index ffdcddbd3b..68682f5b2d 100644
--- a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/MailetPreconditionTest.java
+++ b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.jmap.draft;
+package org.apache.james.jmap;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;


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


(james-project) 04/10: JAMES-4025 Drop artifact james-server-jmap-draft-integration-testing

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

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

commit ffdd89290e0f499618b6c48a01e1424bc9c2fe08
Author: Tung Tran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Drop artifact james-server-jmap-draft-integration-testing
---
 code-coverage-report/pom.xml                       |   17 -
 pom.xml                                            |   11 -
 server/apps/cassandra-app/pom.xml                  |    6 -
 .../src/test/resources/eml/htmlMail.eml            |  162 +-
 server/apps/distributed-app/pom.xml                |    6 -
 server/apps/distributed-pop3-app/pom.xml           |    6 -
 server/pom.xml                                     |    1 -
 .../jmap-draft-integration-testing-common/pom.xml  |  162 -
 .../james/jmap/AllowAuthenticationStrategy.java    |   55 -
 .../java/org/apache/james/jmap/ContainerTest.java  |   57 -
 .../james/jmap/DenyAuthenticationStrategy.java     |   43 -
 .../james/jmap/FixedDateZonedDateTimeProvider.java |   39 -
 .../apache/james/jmap/JMAPAuthenticationTest.java  |  520 --
 .../java/org/apache/james/jmap/JmapURIBuilder.java |   32 -
 .../org/apache/james/jmap/MessageAppender.java     |   57 -
 .../org/apache/james/jmap/MockSmtpTestRule.java    |   74 -
 ...ularizeJmapDraftAuthenticationStrategyTest.java |  209 -
 .../org/apache/james/jmap/ProvisioningTest.java    |  118 -
 .../org/apache/james/jmap/UserCredentials.java     |   66 -
 .../apache/james/jmap/VacationIntegrationTest.java |  437 --
 .../james/jmap/VacationRelayIntegrationTest.java   |  132 -
 .../apache/james/jmap/categories/BasicFeature.java |   27 -
 .../categories/CassandraAndOpenSearchCategory.java |   27 -
 .../james/jmap/categories/EnableCucumber.java      |   27 -
 .../methods/integration/CorsHeaderAPITest.java     |   83 -
 .../jmap/draft/methods/integration/FilterTest.java | 2449 --------
 .../integration/GetMailboxesMethodTest.java        |  916 ---
 .../integration/GetMessageListMethodTest.java      | 2454 --------
 .../integration/GetVacationResponseTest.java       |  268 -
 .../methods/integration/QuotaMailingTest.java      |  189 -
 .../methods/integration/SendMDNMethodTest.java     |  446 --
 .../integration/SetMailboxesMethodTest.java        | 2439 --------
 .../SetMessagesMethodReRoutingTest.java            |  241 -
 .../methods/integration/SetMessagesMethodTest.java | 6320 --------------------
 .../SetMessagesOutboxFlagUpdateTest.java           |  208 -
 .../integration/SetVacationResponseTest.java       |  427 --
 .../methods/integration/cucumber/ContentType.java  |   49 -
 .../integration/cucumber/DownloadStepdefs.java     |  528 --
 .../cucumber/GetMailboxesMethodStepdefs.java       |  147 -
 .../cucumber/GetMessageListMethodStepdefs.java     |  133 -
 .../cucumber/GetMessagesMethodStepdefs.java        |  770 ---
 .../methods/integration/cucumber/HttpClient.java   |   58 -
 .../methods/integration/cucumber/ImapStepdefs.java |  153 -
 .../methods/integration/cucumber/MainStepdefs.java |   87 -
 .../integration/cucumber/MessageIdStepdefs.java    |   49 -
 .../cucumber/SetMailboxesMethodStepdefs.java       |  342 --
 .../cucumber/SetMessagesMethodStepdefs.java        |  332 -
 .../integration/cucumber/StringListToFlags.java    |   61 -
 .../cucumber/StringListToFlagsTest.java            |   81 -
 .../integration/cucumber/UploadStepdefs.java       |  231 -
 .../methods/integration/cucumber/UserStepdefs.java |  137 -
 .../cucumber/util/BooleanFromString.java           |   34 -
 .../cucumber/util/IntegerFromString.java           |   35 -
 .../cucumber/util/ObjectFromString.java            |   27 -
 .../cucumber/util/ObjectFromStringExtractor.java   |   41 -
 .../cucumber/util/StringFromString.java            |   35 -
 .../integration/cucumber/util/TableRow.java        |   50 -
 .../attachment/nonIndexableAttachment.html         |  827 ---
 .../resources/cucumber/DownloadEndpoint.feature    |  100 -
 .../test/resources/cucumber/DownloadGet.feature    |   99 -
 .../test/resources/cucumber/DownloadPost.feature   |   43 -
 .../test/resources/cucumber/GetMessages.feature    |  444 --
 .../cucumber/ImapKeywordsConsistency.feature       |  138 -
 ...etMessagesMailboxesUpdatesCompatibility.feature |   67 -
 .../resources/cucumber/MailboxModification.feature |   41 -
 .../test/resources/cucumber/SetMessages.feature    |  111 -
 .../test/resources/cucumber/UploadEndpoint.feature |   66 -
 .../cucumber/sharing/CopyAndSharing.feature        |   58 -
 .../cucumber/sharing/DownloadAndSharing.feature    |   43 -
 .../cucumber/sharing/GetMessageAndSharing.feature  |   49 -
 .../sharing/GetMessageListAndSharing.feature       |   60 -
 .../KeywordsConsistencyOnDelegationMailbox.feature |  140 -
 .../sharing/MailboxCreationAndSharing.feature      |   40 -
 .../sharing/MailboxDeletionAndSharing.feature      |   36 -
 .../cucumber/sharing/MoveMailboxAndSharing.feature |   77 -
 .../cucumber/sharing/MoveMessageAndSharing.feature |  149 -
 .../sharing/RenamingMailboxAndSharing.feature      |   49 -
 .../cucumber/sharing/SetFlagAndSharing.feature     |   62 -
 .../sharing/SetMessagesOnSharedMailbox.feature     |  112 -
 .../SharingChildrenWithoutSharingParent.feature    |   42 -
 .../sharing/SharingMailboxWithOtherDomain.feature  |   31 -
 ...ringParentMailboxWithAndWithoutChildren.feature |  112 -
 .../src/test/resources/eml/attachment.pdf          |  Bin 9404 -> 0 bytes
 .../src/test/resources/eml/calendar.eml            |   42 -
 .../embeddedMultipartWithInlineTextAttachment.eml  |   42 -
 .../eml/htmlAndTextMultipartWithOneAttachment.eml  |   64 -
 .../resources/eml/htmlBodyWithManyEmptyTags.eml    |  105 -
 .../eml/htmlWithLongAndComplicatedContent.eml      | 1995 ------
 .../src/test/resources/eml/ics_in_header.eml       |   46 -
 .../src/test/resources/eml/inlinedMultipart.eml    |   36 -
 .../eml/inlinedWithoutContentDisposition.eml       |   69 -
 .../test/resources/eml/inlinedWithoutContentID.eml |   60 -
 .../src/test/resources/eml/longLine.eml            |    1 -
 .../eml/mailWithInlinedAttachmentAndBlankCid.eml   |   74 -
 .../eml/mailWithInlinedAttachmentButNoCid.eml      |   72 -
 .../src/test/resources/eml/mailWithRecipients.eml  |   14 -
 .../src/test/resources/eml/multipartRelated.eml    |   38 -
 .../test/resources/eml/noTextBodyButHtmlBody.eml   |   84 -
 .../src/test/resources/eml/oneAttachment-part1.eml |   30 -
 .../src/test/resources/eml/oneAttachment-part2.eml |    9 -
 .../src/test/resources/eml/oneAttachment.eml       |   38 -
 .../src/test/resources/eml/oneInlinedImage.eml     |   82 -
 .../oneInlinedImageWithoutContentDisposition.eml   |   72 -
 .../src/test/resources/eml/sameInlinedImages.eml   |   84 -
 .../textInMainMultipartHtmlInInnerMultipart.eml    |   43 -
 .../src/test/resources/eml/twoAttachments.eml      |   74 -
 .../test/resources/eml/twoAttachmentsTextPlain.eml |   73 -
 .../src/test/resources/eml/twoSameAttachments.eml  |   77 -
 .../src/test/resources/eml/windows1252charset.eml  |   43 -
 .../memory-jmap-draft-integration-testing/pom.xml  |  176 -
 .../james/jmap/memory/MemoryCorsHeaderAPITest.java |   37 -
 .../apache/james/jmap/memory/MemoryFilterTest.java |   47 -
 .../jmap/memory/MemoryGetMailboxesMethodTest.java  |   39 -
 .../memory/MemoryGetMessageListMethodTest.java     |   64 -
 .../MemoryGetVacationResponseMethodTest.java       |   39 -
 .../jmap/memory/MemoryJmapAuthenticationTest.java  |   41 -
 ...ularizeJmapDraftAuthenticationStrategyTest.java |   46 -
 .../james/jmap/memory/MemoryProvisioningTest.java  |   37 -
 .../james/jmap/memory/MemoryQuotaMailingTest.java  |   38 -
 .../james/jmap/memory/MemorySendMDNMethodTest.java |   52 -
 .../jmap/memory/MemorySetMailboxesMethodTest.java  |   37 -
 .../MemorySetMessagesMethodReRoutingTest.java      |   37 -
 .../jmap/memory/MemorySetMessagesMethodTest.java   |   45 -
 .../MemorySetMessagesOutboxFlagUpdateTest.java     |   57 -
 .../MemorySetVacationResponseMethodTest.java       |   37 -
 .../jmap/memory/MemoryVacationIntegrationTest.java |   37 -
 .../memory/MemoryVacationRelayIntegrationTest.java |   47 -
 .../MemoryDownloadEnpointCucumberTest.java         |   36 -
 .../cucumber/MemoryDownloadGetCucumberTest.java    |   36 -
 .../cucumber/MemoryDownloadPostCucumberTest.java   |   36 -
 .../cucumber/MemoryGetMessagesMethodTest.java      |   36 -
 .../MemoryIMAPKeywordsInconsistenciesTest.java     |   36 -
 .../MemoryIMAPSetMessagesCompatibilityTest.java    |   36 -
 .../MemorySetMailboxesMethodCucumberTest.java      |   36 -
 .../MemorySetMessagesMethodCucumberTest.java       |   36 -
 .../jmap/memory/cucumber/MemorySharingTest.java    |   36 -
 .../james/jmap/memory/cucumber/MemoryStepdefs.java |   75 -
 .../memory/cucumber/MemoryUploadCucumberTest.java  |   36 -
 .../src/test/resources/dnsservice.xml              |   25 -
 .../src/test/resources/domainlist.xml              |   24 -
 .../src/test/resources/imapserver.xml              |   41 -
 .../src/test/resources/keystore                    |  Bin 2245 -> 0 bytes
 .../src/test/resources/listeners.xml               |   50 -
 .../src/test/resources/lmtpserver.xml              |   23 -
 .../src/test/resources/mailetcontainer.xml         |  127 -
 .../src/test/resources/mailrepositorystore.xml     |   30 -
 .../src/test/resources/managesieveserver.xml       |   32 -
 .../src/test/resources/pop3server.xml              |   23 -
 .../src/test/resources/smtpserver.xml              |   53 -
 .../src/test/resources/usersrepository.xml         |   25 -
 .../jmap-draft-integration-testing/pom.xml         |   50 -
 .../pom.xml                                        |  193 -
 .../jmap/rabbitmq/RabbitMQAwsS3FilterTest.java     |   50 -
 .../RabbitMQAwsS3GetMailboxesMethodTest.java       |   44 -
 .../RabbitMQAwsS3GetMessageListMethodTest.java     |   55 -
 .../RabbitMQAwsS3GetVacationResponseTest.java      |   44 -
 .../RabbitMQAwsS3JmapAuthenticationTest.java       |   49 -
 .../rabbitmq/RabbitMQAwsS3ProvisioningTest.java    |   44 -
 .../rabbitmq/RabbitMQAwsS3QuotaMailingTest.java    |   42 -
 .../rabbitmq/RabbitMQAwsS3SendMDNMethodTest.java   |   66 -
 .../RabbitMQAwsS3SetMailboxesMethodTest.java       |   45 -
 ...abbitMQAwsS3SetMessagesMethodReRoutingTest.java |   42 -
 .../RabbitMQAwsS3SetMessagesMethodTest.java        |   59 -
 .../RabbitMQAwsS3SetVacationResponseTest.java      |   43 -
 .../RabbitMQAwsS3VacationIntegrationTest.java      |   43 -
 .../RabbitMQAwsS3VacationRelayIntegrationTest.java |   54 -
 .../src/test/resources/dnsservice.xml              |   25 -
 .../src/test/resources/domainlist.xml              |   24 -
 .../src/test/resources/imapserver.xml              |   57 -
 .../src/test/resources/keystore                    |  Bin 2245 -> 0 bytes
 .../src/test/resources/listeners.xml               |   53 -
 .../src/test/resources/lmtpserver.xml              |   42 -
 .../src/test/resources/mailetcontainer.xml         |  126 -
 .../src/test/resources/mailrepositorystore.xml     |   30 -
 .../src/test/resources/pop3server.xml              |   43 -
 .../src/test/resources/smtpserver.xml              |  109 -
 176 files changed, 81 insertions(+), 31626 deletions(-)

diff --git a/code-coverage-report/pom.xml b/code-coverage-report/pom.xml
index b808f05ab1..da19e4c0e3 100644
--- a/code-coverage-report/pom.xml
+++ b/code-coverage-report/pom.xml
@@ -882,23 +882,6 @@
             <artifactId>james-server-jmap</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <!--        jmap-draft-integration-testing module-->
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>memory-jmap-draft-integration-testing</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>rabbitmq-jmap-draft-integration-testing</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--        end of jmap-draft-integration-testing module-->
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-jmap-rfc-8621</artifactId>
diff --git a/pom.xml b/pom.xml
index 1113e01547..8ba38345c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1567,17 +1567,6 @@
                 <artifactId>james-server-jmap-draft</artifactId>
                 <version>${project.version}</version>
             </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
-                <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
-                <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-                <version>${project.version}</version>
-                <type>test-jar</type>
-            </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>
                 <artifactId>james-server-jmap-rfc-8621</artifactId>
diff --git a/server/apps/cassandra-app/pom.xml b/server/apps/cassandra-app/pom.xml
index 4db4acd599..4fc6e1487e 100644
--- a/server/apps/cassandra-app/pom.xml
+++ b/server/apps/cassandra-app/pom.xml
@@ -207,12 +207,6 @@
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-webadmin-mailrepository</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-mailbox-plugin-deleted-messages-vault-guice</artifactId>
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/htmlMail.eml b/server/apps/cassandra-app/src/test/resources/eml/htmlMail.eml
similarity index 98%
rename from server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/htmlMail.eml
rename to server/apps/cassandra-app/src/test/resources/eml/htmlMail.eml
index ba2da77ea4..c8213f4d7e 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/resources/eml/htmlMail.eml
+++ b/server/apps/cassandra-app/src/test/resources/eml/htmlMail.eml
@@ -1,81 +1,81 @@
-Delivered-To: mister@james.org
-Received: by 10.28.170.202 with SMTP id t193csp327634wme;
-        Thu, 4 Jun 2015 00:36:15 -0700 (PDT)
-X-Received: by 10.180.77.195 with SMTP id u3mr5042880wiw.30.1433403375307;
-        Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
-Return-Path: <bo...@email.airbnb.com>
-Received: from o7.email.airbnb.com (o7.email.airbnb.com. [167.89.32.249])
-        by mx.google.com with ESMTPS id i2si5691730wjz.123.2015.06.04.00.36.13
-        for <mi...@james.org>
-        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
-        Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
-Received-SPF: pass (google.com: domain of bounces+1453977-062b-mister=james.org@email.airbnb.com designates 167.89.32.249 as permitted sender) client-ip=167.89.32.249;
-Authentication-Results: mx.google.com;
-       spf=pass (google.com: domain of bounces+1453977-062b-mister=james.org@email.airbnb.com designates 167.89.32.249 as permitted sender) smtp.mail=bounces+1453977-062b-mister=james.org@email.airbnb.com;
-       dkim=pass header.i=@email.airbnb.com;
-       dmarc=pass (p=REJECT dis=NONE) header.from=airbnb.com
-DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=email.airbnb.com;
-	h=from:to:subject:mime-version:content-type:content-transfer-encoding;
-	s=s20150428; bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; b=EhC2QHKb5+63egDD
-	qDCAepUELCeUZXCkw8+31kGT+O1va3iAKvQSAvzXJ3qJlIL9FgdeFk8sR78Vszn/
-	A73vp6NGjAW60M4gUZjxEOIPzGKIS95KfmHxg10fXUOFW0uePojNEg4ZPCcuitrZ
-	HuWvzHK5I2siGnqupiivwxDgs5c=
-DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info;
-	h=from:to:subject:mime-version:content-type:content-transfer-encoding:x-feedback-id;
-	s=smtpapi; bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; b=FPiYMmNJLCrL2e8v/0
-	DQC4voofe8nuuE7rhXZ25oqNAhAQja4oKIysJ1qAME2aEaqh+N5aJlCEuHrSG/7+
-	NAQ0OY8KaJ2zlnxAbmgJETOjnf4oGdAa+nU/nVVEPfN2NRcBCNLGQZ80U4T5k8Xi
-	PakIuZvKDTRq7PiosSCSHT/FQ=
-Received: by filter0490p1mdw1.sendgrid.net with SMTP id filter0490p1mdw1.13271.556FFFE7B
-        2015-06-04 07:36:09.249601779 +0000 UTC
-Received: from i-dee0850e.inst.aws.airbnb.com (ec2-54-90-154-187.compute-1.amazonaws.com [54.90.154.187])
-	by ismtpd-017 (SG) with ESMTP id 14dbd7fa6b4.779a.254b43
-	for <mi...@james.org>; Thu, 04 Jun 2015 07:36:09 +0000 (UTC)
-Received: by i-dee0850e.inst.aws.airbnb.com (Postfix, from userid 1041)
-	id 19CBA24C60; Thu,  4 Jun 2015 07:36:09 +0000 (UTC)
-Date: Thu, 04 Jun 2015 07:36:08 +0000
-From: Airbnb <di...@airbnb.com>
-To: mister@james.org
-Message-ID: <55...@i-dee0850e.mail>
-Subject: Text and Html not similar
-Mime-Version: 1.0
-Content-Type: multipart/alternative;
- boundary="--==_mimepart_556fffe8c7e84_7ed0e0fe20445637";
- charset=UTF-8
-Content-Transfer-Encoding: 7bit
-X-User-ID: 32692788
-X-Locale: fr
-X-Category: engagement
-X-Template: low_intent_top_destinations
-recipients:
-sent-on:
-X-SG-EID: mgVKhb3i1xMIKbRk82EYOUTMOPmiNk6g5BaWGQQKDTQchtClhw7VcIxig2BMwy1QMCr7h56hNVush8
- 4aRV0ieMn+WZ1XVnpY0OcmMYNZnuuvlOoNkBaiuiqeWuKVZO9c9S5OyxPy7WQeI0mccenq35NpLqjI
- nQt7IAl2sIUksUD4lM8Ai0u2C88YW13cL+Lo
-X-SG-ID: pQ7zy0fBcyQB3Gm22dZtqT6AR3zbAquH5ABZFkQfSKaxWRhz0YhtD36Li5uybRUjnPsuB21NpreKvG
- t8iQBUn2ygs6hx6sMcgyI7L7bAY28p14Qj47KqA3JXbtMa0Xa3wdZaUUjZpemCg078XxMM5VaSHdDO
- ChUhSV+z9RAJ38wAdUfXkpbO+m97vpU+mtWzVBoOrSiWCVYoNxPhvE4yIQ==
-X-Feedback-ID: 1453977:N5+DXWRfRBXSDDbqVYXPNg8MjWYWwZibliGo1i/oSqY=:Ibl/atjs+SOcHCINmWWv/YvIGzDUihUrks9jdHsNF1+pafkc987UhcxmuyggxNgdCkEmMZDb9gJcndcUJy5KOw==:SG
-
-----==_mimepart_556fffe8c7e84_7ed0e0fe20445637
-Content-Type: text/plain;
- charset=UTF-8
-Content-Transfer-Encoding: quoted-printable
-
-The text/plain part is not matching the html one.
-
-----==_mimepart_556fffe8c7e84_7ed0e0fe20445637
-Content-Type: text/html; charset=utf-8
-Content-Transfer-Encoding: 7bit
-
-<html>
-  <head>
-
-    <meta http-equiv="content-type" content="text/html; charset=utf-8">
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    <i>This is a mail with <b>beautifull</b> html content which contains a banana.</i><br>
-  </body>
-</html>
-
-----==_mimepart_556fffe8c7e84_7ed0e0fe20445637--
+Delivered-To: mister@james.org
+Received: by 10.28.170.202 with SMTP id t193csp327634wme;
+        Thu, 4 Jun 2015 00:36:15 -0700 (PDT)
+X-Received: by 10.180.77.195 with SMTP id u3mr5042880wiw.30.1433403375307;
+        Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
+Return-Path: <bo...@email.airbnb.com>
+Received: from o7.email.airbnb.com (o7.email.airbnb.com. [167.89.32.249])
+        by mx.google.com with ESMTPS id i2si5691730wjz.123.2015.06.04.00.36.13
+        for <mi...@james.org>
+        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
+        Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
+Received-SPF: pass (google.com: domain of bounces+1453977-062b-mister=james.org@email.airbnb.com designates 167.89.32.249 as permitted sender) client-ip=167.89.32.249;
+Authentication-Results: mx.google.com;
+       spf=pass (google.com: domain of bounces+1453977-062b-mister=james.org@email.airbnb.com designates 167.89.32.249 as permitted sender) smtp.mail=bounces+1453977-062b-mister=james.org@email.airbnb.com;
+       dkim=pass header.i=@email.airbnb.com;
+       dmarc=pass (p=REJECT dis=NONE) header.from=airbnb.com
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=email.airbnb.com;
+	h=from:to:subject:mime-version:content-type:content-transfer-encoding;
+	s=s20150428; bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; b=EhC2QHKb5+63egDD
+	qDCAepUELCeUZXCkw8+31kGT+O1va3iAKvQSAvzXJ3qJlIL9FgdeFk8sR78Vszn/
+	A73vp6NGjAW60M4gUZjxEOIPzGKIS95KfmHxg10fXUOFW0uePojNEg4ZPCcuitrZ
+	HuWvzHK5I2siGnqupiivwxDgs5c=
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info;
+	h=from:to:subject:mime-version:content-type:content-transfer-encoding:x-feedback-id;
+	s=smtpapi; bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; b=FPiYMmNJLCrL2e8v/0
+	DQC4voofe8nuuE7rhXZ25oqNAhAQja4oKIysJ1qAME2aEaqh+N5aJlCEuHrSG/7+
+	NAQ0OY8KaJ2zlnxAbmgJETOjnf4oGdAa+nU/nVVEPfN2NRcBCNLGQZ80U4T5k8Xi
+	PakIuZvKDTRq7PiosSCSHT/FQ=
+Received: by filter0490p1mdw1.sendgrid.net with SMTP id filter0490p1mdw1.13271.556FFFE7B
+        2015-06-04 07:36:09.249601779 +0000 UTC
+Received: from i-dee0850e.inst.aws.airbnb.com (ec2-54-90-154-187.compute-1.amazonaws.com [54.90.154.187])
+	by ismtpd-017 (SG) with ESMTP id 14dbd7fa6b4.779a.254b43
+	for <mi...@james.org>; Thu, 04 Jun 2015 07:36:09 +0000 (UTC)
+Received: by i-dee0850e.inst.aws.airbnb.com (Postfix, from userid 1041)
+	id 19CBA24C60; Thu,  4 Jun 2015 07:36:09 +0000 (UTC)
+Date: Thu, 04 Jun 2015 07:36:08 +0000
+From: Airbnb <di...@airbnb.com>
+To: mister@james.org
+Message-ID: <55...@i-dee0850e.mail>
+Subject: Text and Html not similar
+Mime-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="--==_mimepart_556fffe8c7e84_7ed0e0fe20445637";
+ charset=UTF-8
+Content-Transfer-Encoding: 7bit
+X-User-ID: 32692788
+X-Locale: fr
+X-Category: engagement
+X-Template: low_intent_top_destinations
+recipients:
+sent-on:
+X-SG-EID: mgVKhb3i1xMIKbRk82EYOUTMOPmiNk6g5BaWGQQKDTQchtClhw7VcIxig2BMwy1QMCr7h56hNVush8
+ 4aRV0ieMn+WZ1XVnpY0OcmMYNZnuuvlOoNkBaiuiqeWuKVZO9c9S5OyxPy7WQeI0mccenq35NpLqjI
+ nQt7IAl2sIUksUD4lM8Ai0u2C88YW13cL+Lo
+X-SG-ID: pQ7zy0fBcyQB3Gm22dZtqT6AR3zbAquH5ABZFkQfSKaxWRhz0YhtD36Li5uybRUjnPsuB21NpreKvG
+ t8iQBUn2ygs6hx6sMcgyI7L7bAY28p14Qj47KqA3JXbtMa0Xa3wdZaUUjZpemCg078XxMM5VaSHdDO
+ ChUhSV+z9RAJ38wAdUfXkpbO+m97vpU+mtWzVBoOrSiWCVYoNxPhvE4yIQ==
+X-Feedback-ID: 1453977:N5+DXWRfRBXSDDbqVYXPNg8MjWYWwZibliGo1i/oSqY=:Ibl/atjs+SOcHCINmWWv/YvIGzDUihUrks9jdHsNF1+pafkc987UhcxmuyggxNgdCkEmMZDb9gJcndcUJy5KOw==:SG
+
+----==_mimepart_556fffe8c7e84_7ed0e0fe20445637
+Content-Type: text/plain;
+ charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+
+The text/plain part is not matching the html one.
+
+----==_mimepart_556fffe8c7e84_7ed0e0fe20445637
+Content-Type: text/html; charset=utf-8
+Content-Transfer-Encoding: 7bit
+
+<html>
+  <head>
+
+    <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <i>This is a mail with <b>beautifull</b> html content which contains a banana.</i><br>
+  </body>
+</html>
+
+----==_mimepart_556fffe8c7e84_7ed0e0fe20445637--
diff --git a/server/apps/distributed-app/pom.xml b/server/apps/distributed-app/pom.xml
index aedc125853..22ca0cdf61 100644
--- a/server/apps/distributed-app/pom.xml
+++ b/server/apps/distributed-app/pom.xml
@@ -252,12 +252,6 @@
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-webadmin-mailrepository</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-mailbox-plugin-deleted-messages-vault-guice</artifactId>
diff --git a/server/apps/distributed-pop3-app/pom.xml b/server/apps/distributed-pop3-app/pom.xml
index c5e4d9a949..27db13416c 100644
--- a/server/apps/distributed-pop3-app/pom.xml
+++ b/server/apps/distributed-pop3-app/pom.xml
@@ -245,12 +245,6 @@
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-webadmin-mailrepository</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-mailbox-plugin-deleted-messages-vault-guice</artifactId>
diff --git a/server/pom.xml b/server/pom.xml
index cb66d8fa53..5bfb6f8c58 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -95,7 +95,6 @@
         <module>protocols/fetchmail</module>
         <module>protocols/jmap</module>
         <module>protocols/jmap-draft</module>
-        <module>protocols/jmap-draft-integration-testing</module>
         <module>protocols/jmap-rfc-8621</module>
         <module>protocols/jmap-rfc-8621-integration-tests</module>
         <module>protocols/jwt</module>
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/pom.xml b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/pom.xml
deleted file mode 100644
index a2153d041d..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/pom.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>jmap-draft-integration-testing</artifactId>
-        <version>3.9.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>james-server-jmap-draft-integration-testing</artifactId>
-    <packaging>jar</packaging>
-
-    <name>Apache James :: Server :: JMAP (draft) :: Integration testing Common</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-mailbox-api</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>backup</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-data-jmap</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-dnsservice-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-common</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-common</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-imap</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-jmap</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-mailbox</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-smtp</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-webadmin</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-mailets</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-testing</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>mock-smtp-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>testing-base</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.jayway.jsonpath</groupId>
-            <artifactId>json-path</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.cucumber</groupId>
-            <artifactId>cucumber-guice</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.cucumber</groupId>
-            <artifactId>cucumber-java</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.cucumber</groupId>
-            <artifactId>cucumber-junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.rest-assured</groupId>
-            <artifactId>rest-assured</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>net.javacrumbs.json-unit</groupId>
-            <artifactId>json-unit-assertj</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-text</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>java-hamcrest</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.testcontainers</groupId>
-            <artifactId>testcontainers</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/AllowAuthenticationStrategy.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/AllowAuthenticationStrategy.java
deleted file mode 100644
index 8e77e3aa39..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/AllowAuthenticationStrategy.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static org.apache.james.jmap.ModularizeJmapDraftAuthenticationStrategyTest.BOB;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.http.AuthenticationChallenge;
-import org.apache.james.jmap.http.AuthenticationScheme;
-import org.apache.james.jmap.http.AuthenticationStrategy;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-
-import com.google.common.collect.ImmutableMap;
-
-import reactor.core.publisher.Mono;
-import reactor.netty.http.server.HttpServerRequest;
-
-public class AllowAuthenticationStrategy implements AuthenticationStrategy {
-    private final MailboxManager mailboxManager;
-
-    @Inject
-    public AllowAuthenticationStrategy(MailboxManager mailboxManager) {
-        this.mailboxManager = mailboxManager;
-    }
-
-    @Override
-    public Mono<MailboxSession> createMailboxSession(HttpServerRequest httpRequest) {
-        return Mono.fromCallable(() -> mailboxManager.authenticate(BOB).withoutDelegation());
-    }
-
-    @Override
-    public AuthenticationChallenge correspondingChallenge() {
-        return AuthenticationChallenge.of(
-            AuthenticationScheme.of("Allow Authentication Strategy"), ImmutableMap.of());
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java
deleted file mode 100644
index 4225e87a1a..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-
-import org.apache.http.client.fluent.Request;
-import org.apache.http.client.fluent.Response;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.util.docker.DockerContainer;
-import org.apache.james.util.docker.Images;
-import org.apache.james.util.docker.RateLimiters;
-import org.junit.Rule;
-import org.junit.Test;
-import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
-
-public class ContainerTest {
-
-    @Rule
-    public DockerContainer container = DockerContainer.fromName("nginx:1.25")
-        .withAffinityToContainer()
-        .withExposedPorts(80)
-        .waitingFor(new HttpWaitStrategy()
-            .forStatusCode(200)
-            .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND));
-
-    @Test
-    public void containerShouldBeReachableOnExposedPort() throws IOException, URISyntaxException {
-        Response response = Request.Get(new URIBuilder()
-            .setScheme("http")
-            .setHost(container.getHostIp())
-            .setPort(container.getMappedPort(80)).build())
-            .execute();
-
-        assertThat(response.returnResponse().getStatusLine().getStatusCode())
-            .isEqualTo(200);
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/DenyAuthenticationStrategy.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/DenyAuthenticationStrategy.java
deleted file mode 100644
index 4d94babbf6..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/DenyAuthenticationStrategy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import org.apache.james.jmap.http.AuthenticationChallenge;
-import org.apache.james.jmap.http.AuthenticationScheme;
-import org.apache.james.jmap.http.AuthenticationStrategy;
-import org.apache.james.mailbox.MailboxSession;
-
-import com.google.common.collect.ImmutableMap;
-
-import reactor.core.publisher.Mono;
-import reactor.netty.http.server.HttpServerRequest;
-
-public class DenyAuthenticationStrategy implements AuthenticationStrategy {
-    @Override
-    public Mono<MailboxSession> createMailboxSession(HttpServerRequest httpRequest) {
-        return Mono.empty();
-    }
-
-    @Override
-    public AuthenticationChallenge correspondingChallenge() {
-        return AuthenticationChallenge.of(
-            AuthenticationScheme.of("Deny Authentication Strategy"), ImmutableMap.of());
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java
deleted file mode 100644
index fd0c24ccbe..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import java.time.ZonedDateTime;
-
-import org.apache.james.util.date.ZonedDateTimeProvider;
-
-public class FixedDateZonedDateTimeProvider implements ZonedDateTimeProvider {
-
-    private ZonedDateTime zonedDateTime;
-
-    public void setFixedDateTime(ZonedDateTime zonedDateTime) {
-        this.zonedDateTime = zonedDateTime;
-    }
-
-    @Override
-    public ZonedDateTime get() {
-        return zonedDateTime;
-    }
-
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
deleted file mode 100644
index 70457f904b..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.hamcrest.Matchers.both;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.isA;
-import static org.hamcrest.Matchers.notNullValue;
-
-import java.io.IOException;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.UUID;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.jmap.draft.model.ContinuationToken;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import io.restassured.RestAssured;
-import io.restassured.http.ContentType;
-
-public abstract class JMAPAuthenticationTest {
-
-    private static final ZonedDateTime oldDate = ZonedDateTime.parse("2011-12-03T10:15:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
-    private static final ZonedDateTime newDate = ZonedDateTime.parse("2011-12-03T10:16:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
-    private static final ZonedDateTime afterExpirationDate = ZonedDateTime.parse("2011-12-03T10:30:31+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
-
-    protected abstract GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) throws IOException;
-
-    private UserCredentials userCredentials;
-    private FixedDateZonedDateTimeProvider zonedDateTimeProvider;
-    private GuiceJamesServer jmapServer;
-
-    @Before
-    public void setup() throws Throwable {
-        zonedDateTimeProvider = new FixedDateZonedDateTimeProvider();
-        zonedDateTimeProvider.setFixedDateTime(oldDate);
-        jmapServer = createJmapServer(zonedDateTimeProvider);
-        jmapServer.start();
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-                .build();
-        
-        userCredentials = UserCredentials.builder()
-                .username("user@domain.tld")
-                .password("password")
-                .build();
-
-        
-        String domain = "domain.tld";
-        jmapServer.getProbe(DataProbeImpl.class)
-            .fluent()
-            .addDomain(domain)
-            .addUser(userCredentials.getUsername(), userCredentials.getPassword());
-        
-    }
-    
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenContentTypeIsMissing() {
-        given()
-            .accept(ContentType.JSON)
-            .contentType("")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenContentTypeIsNotJson() {
-        given()
-            .contentType(ContentType.XML)
-            .accept(ContentType.JSON)
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenAcceptIsMissing() {
-        given()
-            .accept("")
-            .contentType(ContentType.JSON)
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenAcceptIsNotJson() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.XML)
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenCharsetIsNotUTF8() {
-        given()
-            .contentType("application/json; charset=ISO-8859-1")
-            .accept(ContentType.JSON)
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenBodyIsEmpty() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustReturnMalformedRequestWhenBodyIsNotAcceptable() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"badAttributeName\": \"value\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void mustPositionCorsHeaders() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"username\": \"" + userCredentials.getUsername() + "\", \"clientName\": \"Mozilla Thunderbird\", \"clientVersion\": \"42.0\", \"deviceName\": \"Joe Blogg’s iPhone\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .header("Access-Control-Allow-Origin", "*")
-            .header("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT")
-            .header("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept")
-            .header("Access-Control-Max-Age", "86400");
-    }
-
-    @Test
-    public void mustReturnJsonResponse() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"username\": \"" + userCredentials.getUsername() + "\", \"clientName\": \"Mozilla Thunderbird\", \"clientVersion\": \"42.0\", \"deviceName\": \"Joe Blogg’s iPhone\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(200)
-            .header("Content-Length", "447")
-            .contentType(ContentType.JSON);
-    }
-
-    @Test
-    public void methodShouldContainPasswordWhenValidRequest() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"username\": \"" + userCredentials.getUsername() + "\", \"clientName\": \"Mozilla Thunderbird\", \"clientVersion\": \"42.0\", \"deviceName\": \"Joe Blogg’s iPhone\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(200)
-            .body("methods", hasItem(userCredentials.getPassword()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void mustReturnContinuationTokenWhenValidRequest() {
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"username\": \"" + userCredentials.getUsername() + "\", \"clientName\": \"Mozilla Thunderbird\", \"clientVersion\": \"42.0\", \"deviceName\": \"Joe Blogg’s iPhone\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(200)
-            .body("continuationToken", isA(String.class));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void mustReturnAuthenticationFailedWhenBadPassword() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"badpassword\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void mustReturnAuthenticationFailedWhenContinuationTokenIsRejectedByTheContinuationTokenManager() throws Exception {
-        ContinuationToken badContinuationToken = new ContinuationToken(userCredentials.getUsername(), newDate, "badSignature");
-
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + badContinuationToken.serialize() + "\", \"method\": \"password\", \"password\": \"" + userCredentials.getPassword() + "\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void mustReturnRestartAuthenticationWhenContinuationTokenIsExpired() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        zonedDateTimeProvider.setFixedDateTime(afterExpirationDate);
-
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"" + userCredentials.getPassword() + "\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(403);
-    }
-
-    @Test
-    public void mustReturnAuthenticationFailedWhenUsersRepositoryException() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"" + "wrong password" + "\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void mustReturnCreatedWhenGoodPassword() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        zonedDateTimeProvider.setFixedDateTime(newDate);
-
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"" + userCredentials.getPassword() + "\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(201);
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void mustSendJsonContainingAccessTokenAndEndpointsWhenGoodPassword() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        zonedDateTimeProvider.setFixedDateTime(newDate);
-
-        given()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"" + userCredentials.getPassword() + "\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .body("accessToken", isA(String.class))
-            .body("api", equalTo("/jmap"))
-            .body("eventSource", both(isA(String.class)).and(notNullValue()))
-            .body("upload", equalTo("/upload"))
-            .body("download", equalTo("/download"));
-    }
-    
-    @Test
-    public void getMustReturnUnauthorizedWithoutAuthorizationHeader() {
-        given()
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void getMustReturnUnauthorizedWithoutAValidAuthorizationHeader() {
-        given()
-            .header("Authorization", UUID.randomUUID())
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMustReturnEndpointsWhenValidAuthorizationHeader() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        String token = fromGoodAccessTokenRequest(continuationToken);
-
-        given()
-            .header("Authorization", token)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(200)
-            .body("api", equalTo("/jmap"))
-            .body("eventSource", both(isA(String.class)).and(notNullValue()))
-            .body("upload", equalTo("/upload"))
-            .body("download", equalTo("/download"));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMustReturnEndpointsWhenValidJwtAuthorizationHeader() {
-        String token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyQGRvbWFpbi50bGQifQ.U-dUPv6OU6KO5N7CooHUfMkCd" +
-            "FJHx2F3H4fm7Q79g1BPfBSkifPj5xyVlZ0JwEGXypC4zBw9ay3l4DxzX7D_6p1Hx_ihXsoLx1Ca-WUo44x-XRSpPfgxiZjHCJkGBLMV3RZlA" +
-            "jip-d18mxkcX3JGplX_sCQkFisduAOAHuKSUg9wI6VBgUQi_0B35FYv6tP_bD6eFtvaAUN9QyXXh8UQjEp8CO12lRz6enfLx_V6BG_fEMkee" +
-            "6vRqdEqx_F9OF3eWTe1giMp_JhQ7_l1OXXtbd4TndVvTeuVy4irPbsRc-M8x_-qTDpFp6saRRsyOcFspxPp5n3yIhEK7B3UZiseXw";
-
-        given()
-            .header("Authorization", "Bearer " + token)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(200);
-    }
-
-    @Test
-    public void getMustReturnEndpointsWhenValidUnknownUserJwtAuthorizationHeader() {
-        String token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1bmtub3duQGRvbWFpbi50bGQifQ.hr8AhlNIpiA3Mv_A5ZLyL" +
-            "f1BHeBSaRDfdR_GLV_hlPdIrWv1xtwjBH86E1YnTPx2tTpr_NWTbHcR1OCkuVCpgloEnUNbE3U2l0WrGOX2Eh9dWCXOCtrNvCeSHQuvx5_8W" +
-            "nSVENYidk7o2icE8_gz_Giwf0Z3bHJJYXfAxupv__tCkmhqt3E888VZPjs26AsqxQ29YyX0Fjx8UwKbPrH5-tnyftX-kLjjZNtahVIVtbW4v" +
-            "b8rEEZ4nzqxHqtI2co6yCXjgyoFMdDAKCOU-Bq35Gdo-Qiu8l7a0kQGhuhkjoaVWvw4bcSvunxAnh_0W5g3Lw-rwljNu2JrJS0gAH6NDA";
-        
-        given()
-            .header("Authorization", "Bearer " + token)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(200);
-    }
-
-    @Test
-    public void getMustReturnBadCredentialsWhenInvalidJwtAuthorizationHeader() {
-        String token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0.T04BTk" +
-                "LXkJj24coSZkK13RfG25lpvmSl2MJ7N10KpBk9_-95EGYZdog-BDAn3PJzqVw52z-Bwjh4VOj1-j7cURu0cT4jXehhUrlCxS4n7QHZ" +
-                "EN_bsEYGu7KzjWTpTsUiHe-rN7izXVFxDGG1TGwlmBCBnPW-EFCf9ylUsJi0r2BKNdaaPRfMIrHptH1zJBkkUziWpBN1RNLjmvlAUf" +
-                "49t1Tbv21ZqYM5Ht2vrhJWczFbuC-TD-8zJkXhjTmA1GVgomIX5dx1cH-dZX1wANNmshUJGHgepWlPU-5VIYxPEhb219RMLJIELMY2" +
-                "qNOR8Q31ydinyqzXvCSzVJOf6T60-w";
-
-        given()
-            .header("Authorization", "Bearer " + token)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void optionsRequestsShouldNeverRequireAuthentication() {
-        given()
-        .when()
-            .options("/authentication")
-        .then()
-            .statusCode(200);
-    }
-
-    @Test
-    public void getMustReturnEndpointsWhenCorrectAuthentication() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        zonedDateTimeProvider.setFixedDateTime(newDate);
-    
-        String accessToken = fromGoodAccessTokenRequest(continuationToken);
-    
-        given()
-            .header("Authorization", accessToken)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(200)
-            .body("api", isA(String.class));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getShouldReturn400WhenMultipleCredentials() {
-        String jwtToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyQGRvbWFpbi50bGQifQ.U-dUPv6OU6KO5N7CooHUfMkCd" +
-            "FJHx2F3H4fm7Q79g1BPfBSkifPj5xyVlZ0JwEGXypC4zBw9ay3l4DxzX7D_6p1Hx_ihXsoLx1Ca-WUo44x-XRSpPfgxiZjHCJkGBLMV3RZlA" +
-            "jip-d18mxkcX3JGplX_sCQkFisduAOAHuKSUg9wI6VBgUQi_0B35FYv6tP_bD6eFtvaAUN9QyXXh8UQjEp8CO12lRz6enfLx_V6BG_fEMkee" +
-            "6vRqdEqx_F9OF3eWTe1giMp_JhQ7_l1OXXtbd4TndVvTeuVy4irPbsRc-M8x_-qTDpFp6saRRsyOcFspxPp5n3yIhEK7B3UZiseXw";
-
-        String continuationToken = fromGoodContinuationTokenRequest();
-        String accessToken = fromGoodAccessTokenRequest(continuationToken);
-
-        given()
-            .header("Authorization", "Bearer " + jwtToken)
-            .header("Authorization", accessToken)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
-    @Test
-    public void deleteMustReturnUnauthenticatedWithoutAuthorizationHeader() {
-        given()
-        .when()
-            .delete("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void deleteMustReturnUnauthenticatedWithoutAValidAuthroizationHeader() {
-        given()
-            .header("Authorization", UUID.randomUUID())
-        .when()
-            .delete("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void deleteMustReturnOKNoContentOnValidAuthorizationToken() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        String token = fromGoodAccessTokenRequest(continuationToken);
-        given()
-            .header("Authorization", token)
-        .when()
-            .delete("/authentication")
-        .then()
-            .statusCode(204);
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void deleteMustInvalidAuthorizationOnCorrectAuthorization() {
-        String continuationToken = fromGoodContinuationTokenRequest();
-        zonedDateTimeProvider.setFixedDateTime(newDate);
-    
-        String accessToken = fromGoodAccessTokenRequest(continuationToken);
-        
-        goodDeleteAccessTokenRequest(accessToken);
-    
-        given()
-            .header("Authorization", accessToken)
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    private String fromGoodContinuationTokenRequest() {
-        return with()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"username\": \"" + userCredentials.getUsername() + "\", \"clientName\": \"Mozilla Thunderbird\", \"clientVersion\": \"42.0\", \"deviceName\": \"Joe Blogg’s iPhone\"}")
-        .post("/authentication")
-            .body()
-            .path("continuationToken")
-            .toString();
-    }
-
-    private String fromGoodAccessTokenRequest(String continuationToken) {
-        return with()
-            .contentType(ContentType.JSON)
-            .accept(ContentType.JSON)
-            .body("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"" + userCredentials.getPassword() + "\"}")
-        .post("/authentication")
-            .path("accessToken")
-            .toString();
-    }
-
-    private void goodDeleteAccessTokenRequest(String accessToken) {
-        with()
-            .header("Authorization", accessToken)
-            .delete("/authentication");
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JmapURIBuilder.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JmapURIBuilder.java
deleted file mode 100644
index c407518671..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/JmapURIBuilder.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap;
-
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.util.Port;
-
-public class JmapURIBuilder {
-
-    public static URIBuilder baseUri(GuiceJamesServer jamesServer) {
-        return LocalHostURIBuilder.baseUri(
-            Port.of(jamesServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue()));
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MessageAppender.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MessageAppender.java
deleted file mode 100644
index ae5fe6db23..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MessageAppender.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.Date;
-import java.util.List;
-
-import jakarta.mail.Flags;
-
-import org.apache.james.core.Username;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.probe.MailboxProbe;
-
-import com.google.common.collect.ImmutableList;
-
-public class MessageAppender {
-
-    private MessageAppender() {
-
-    }
-
-    public static List<ComposedMessageId> fillMailbox(MailboxProbe mailboxProbe, String user, String mailbox) {
-        ImmutableList.Builder<ComposedMessageId> insertedMessages = ImmutableList.builder();
-        try {
-            for (int i = 0; i < 1000; ++i) {
-                String mailContent = "Subject: test\r\n\r\ntestmail" + String.valueOf(i);
-                ByteArrayInputStream messagePayload = new ByteArrayInputStream(mailContent.getBytes(StandardCharsets.UTF_8));
-                insertedMessages.add(
-                    mailboxProbe.appendMessage(user, MailboxPath.forUser(Username.of(user), mailbox), messagePayload, new Date(), false, new Flags()));
-            }
-        } catch (MailboxException ignored) {
-            //we expect an exception to be thrown because of quota reached
-        }
-        return insertedMessages.build();
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MockSmtpTestRule.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MockSmtpTestRule.java
deleted file mode 100644
index c8e9d8c071..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/MockSmtpTestRule.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import java.util.UUID;
-
-import org.apache.james.mock.smtp.server.ConfigurationClient;
-import org.apache.james.util.Host;
-import org.apache.james.util.docker.DockerContainer;
-import org.apache.james.util.docker.Images;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testcontainers.containers.wait.strategy.Wait;
-
-public class MockSmtpTestRule implements TestRule {
-    public static class DockerMockSmtp {
-        private static final Logger LOGGER = LoggerFactory.getLogger(DockerMockSmtp.class);
-
-        private final DockerContainer mockSmtpServer;
-
-        DockerMockSmtp() {
-            mockSmtpServer = DockerContainer.fromName(Images.MOCK_SMTP_SERVER)
-                .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP: " + outputFrame.getUtf8String()))
-                .withExposedPorts(25, 8000)
-                .waitingFor(Wait.forLogMessage(".*Mock SMTP server started.*", 1))
-                .withName("james-testing-mock-smtp-server-" + UUID.randomUUID());
-        }
-
-        public ConfigurationClient getConfigurationClient() {
-            return ConfigurationClient.from(Host.from(
-                mockSmtpServer.getHostIp(),
-                mockSmtpServer.getMappedPort(8000)));
-        }
-
-        public String getIPAddress() {
-            return mockSmtpServer.getContainerIp();
-        }
-    }
-
-    private final DockerMockSmtp dockerMockSmtp;
-
-    public MockSmtpTestRule() {
-        this.dockerMockSmtp = new DockerMockSmtp();
-    }
-
-    @Override
-    public Statement apply(Statement statement, Description description) {
-        return dockerMockSmtp.mockSmtpServer.apply(statement, description);
-    }
-
-    public DockerMockSmtp getDockerMockSmtp() {
-        return dockerMockSmtp;
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ModularizeJmapDraftAuthenticationStrategyTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ModularizeJmapDraftAuthenticationStrategyTest.java
deleted file mode 100644
index fe15d3f10c..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ModularizeJmapDraftAuthenticationStrategyTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static io.restassured.RestAssured.given;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.hamcrest.Matchers.both;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.isA;
-import static org.hamcrest.Matchers.notNullValue;
-
-import java.util.List;
-import java.util.Optional;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.hamcrest.CoreMatchers;
-import org.junit.After;
-import org.junit.Test;
-
-import io.restassured.RestAssured;
-
-public abstract class ModularizeJmapDraftAuthenticationStrategyTest {
-    public static String DOMAIN = "domain.tld";
-    public static Username BOB = Username.of("bob" + "@" + DOMAIN);
-    public static String BOB_PASSWORD = "123456";
-    public static Optional<List<String>> ALLOW_AUTHENTICATION_STRATEGY = Optional.of(List.of(AllowAuthenticationStrategy.class.getCanonicalName()));
-    public static Optional<List<String>> DENY_AUTHENTICATION_STRATEGY = Optional.of(List.of(DenyAuthenticationStrategy.class.getCanonicalName()));
-    public static Optional<List<String>> DEFAULT_STRATEGIES = Optional.empty();
-
-    private GuiceJamesServer jmapServer;
-    private AccessToken bobAccessToken;
-
-    protected abstract GuiceJamesServer createJmapServer(Optional<List<String>> authOverride) throws Exception;
-
-    public void setupJamesServerWithCustomAuthenticationStrategy(Optional<List<String>> authOverride) throws Throwable {
-        jmapServer = createJmapServer(authOverride);
-        jmapServer.start();
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-            .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-            .build();
-
-        jmapServer.getProbe(DataProbeImpl.class)
-            .fluent()
-            .addDomain(DOMAIN)
-            .addUser(BOB.asString(), BOB_PASSWORD);
-        bobAccessToken = authenticateJamesUser(baseUri(jmapServer), BOB, BOB_PASSWORD);
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Test
-    public void getAuthenticationRouteWithAllowAuthenticationStrategyShouldSucceed() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(ALLOW_AUTHENTICATION_STRATEGY);
-
-        given()
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(200)
-            .body("api", equalTo("/jmap"))
-            .body("eventSource", both(isA(String.class)).and(notNullValue()))
-            .body("upload", equalTo("/upload"))
-            .body("download", equalTo("/download"));
-    }
-
-    @Test
-    public void getFilterWithAllowAuthenticationStrategyShouldNotRequiredAnyAuthentication() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(ALLOW_AUTHENTICATION_STRATEGY);
-
-        String body = "[[\"getFilter\", {}, \"#0\"]]";
-
-        given()
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, CoreMatchers.equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(0));
-    }
-
-    @Test
-    public void getAuthenticationRouteWithDenyAuthenticationStrategyShouldReturnUnauthorizedCode() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DENY_AUTHENTICATION_STRATEGY);
-
-        given()
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void getAuthenticationRouteWhenDefaultAuthenticationStrategiesWithNonAuthenticationShouldReturnUnauthorizedCode() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DEFAULT_STRATEGIES);
-
-        given()
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void getAuthenticationRouteWhenDefaultAuthenticationStrategiesWithValidAccessTokenShouldSucceed() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DEFAULT_STRATEGIES);
-
-        given()
-            .header("Authorization", bobAccessToken.asString())
-        .when()
-            .get("/authentication")
-        .then()
-            .statusCode(200)
-            .body("api", equalTo("/jmap"))
-            .body("eventSource", both(isA(String.class)).and(notNullValue()))
-            .body("upload", equalTo("/upload"))
-            .body("download", equalTo("/download"));
-    }
-
-    @Test
-    public void getFilterWhenDenyAuthenticationStrategyWithNonAuthenticationShouldReturnUnauthorizedCode() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DENY_AUTHENTICATION_STRATEGY);
-
-        String body = "[[\"getFilter\", {}, \"#0\"]]";
-
-        given()
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void getFilterWhenDenyAuthenticationStrategyWithValidAccessTokenShouldReturnUnauthorizedCode() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DENY_AUTHENTICATION_STRATEGY);
-
-        String body = "[[\"getFilter\", {}, \"#0\"]]";
-
-        given()
-            .header("Authorization", bobAccessToken.asString())
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void getFilterWhenDefaultAuthenticationStrategiesWithValidAccessTokenShouldSucceed() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DEFAULT_STRATEGIES);
-
-        String body = "[[\"getFilter\", {}, \"#0\"]]";
-
-        given()
-            .header("Authorization", bobAccessToken.asString())
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, CoreMatchers.equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(0));
-    }
-
-    @Test
-    public void getFilterWhenDefaultAuthenticationStrategiesWithNonAuthenticationShouldFail() throws Throwable {
-        setupJamesServerWithCustomAuthenticationStrategy(DEFAULT_STRATEGIES);
-
-        String body = "[[\"getFilter\", {}, \"#0\"]]";
-
-        given()
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(401);
-    }
-
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ProvisioningTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ProvisioningTest.java
deleted file mode 100644
index 5fdfa39aa9..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/ProvisioningTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- * http://www.apache.org/licenses/LICENSE-2.0                   *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.notNullValue;
-
-import java.io.IOException;
-import java.time.Duration;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.util.concurrency.ConcurrentTestRunner;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import io.restassured.RestAssured;
-
-public abstract class ProvisioningTest {
-    private static final String NAME = "[0][0]";
-    private static final String ARGUMENTS = "[0][1]";
-    private static final String DOMAIN = "mydomain.tld";
-    private static final Username USER = Username.of("myuser@" + DOMAIN);
-    private static final String PASSWORD = "secret";
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    private GuiceJamesServer jmapServer;
-    private AccessToken userToken;
-
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-            .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-            .build();
-
-        jmapServer.getProbe(DataProbeImpl.class)
-            .fluent()
-            .addDomain(DOMAIN)
-            .addUser(USER.asString(), PASSWORD);
-        userToken = authenticateJamesUser(baseUri(jmapServer), USER, PASSWORD);
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Test
-    public void provisionMailboxesShouldNotDuplicateMailboxByName() throws Exception {
-        ConcurrentTestRunner.builder()
-            .operation((a, b) -> with()
-                .header("Authorization", userToken.asString())
-                .body("[[\"getMailboxes\", {}, \"#0\"]]")
-                .post("/jmap"))
-            .threadCount(10)
-            .runSuccessfullyWithin(Duration.ofMinutes(1));
-
-        given()
-            .header("Authorization", userToken.asString())
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .header("Content-Length", notNullValue())
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(DefaultMailboxes.DEFAULT_MAILBOXES.size()))
-            .body(ARGUMENTS + ".list.name", hasItems(DefaultMailboxes.DEFAULT_MAILBOXES.toArray()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void provisionMailboxesShouldSubscribeToThem() throws Exception {
-        with()
-            .header("Authorization", userToken.asString())
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-            .post("/jmap");
-
-        assertThat(jmapServer.getProbe(MailboxProbeImpl.class)
-            .listSubscriptions(USER.asString()))
-            .containsAll(DefaultMailboxes.DEFAULT_MAILBOXES);
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/UserCredentials.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/UserCredentials.java
deleted file mode 100644
index 25a19942e0..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/UserCredentials.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-public class UserCredentials {
-
-    public static Builder builder() {
-        return new Builder();
-    }
-    
-    public static class Builder {
-        
-        private String username;
-        private String password;
-        
-        private Builder() {
-        }
-        
-        public Builder username(String username) {
-            this.username = username;
-            return this;
-        }
-        
-        public Builder password(String password) {
-            this.password = password;
-            return this;
-        }
-        
-        public UserCredentials build() {
-            return new UserCredentials(username, password);
-        }
-    }
-
-    private final String username;
-    private final String password;
-
-    private UserCredentials(String username, String password) {
-        this.username = username;
-        this.password = password;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
deleted file mode 100644
index 396422cc13..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.SECOND_ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.SECOND_NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.model.AccountId;
-import org.apache.james.vacation.api.VacationPatch;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.probe.MailboxProbe;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import io.restassured.RestAssured;
-
-public abstract class VacationIntegrationTest {
-
-    private static final Username USER_1 = Username.of("benwa@" + DOMAIN);
-    private static final Username USER_2 = Username.of("matthieu@" + DOMAIN);
-    private static final String PASSWORD = "secret";
-    private static final String REASON = "Message explaining my wonderful vacations";
-    private static final String HTML_REASON = "<b>" + REASON + "</b>";
-    public static final String ORIGINAL_MESSAGE_TEXT_BODY = "Hello someone, and thank you for joining example.com!";
-
-    private GuiceJamesServer guiceJamesServer;
-    private JmapGuiceProbe jmapGuiceProbe;
-    private AccessToken user1AccessToken;
-    private AccessToken user2AccessToken;
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    @Before
-    public void setUp() throws Exception {
-        guiceJamesServer = createJmapServer();
-        guiceJamesServer.start();
-
-        DataProbe dataProbe = guiceJamesServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(USER_1.asString(), PASSWORD);
-        dataProbe.addUser(USER_2.asString(), PASSWORD);
-        MailboxProbe mailboxProbe = guiceJamesServer.getProbe(MailboxProbeImpl.class);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_2.asString(), DefaultMailboxes.OUTBOX);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_1.asString(), DefaultMailboxes.SENT);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_2.asString(), DefaultMailboxes.SENT);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_1.asString(), DefaultMailboxes.INBOX);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_2.asString(), DefaultMailboxes.INBOX);
-
-        jmapGuiceProbe = guiceJamesServer.getProbe(JmapGuiceProbe.class);
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-            .setPort(jmapGuiceProbe.getJmapPort().getValue())
-            .build();
-
-        user1AccessToken = authenticateJamesUser(baseUri(guiceJamesServer), USER_1, PASSWORD);
-        user2AccessToken = authenticateJamesUser(baseUri(guiceJamesServer), USER_2, PASSWORD);
-    }
-
-    @After
-    public void teardown() {
-        guiceJamesServer.stop();
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void jmapVacationShouldGenerateAReplyWhenActive() throws Exception {
-        /* Test scenario :
-            - User 1 benw@mydomain.tld sets a Vacation on its account
-            - User 2 matthieu@mydomain.tld sends User 1 a mail
-            - User 1 should well receive this mail
-            - User 2 should well receive a notification about user 1 vacation
-        */
-
-        // User 1 benw@mydomain.tld sets a Vacation on its account
-        setVacationResponse(user1AccessToken);
-
-        // When
-        // User 2 matthieu@mydomain.tld sends User 1 a mail
-        String user2OutboxId = getOutboxId(user2AccessToken);
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|1");
-
-        // Then
-        // User 1 should well receive this mail
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user1AccessToken, getInboxId(user1AccessToken), ORIGINAL_MESSAGE_TEXT_BODY, USER_2.asString(), USER_1.asString()));
-        // User 2 should well receive a notification about user 1 vacation
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user2AccessToken, getInboxId(user2AccessToken), REASON, USER_1.asString(), USER_2.asString()));
-    }
-
-    @Test
-    public void jmapVacationShouldGenerateAReplyEvenWhenNoText() throws Exception {
-        jmapGuiceProbe.modifyVacation(
-            AccountId.fromUsername(USER_1),
-            VacationPatch.builder()
-                .isEnabled(true)
-                .build());
-
-        // When
-        String user2OutboxId = getOutboxId(user2AccessToken);
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|1");
-
-        // Then
-        // User 1 should well receive this mail
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user1AccessToken, getInboxId(user1AccessToken), ORIGINAL_MESSAGE_TEXT_BODY, USER_2.asString(), USER_1.asString()));
-        // User 2 should well receive a notification about user 1 vacation
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user2AccessToken, getInboxId(user2AccessToken), "", USER_1.asString(), USER_2.asString()));
-    }
-
-    @Test
-    public void jmapVacationShouldHaveSupportForHtmlMail() throws Exception {
-        setHtmlVacationResponse(user1AccessToken);
-
-        // When
-        String user2OutboxId = getOutboxId(user2AccessToken);
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|1");
-
-        // Then
-        calmlyAwait.atMost(10, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user1AccessToken, getInboxId(user1AccessToken), ORIGINAL_MESSAGE_TEXT_BODY, USER_2.asString(), USER_1.asString()));
-        calmlyAwait.atMost(10, TimeUnit.SECONDS)
-                .until(() -> assertOneMessageWithHtmlBodyReceived(user2AccessToken, getInboxId(user2AccessToken), HTML_REASON, USER_1.asString(), USER_2.asString()));
-    }
-
-    @Test
-    public void jmapVacationShouldNotGenerateAReplyWhenInactive() throws Exception {
-        /* Test scenario :
-            - User 2 matthieu@mydomain.tld sends User 1 a mail
-            - User 1 should well receive this mail
-            - User 2 should not receive a notification
-        */
-
-        // When
-        // User 2 matthieu@mydomain.tld sends User 1 a mail
-        String user2OutboxId = getOutboxId(user2AccessToken);
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|1");
-
-        // Then
-        // User 1 should well receive this mail
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user1AccessToken, getInboxId(user1AccessToken), ORIGINAL_MESSAGE_TEXT_BODY, USER_2.asString(), USER_1.asString()));
-        // User 2 should not receive a notification
-        Thread.sleep(1000L);
-        with()
-            .header("Authorization", user2AccessToken.asString())
-            .body("[[\"getMessageList\", " +
-                "{" +
-                "  \"fetchMessages\": true, " +
-                "  \"filter\": {" +
-                "    \"inMailboxes\":[\"" + getInboxId(user2AccessToken) + "\"]" +
-                "  }" +
-                "}, \"#0\"]]")
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(SECOND_NAME, equalTo("messages"))
-            .body(SECOND_ARGUMENTS + ".list", empty());
-    }
-
-    @Test
-    public void jmapVacationShouldNotSendNotificationTwice() throws Exception {
-        /* Test scenario :
-            - User 1 benw@mydomain.tld sets a Vacation on its account
-            - User 2 matthieu@mydomain.tld sends User 1 a mail
-            - User 2 matthieu@mydomain.tld sends User 1 a second mail
-            - User 1 should well receive this mail
-            - User 2 should well receive only one notification about user 1 vacation
-        */
-
-        // User 1 benw@mydomain.tld sets a Vacation on its account
-        setVacationResponse(user1AccessToken);
-
-        // When
-        // User 2 matthieu@mydomain.tld sends User 1 a mail
-        String user2OutboxId = getOutboxId(user2AccessToken);
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|1");
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|2");
-
-        // Then
-        // User 2 should well receive a notification about user 1 vacation
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user2AccessToken, getInboxId(user2AccessToken), REASON, USER_1.asString(), USER_2.asString()));
-        // User 2 should not receive another notification
-        Thread.sleep(1000L);
-        assertOneMessageReceived(user2AccessToken, getInboxId(user2AccessToken), REASON, USER_1.asString(), USER_2.asString());
-    }
-
-    @Test
-    public void jmapVacationShouldSendNotificationTwiceWhenVacationReset() throws Exception {
-        /* Test scenario :
-            - User 1 benw@mydomain.tld sets a Vacation on its account
-            - User 2 matthieu@mydomain.tld sends User 1 a mail
-            - User 2 matthieu@mydomain.tld sends User 1 a second mail
-            - User 1 should well receive this mail
-            - User 2 should well receive only one notification about user 1 vacation
-        */
-
-        // User 1 benw@mydomain.tld sets a Vacation on its account
-        setVacationResponse(user1AccessToken);
-        // User 2 matthieu@mydomain.tld sends User 1 a mail
-        String user2OutboxId = getOutboxId(user2AccessToken);
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|1");
-        // Wait user 1 to receive the eMail before reset of vacation
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> isTextMessageReceived(user1AccessToken, getInboxId(user1AccessToken), ORIGINAL_MESSAGE_TEXT_BODY, USER_2.asString(), USER_1.asString()));
-
-        // When
-        // User 1 benw@mydomain.tld resets a Vacation on its account
-        setVacationResponse(user1AccessToken);
-        // User 2 matthieu@mydomain.tld sends User 1 a mail
-        sendMail(user2AccessToken, user2OutboxId, "user|inbox|2");
-
-        // Then
-        // User 2 should well receive two notification about user 1 vacation
-        calmlyAwait.atMost(30, TimeUnit.SECONDS)
-            .until(() -> areTwoTextMessageReceived(user2AccessToken, getInboxId(user2AccessToken)));
-    }
-
-    private void setVacationResponse(AccessToken user1AccessToken) {
-        String bodyRequest = "[[" +
-            "\"setVacationResponse\", " +
-            "{" +
-            "  \"update\":{" +
-            "    \"singleton\" : {" +
-            "      \"id\": \"singleton\"," +
-            "      \"isEnabled\": \"true\"," +
-            "      \"textBody\": \"" + REASON + "\"" +
-            "    }" +
-            "  }" +
-            "}, \"#0\"" +
-            "]]";
-        given()
-            .header("Authorization", user1AccessToken.asString())
-            .body(bodyRequest)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-    }
-
-    private void setHtmlVacationResponse(AccessToken user1AccessToken) {
-        String bodyRequest = "[[" +
-            "\"setVacationResponse\", " +
-            "{" +
-            "  \"update\":{" +
-            "    \"singleton\" : {" +
-            "      \"id\": \"singleton\"," +
-            "      \"isEnabled\": \"true\"," +
-            "      \"htmlBody\": \"" + HTML_REASON + "\"" +
-            "    }" +
-            "  }" +
-            "}, \"#0\"" +
-            "]]";
-        given()
-            .header("Authorization", user1AccessToken.asString())
-            .body(bodyRequest)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-    }
-
-    private void sendMail(AccessToken user2AccessToken, String outboxId, String mailId) {
-        String requestBody = "[" +
-            "  [" +
-            "    \"setMessages\"," +
-            "    {" +
-            "      \"create\": { \"" + mailId + "\" : {" +
-            "        \"from\": { \"email\": \"" + USER_2.asString() + "\"}," +
-            "        \"to\": [{ \"name\": \"Benwa\", \"email\": \"" + USER_1.asString() + "\"}]," +
-            "        \"subject\": \"Thank you for joining example.com!\"," +
-            "        \"textBody\": \"" + ORIGINAL_MESSAGE_TEXT_BODY + "\"," +
-            "        \"mailboxIds\": [\"" + outboxId + "\"]" +
-            "      }}" +
-            "    }," +
-            "    \"#0\"" +
-            "  ]" +
-            "]";
-        given()
-            .header("Authorization", user2AccessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap");
-    }
-
-    private boolean areTwoTextMessageReceived(AccessToken recipientToken, String mailboxId) {
-        try {
-            with()
-                .header("Authorization", recipientToken.asString())
-                .body("[[\"getMessageList\", " +
-                    "{" +
-                    "  \"fetchMessages\": true, " +
-                    "  \"filter\": {" +
-                    "    \"inMailboxes\":[\"" + mailboxId + "\"]" +
-                    "  }" +
-                    "}, \"#0\"]]")
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(SECOND_NAME, equalTo("messages"))
-                .body(SECOND_ARGUMENTS + ".list", hasSize(2));
-            return true;
-        } catch (AssertionError e) {
-            return false;
-        }
-    }
-
-    private boolean isTextMessageReceived(AccessToken recipientToken, String mailboxId, String expectedTextBody, String expectedFrom, String expectedTo) {
-        try {
-            assertOneMessageReceived(recipientToken, mailboxId, expectedTextBody, expectedFrom, expectedTo);
-            return true;
-        } catch (AssertionError e) {
-            return false;
-        }
-    }
-
-    private void assertOneMessageReceived(AccessToken recipientToken, String mailboxId, String expectedTextBody, String expectedFrom, String expectedTo) {
-        with()
-            .header("Authorization", recipientToken.asString())
-            .body("[[\"getMessageList\", " +
-                "{" +
-                "  \"fetchMessages\": true, " +
-                "  \"fetchMessageProperties\": [\"textBody\", \"from\", \"to\", \"mailboxIds\"]," +
-                "  \"filter\": {" +
-                "    \"inMailboxes\":[\"" + mailboxId + "\"]" +
-                "  }" +
-                "}, \"#0\"]]")
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(SECOND_NAME, equalTo("messages"))
-            .body(SECOND_ARGUMENTS + ".list", hasSize(1))
-            .body(SECOND_ARGUMENTS + ".list[0].textBody", equalTo(expectedTextBody))
-            .body(SECOND_ARGUMENTS + ".list[0].from.email", equalTo(expectedFrom))
-            .body(SECOND_ARGUMENTS + ".list[0].to.email", hasSize(1))
-            .body(SECOND_ARGUMENTS + ".list[0].to.email[0]", equalTo(expectedTo));
-    }
-
-    private boolean assertOneMessageWithHtmlBodyReceived(AccessToken recipientToken, String mailboxId, String expectedHtmlBody, String expectedFrom, String expectedTo) {
-        try {
-            with()
-                .header("Authorization", recipientToken.asString())
-                .body("[[\"getMessageList\", " +
-                    "{" +
-                    "  \"fetchMessages\": true, " +
-                    "  \"fetchMessageProperties\": [\"htmlBody\", \"from\", \"to\", \"mailboxIds\"]," +
-                    "  \"filter\": {" +
-                    "    \"inMailboxes\":[\"" + mailboxId + "\"]" +
-                    "  }" +
-                    "}, \"#0\"]]")
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(SECOND_NAME, equalTo("messages"))
-                .body(SECOND_ARGUMENTS + ".list", hasSize(1))
-                .body(SECOND_ARGUMENTS + ".list[0].htmlBody", equalTo(expectedHtmlBody))
-                .body(SECOND_ARGUMENTS + ".list[0].from.email", equalTo(expectedFrom))
-                .body(SECOND_ARGUMENTS + ".list[0].to.email", hasSize(1))
-                .body(SECOND_ARGUMENTS + ".list[0].to.email[0]", equalTo(expectedTo));
-            return true;
-        } catch (AssertionError e) {
-            return false;
-        }
-    }
-
-    private String getOutboxId(AccessToken accessToken) {
-        return getMailboxIdByRole(accessToken, DefaultMailboxes.OUTBOX);
-    }
-
-    private String getInboxId(AccessToken accessToken) {
-        return getMailboxIdByRole(accessToken, DefaultMailboxes.INBOX);
-    }
-
-    private String getMailboxIdByRole(AccessToken accessToken, String role) {
-        return getAllMailboxesIds(accessToken).stream()
-            .filter(x -> x.get("role").equalsIgnoreCase(role))
-            .map(x -> x.get("id"))
-            .findFirst()
-            .get();
-    }
-
-    private List<Map<String, String>> getAllMailboxesIds(AccessToken accessToken) {
-        return with()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"properties\": [\"role\", \"id\"]}, \"#0\"]]")
-            .post("/jmap")
-        .andReturn()
-            .body()
-            .jsonPath()
-            .getList(ARGUMENTS + ".list");
-    }
-
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationRelayIntegrationTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationRelayIntegrationTest.java
deleted file mode 100644
index 7eaa7b088e..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationRelayIntegrationTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.LOCALHOST_IP;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.commons.net.smtp.SMTPClient;
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.MailAddress;
-import org.apache.james.dnsservice.api.InMemoryDNSService;
-import org.apache.james.jmap.api.model.AccountId;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.probe.MailboxProbe;
-import org.apache.james.mock.smtp.server.model.Mail;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.modules.protocols.SmtpGuiceProbe;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.vacation.api.VacationPatch;
-import org.assertj.core.api.SoftAssertions;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.github.fge.lambdas.Throwing;
-
-public abstract class VacationRelayIntegrationTest {
-
-    private static final String USER = "benwa";
-    private static final String USER_WITH_DOMAIN = USER + '@' + DOMAIN;
-    private static final String PASSWORD = "secret";
-    private static final String REASON = "Message explaining my wonderful vacations";
-
-    @ClassRule
-    public static MockSmtpTestRule fakeSmtp = new MockSmtpTestRule();
-
-    private GuiceJamesServer guiceJamesServer;
-    private JmapGuiceProbe jmapGuiceProbe;
-
-    protected abstract GuiceJamesServer getJmapServer() throws IOException;
-
-    protected abstract InMemoryDNSService getInMemoryDns();
-
-    @Before
-    public void setUp() throws Exception {
-        getInMemoryDns()
-            .registerMxRecord("yopmail.com", fakeSmtp.getDockerMockSmtp().getIPAddress());
-
-        guiceJamesServer = getJmapServer();
-        guiceJamesServer.start();
-
-        DataProbe dataProbe = guiceJamesServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(USER_WITH_DOMAIN, PASSWORD);
-        MailboxProbe mailboxProbe = guiceJamesServer.getProbe(MailboxProbeImpl.class);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_WITH_DOMAIN, DefaultMailboxes.SENT);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USER_WITH_DOMAIN, DefaultMailboxes.INBOX);
-
-        jmapGuiceProbe = guiceJamesServer.getProbe(JmapGuiceProbe.class);
-    }
-
-    @After
-    public void teardown() {
-        fakeSmtp.getDockerMockSmtp().getConfigurationClient().clearMails();
-        fakeSmtp.getDockerMockSmtp().getConfigurationClient().clearBehaviors();
-        guiceJamesServer.stop();
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void forwardingAnEmailShouldWork() throws Exception {
-        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER_WITH_DOMAIN), VacationPatch
-            .builder()
-            .isEnabled(true)
-            .textBody(REASON)
-            .build());
-
-        String externalMail = "ray@yopmail.com";
-
-        SMTPClient smtpClient = new SMTPClient();
-        smtpClient.connect(LOCALHOST_IP, guiceJamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort().getValue());
-        smtpClient.helo(DOMAIN);
-        smtpClient.setSender(externalMail);
-        smtpClient.rcpt("<" + USER_WITH_DOMAIN + ">");
-        smtpClient.sendShortMessageData("Reply-To: <" + externalMail + ">\r\n\r\ncontent");
-
-        calmlyAwait.atMost(1, TimeUnit.MINUTES)
-            .untilAsserted(() -> {
-                List<Mail> mails = fakeSmtp.getDockerMockSmtp().getConfigurationClient()
-                    .listMails();
-
-                assertThat(mails).hasSize(1);
-                SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
-                    softly.assertThat(mails.get(0).getEnvelope().getFrom()).isEqualTo(MailAddress.nullSender());
-                    softly.assertThat(mails.get(0).getEnvelope().getRecipients())
-                        .containsOnly(Mail.Recipient.builder()
-                            .address(new MailAddress(externalMail))
-                            .build());
-                    softly.assertThat(mails.get(0).getMessage()).contains(REASON);
-                }));
-            });
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/BasicFeature.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/BasicFeature.java
deleted file mode 100644
index c8e9b6f6f8..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/BasicFeature.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.categories;
-
-/**
- * Category marker for Junit 4 conditional execution
- * Marks tests that should be run on every product
- */
-public interface BasicFeature {
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/CassandraAndOpenSearchCategory.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/CassandraAndOpenSearchCategory.java
deleted file mode 100644
index 1c494299d1..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/CassandraAndOpenSearchCategory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.james.jmap.categories;
-
-/**
- * Category marker for Junit 4 conditional execution
- * Marks tests that should be run only on Cassandra & OpenSearch implementation
- */
-public interface CassandraAndOpenSearchCategory {
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/EnableCucumber.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/EnableCucumber.java
deleted file mode 100644
index 9621ef0ad7..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/categories/EnableCucumber.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.categories;
-
-/**
- * Category marker for Junit 4 conditional execution
- * Enables cucumber test by default as cucumber tags are being used for conditional execution
- */
-public interface EnableCucumber {
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/CorsHeaderAPITest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/CorsHeaderAPITest.java
deleted file mode 100644
index 150ca92233..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/CorsHeaderAPITest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-
-import java.io.IOException;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import io.restassured.RestAssured;
-
-public abstract class CorsHeaderAPITest {
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    private AccessToken accessToken;
-    private GuiceJamesServer jmapServer;
-    
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-                .build();
-        RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
-
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(ALICE.asString(), ALICE_PASSWORD);
-        accessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-    
-    @Test
-    public void apiShouldPositionCorsHeaders() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"accountId\": \"1\"}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .header("Access-Control-Allow-Origin", "*")
-            .header("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT")
-            .header("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept")
-            .header("Access-Control-Max-Age", "86400");
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java
deleted file mode 100644
index 4078ad1978..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java
+++ /dev/null
@@ -1,2449 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.BOB;
-import static org.apache.james.jmap.JMAPTestingConstants.BOB_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.CEDRIC;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapCommonRequests.getOutboxId;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Durations.ONE_MINUTE;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.hasSize;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.JmapCommonRequests;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import io.restassured.RestAssured;
-
-public abstract class FilterTest {
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    protected abstract MailboxId randomMailboxId();
-
-    private AccessToken accessToken;
-    private AccessToken bobAccessToken;
-    private GuiceJamesServer jmapServer;
-
-    private MailboxId matchedMailbox;
-    private MailboxId inbox;
-
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-            .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-            .build();
-
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(ALICE.asString(), ALICE_PASSWORD);
-        dataProbe.addUser(BOB.asString(), BOB_PASSWORD);
-        accessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
-        bobAccessToken = authenticateJamesUser(baseUri(jmapServer), BOB, BOB_PASSWORD);
-
-        MailboxProbeImpl mailboxProbe = jmapServer.getProbe(MailboxProbeImpl.class);
-        matchedMailbox = mailboxProbe.createMailbox(MailboxPath.forUser(ALICE, "matched"));
-        inbox = mailboxProbe.createMailbox(MailboxPath.inbox(ALICE));
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Test
-    public void getFilterShouldReturnEmptyByDefault() {
-        String body = "[[" +
-                "  \"getFilter\", " +
-                "  {}, " +
-                "\"#0\"" +
-                "]]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(0));
-    }
-
-    @Test
-    public void getFilterShouldReturnEmptyWhenExplicitNullAccountId() {
-        String body = "[[" +
-                "  \"getFilter\", " +
-                "  {\"accountId\": null}, " +
-                "\"#0\"" +
-                "]]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(0));
-    }
-
-    @Test
-    public void getFilterShouldReturnErrorWhenUnsupportedAccountId() {
-        String body = "[[" +
-                "  \"getFilter\", " +
-                "  {\"accountId\": \"any\"}, " +
-                "\"#0\"" +
-                "]]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(body)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", equalTo("The field 'accountId' of 'GetFilterRequest' is not supported"));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void setFilterShouldOverwritePreviouslyStoredRules() {
-        MailboxId mailbox1 = randomMailboxId();
-        MailboxId mailbox2 = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My first rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox2.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        with()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"42-ac\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"from\"," +
-                  "        \"comparator\": \"exactly-equals\"," +
-                  "        \"value\": \"marvin@h2.g2\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "            \"mailboxIds\": [\"" + mailbox1.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"getFilter\", " +
-                  "  {}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(1))
-            .body(ARGUMENTS + ".singleton[0].id", equalTo("42-ac"))
-            .body(ARGUMENTS + ".singleton[0].name", equalTo("My last rule"))
-            .body(ARGUMENTS + ".singleton[0].condition.field", equalTo("from"))
-            .body(ARGUMENTS + ".singleton[0].condition.comparator", equalTo("exactly-equals"))
-            .body(ARGUMENTS + ".singleton[0].condition.value", equalTo("marvin@h2.g2"))
-            .body(ARGUMENTS + ".singleton[0].action.appendIn.mailboxIds", containsInAnyOrder(mailbox1.serialize()));
-    }
-
-    @Test
-    public void setFilterShouldRejectRuleWithInvalidRuleName() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-34e\"," +
-                "      \"name\": null," +
-                "      \"condition\": {" +
-                "        \"field\": \"subject\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"question\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("`name` is mandatory"));
-    }
-
-    @Test
-    public void setFilterShouldRejectRuleWithInvalidRuleId() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": null," +
-                "      \"name\": \"some name\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"subject\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"question\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("`id` is mandatory"));
-    }
-
-    @Test
-    public void setFilterShouldRejectRuleWithoutRuleCondition() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-34e\"," +
-                "      \"name\": \"some name\"," +
-                "      \"condition\": null," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("`condition` is mandatory"));
-    }
-
-    @Test
-    public void setFilterShouldRejectRuleWithInvalidRuleCondition() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-34e\"," +
-                "      \"name\": \"some name\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"subject\" " +
-                "       }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", equalTo("'null' is not a valid comparator name"));
-    }
-
-    @Test
-    public void setFilterShouldReturnUpdatedSingleton() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("filterSet"))
-            .body(ARGUMENTS + ".updated", containsInAnyOrder("singleton"));
-    }
-
-    @Test
-    public void setFilterShouldRejectDuplicatedRules() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }," +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("filterSet"))
-            .body(ARGUMENTS + ".updated", hasSize(0))
-            .body(ARGUMENTS + ".notUpdated.singleton.type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".notUpdated.singleton.description", equalTo("The following rules were duplicated: ['3000-34e']"));
-    }
-
-    @Test
-    public void setFilterShouldRejectRulesTargetingSeveralMailboxes() {
-        MailboxId mailbox1 = randomMailboxId();
-        MailboxId mailbox2 = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox1.serialize() + "\",\"" + mailbox2.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("filterSet"))
-            .body(ARGUMENTS + ".updated", hasSize(0))
-            .body(ARGUMENTS + ".notUpdated.singleton.type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".notUpdated.singleton.description", equalTo("The following rules targeted several mailboxes, which is not supported: ['3000-34e']"));
-    }
-
-    @Test
-    public void setFilterShouldRejectAccountId() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"accountId\": \"any\"," +
-                  "    \"singleton\": []" +
-                  "  }, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", equalTo("The field 'accountId' of 'SetFilterRequest' is not supported"));
-    }
-
-    @Test
-    public void setFilterShouldAcceptNullAccountId() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"accountId\": null," +
-                  "    \"singleton\": []" +
-                  "  }, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("filterSet"))
-            .body(ARGUMENTS + ".updated", hasSize(1));
-    }
-
-    @Test
-    public void setFilterShouldRejectIfInState() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"ifInState\": \"any\"," +
-                  "    \"singleton\": []" +
-                  "  }, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", equalTo("The field 'ifInState' of 'SetFilterRequest' is not supported"));
-    }
-
-    @Test
-    public void setFilterShouldAcceptNullIfInState() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"ifInState\": null," +
-                  "    \"singleton\": []" +
-                  "  }, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .body(NAME, equalTo("filterSet"))
-            .body(ARGUMENTS + ".updated", hasSize(1));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getFilterShouldRetrievePreviouslyStoredRules() {
-        MailboxId mailbox1 = randomMailboxId();
-        MailboxId mailbox2 = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"42-ac\"," +
-                  "      \"name\": \"My first rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"from\"," +
-                  "        \"comparator\": \"exactly-equals\"," +
-                  "        \"value\": \"marvin@h2.g2\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "            \"mailboxIds\": [\"" + mailbox1.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }," +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox2.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"getFilter\", " +
-                  "  {}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(2))
-            .body(ARGUMENTS + ".singleton[0].id", equalTo("42-ac"))
-            .body(ARGUMENTS + ".singleton[0].name", equalTo("My first rule"))
-            .body(ARGUMENTS + ".singleton[0].condition.field", equalTo("from"))
-            .body(ARGUMENTS + ".singleton[0].condition.comparator", equalTo("exactly-equals"))
-            .body(ARGUMENTS + ".singleton[0].condition.value", equalTo("marvin@h2.g2"))
-            .body(ARGUMENTS + ".singleton[0].action.appendIn.mailboxIds", containsInAnyOrder(mailbox1.serialize()))
-            .body(ARGUMENTS + ".singleton[1].id", equalTo("3000-34e"))
-            .body(ARGUMENTS + ".singleton[1].name", equalTo("My last rule"))
-            .body(ARGUMENTS + ".singleton[1].condition.field", equalTo("subject"))
-            .body(ARGUMENTS + ".singleton[1].condition.comparator", equalTo("contains"))
-            .body(ARGUMENTS + ".singleton[1].condition.value", equalTo("question"))
-            .body(ARGUMENTS + ".singleton[1].action.appendIn.mailboxIds", containsInAnyOrder(mailbox2.serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void setFilterShouldClearPreviouslyStoredRulesWhenEmptyBody() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"3000-34e\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        with()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": []" +
-                  "  }, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"getFilter\", " +
-                  "  {}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(0));
-    }
-
-    @Test
-    public void allFieldsAndComparatorsShouldBeSupported() {
-        MailboxId mailbox = randomMailboxId();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"setFilter\", " +
-                  "  {" +
-                  "    \"singleton\": [" +
-                  "    {" +
-                  "      \"id\": \"3000-341\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"subject\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }," +
-                  "    {" +
-                  "      \"id\": \"3000-342\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"cc\"," +
-                  "        \"comparator\": \"not-contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }," +
-                  "    {" +
-                  "      \"id\": \"3000-343\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"to\"," +
-                  "        \"comparator\": \"exactly-equals\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }," +
-                  "    {" +
-                  "      \"id\": \"3000-344\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"recipient\"," +
-                  "        \"comparator\": \"not-exactly-equals\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }," +
-                  "    {" +
-                  "      \"id\": \"3000-345\"," +
-                  "      \"name\": \"My last rule\"," +
-                  "      \"condition\": {" +
-                  "        \"field\": \"from\"," +
-                  "        \"comparator\": \"contains\"," +
-                  "        \"value\": \"question\"" +
-                  "      }," +
-                  "      \"action\": {" +
-                  "        \"appendIn\": {" +
-                  "          \"mailboxIds\": [\"" + mailbox.serialize() + "\"]" +
-                  "        }" +
-                  "      }" +
-                  "    }" +
-                  "  ]}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                  "  \"getFilter\", " +
-                  "  {}, " +
-                  "\"#0\"" +
-                  "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("filter"))
-            .body(ARGUMENTS + ".singleton", hasSize(5))
-            .body(ARGUMENTS + ".singleton[0].id", equalTo("3000-341"))
-            .body(ARGUMENTS + ".singleton[0].condition.field", equalTo("subject"))
-            .body(ARGUMENTS + ".singleton[0].condition.comparator", equalTo("contains"))
-            .body(ARGUMENTS + ".singleton[1].id", equalTo("3000-342"))
-            .body(ARGUMENTS + ".singleton[1].condition.field", equalTo("cc"))
-            .body(ARGUMENTS + ".singleton[1].condition.comparator", equalTo("not-contains"))
-            .body(ARGUMENTS + ".singleton[2].id", equalTo("3000-343"))
-            .body(ARGUMENTS + ".singleton[2].condition.field", equalTo("to"))
-            .body(ARGUMENTS + ".singleton[2].condition.comparator", equalTo("exactly-equals"))
-            .body(ARGUMENTS + ".singleton[3].id", equalTo("3000-344"))
-            .body(ARGUMENTS + ".singleton[3].condition.field", equalTo("recipient"))
-            .body(ARGUMENTS + ".singleton[3].condition.comparator", equalTo("not-exactly-equals"))
-            .body(ARGUMENTS + ".singleton[4].id", equalTo("3000-345"))
-            .body(ARGUMENTS + ".singleton[4].condition.field", equalTo("from"))
-            .body(ARGUMENTS + ".singleton[4].condition.comparator", equalTo("contains"));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenFromRuleMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + BOB.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        calmlyAwait.atMost(ONE_MINUTE)
-            .until(() -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenToRuleMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"to\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenCcRuleMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails cc-ed to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"cc\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenRecipientRuleMatchesCc() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails cc-ed to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"recipient\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenRecipientRuleMatchesTo() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails cc-ed to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"recipient\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenSubjectRuleMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"subject\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"matchme\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"subject\": \"matchme\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void messageShouldBeAppendedInInboxWhenFromDoesNotMatchRule() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.atMost(ONE_MINUTE)
-            .until(() -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenToDoesNotMatchRule() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"to\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenCcDoesNotMatchRule() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails cc-ed to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"cc\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + BOB.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenRecipientDoesNotMatchRule() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails cc-ed to cedric\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"recipient\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + CEDRIC.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + BOB.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenSubjectRuleDoesNotMatchRule() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"subject\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"matchme\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"subject\": \"nomatch\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenSubjectRuleDoesNotMatchRuleBecauseOfCase() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"subject\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"different case value\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
-            "      \"subject\": \"DIFFERENT CASE VALUE\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenContainsComparatorMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"bo\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenContainsComparatorDoesNotMatch() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"ced\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenExactlyEqualsMatchesName() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"exactly-equals\"," +
-                "        \"value\": \"Bob\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenExactlyEqualsMatchesAddress() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"exactly-equals\"," +
-                "        \"value\": \"" + BOB.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenExactlyEqualsMatchesFullHeader() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"exactly-equals\"," +
-                "        \"value\": \"Bob <" + BOB.asString() + ">\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenExactlyEqualsMatchesCaseInsensitivelyFullHeader() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"exactly-equals\"," +
-                "        \"value\": \"bob <" + BOB.asString().toUpperCase(Locale.ENGLISH) + ">\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenExactlyEqualsComparatorDoesNotMatch() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"exactly-equals\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"nomatch\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenNotContainsComparatorMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"not-contains\"," +
-                "        \"value\": \"other\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenNotContainsComparatorDoesNotMatch() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"not-contains\"," +
-                "        \"value\": \"bob\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenContainsNotExactlyEqualsMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"not-exactly-equals\"," +
-                "        \"value\": \"nomatch\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenNotExactlyEqualsMatchesAddress() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"not-exactly-equals\"," +
-                "        \"value\": \"" + BOB.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenNotExactlyEqualsMatchesFullHeader() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"not-exactly-equals\"," +
-                "        \"value\": \"Bob <" + BOB.asString() + ">\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInInboxWhenNotExactlyEqualsComparatorMatchesName() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"not-exactly-equals\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"Bob\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenFirstRuleMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + BOB.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    {" +
-                "      \"id\": \"3000-346\"," +
-                "      \"name\": \"Emails to alice\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"to\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + ALICE.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void messageShouldBeAppendedInSpecificMailboxWhenSecondRuleMatches() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"unknown@james.org\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    {" +
-                "      \"id\": \"3000-346\"," +
-                "      \"name\": \"Emails to alice\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"to\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + ALICE.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-    }
-
-    @Test
-    public void inboxShouldBeEmptyWhenFromRuleMatchesInSpecificMailbox() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"" + BOB.asString() + "\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox));
-        assertThat(JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox)).isFalse();
-    }
-
-    @Test
-    public void matchedMailboxShouldBeEmptyWhenFromRuleDoesntMatch() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "  \"setFilter\", " +
-                "  {" +
-                "    \"singleton\": [" +
-                "    {" +
-                "      \"id\": \"3000-345\"," +
-                "      \"name\": \"Emails from bob\"," +
-                "      \"condition\": {" +
-                "        \"field\": \"from\"," +
-                "        \"comparator\": \"contains\"," +
-                "        \"value\": \"unknown@james.org\"" +
-                "      }," +
-                "      \"action\": {" +
-                "        \"appendIn\": {" +
-                "          \"mailboxIds\": [\"" + matchedMailbox.serialize() + "\"]" +
-                "        }" +
-                "      }" +
-                "    }" +
-                "  ]}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-
-        String messageCreationId = "creationId1337";
-        String requestBody = "[[" +
-            "  \"setMessages\"," +
-            "  {" +
-            "    \"create\": { \"" + messageCreationId  + "\" : {" +
-            "      \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
-            "      \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
-            "      \"subject\": \"subject\"," +
-            "      \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
-            "    }}" +
-            "  }," +
-            "  \"#0\"" +
-            "]]";
-
-        with()
-            .header("Authorization", bobAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        calmlyAwait.until(
-            () -> JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, inbox));
-        assertThat(JmapCommonRequests.isAnyMessageFoundInRecipientsMailbox(accessToken, matchedMailbox)).isFalse();
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
deleted file mode 100644
index 03c0cd4181..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
+++ /dev/null
@@ -1,916 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.BOB;
-import static org.apache.james.jmap.JMAPTestingConstants.BOB_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.CEDRIC;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.FIRST_MAILBOX;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.SECOND_MAILBOX;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasEntry;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.hasKey;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.quota.QuotaCountLimit;
-import org.apache.james.core.quota.QuotaSizeLimit;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.jmap.draft.model.mailbox.MailboxNamespace;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.MessageManager.AppendCommand;
-import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
-import org.apache.james.mailbox.model.MailboxACL.Right;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.probe.ACLProbe;
-import org.apache.james.mailbox.probe.QuotaProbe;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.modules.ACLProbeImpl;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.modules.QuotaProbesImpl;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.AllMatching;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-import io.restassured.RestAssured;
-
-public abstract class GetMailboxesMethodTest {
-    public static final String READ = String.valueOf(Right.Read.asCharacter());
-    public static final String LOOKUP = String.valueOf(Right.Lookup.asCharacter());
-    public static final String ADMINISTER = String.valueOf(Right.Administer.asCharacter());
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    private AccessToken accessToken;
-    private GuiceJamesServer jmapServer;
-    private MailboxProbeImpl mailboxProbe;
-    private ACLProbe aclProbe;
-    private QuotaProbe quotaProbe;
-
-    private Message message;
-    
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-        mailboxProbe = jmapServer.getProbe(MailboxProbeImpl.class);
-        aclProbe = jmapServer.getProbe(ACLProbeImpl.class);
-        quotaProbe = jmapServer.getProbe(QuotaProbesImpl.class);
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-                .build();
-        RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
-
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(ALICE.asString(), ALICE_PASSWORD);
-        dataProbe.addUser(BOB.asString(), BOB_PASSWORD);
-        accessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
-
-        message = Message.Builder.of()
-            .setSubject("test")
-            .setBody("testmail", StandardCharsets.UTF_8)
-            .build();
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-    
-    @Test
-    public void getMailboxesShouldErrorNotSupportedWhenRequestContainsNonNullAccountId() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"accountId\": \"1\"}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", equalTo("The field 'accountId' of 'GetMailboxesRequest' is not supported"));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnEmptyWhenIdsDoesntMatch() {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "name");
-        String removedId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "quicklyRemoved").serialize();
-        mailboxProbe.deleteMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "quicklyRemoved");
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + removedId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(0));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnErrorWhenInvalidMailboxId() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"invalid id\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnMailboxesWhenIdsMatch() {
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-        String mailboxId2 = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "myMailbox").serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\", \"" + mailboxId2 + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(2))
-            .body(ARGUMENTS + ".list[0].id", equalTo(mailboxId))
-            .body(ARGUMENTS + ".list[1].id", equalTo(mailboxId2));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnOnlyMatchingMailboxesWhenIdsGiven() {
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "myMailbox");
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".id", equalTo(mailboxId));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnEmptyWhenIdsIsEmpty() {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": []}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", empty());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnAllMailboxesWhenIdsIsNull() {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "myMailbox");
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "myMailbox2");
-
-        List<String> expectedMailboxes = ImmutableList.<String>builder()
-                .addAll(DefaultMailboxes.DEFAULT_MAILBOXES)
-                .add("myMailbox")
-                .add("myMailbox2")
-                .build();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": null}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(expectedMailboxes.size()))
-            .body(ARGUMENTS + ".list.name", hasItems(expectedMailboxes.toArray()));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnSharedWithProperty() throws Exception {
-        String mailboxName = "myMailbox";
-        String myMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), mailboxName).serialize();
-        String targetUser1 = "touser1@" + DOMAIN;
-        String targetUser2 = "touser2@" + DOMAIN;
-
-        aclProbe.replaceRights(MailboxPath.forUser(ALICE, mailboxName), targetUser1, new Rfc4314Rights(Right.Lookup, Right.Administer));
-        aclProbe.replaceRights(MailboxPath.forUser(ALICE, mailboxName), targetUser2, new Rfc4314Rights(Right.Read, Right.Lookup));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + myMailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".name", equalTo(mailboxName))
-            .body(FIRST_MAILBOX + ".sharedWith", hasEntry(targetUser1, ImmutableList.of(ADMINISTER, LOOKUP)))
-            .body(FIRST_MAILBOX + ".sharedWith", hasEntry(targetUser2, ImmutableList.of(LOOKUP, READ)));
-    }
-
-    @Test
-    public void getMailboxesShouldRemoveOwnerRight() throws Exception {
-        String mailboxName = "myMailbox";
-        String myMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), mailboxName).serialize();
-        String targetUser1 = "touser1@" + DOMAIN;
-
-        aclProbe.replaceRights(MailboxPath.forUser(ALICE, mailboxName), ALICE.asString(), new Rfc4314Rights(Right.Read, Right.Administer));
-        aclProbe.replaceRights(MailboxPath.forUser(ALICE, mailboxName), targetUser1, new Rfc4314Rights(Right.Read, Right.Lookup));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + myMailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".name", equalTo(mailboxName))
-            .body(FIRST_MAILBOX + ".sharedWith", hasEntry(targetUser1, ImmutableList.of(LOOKUP, READ)));
-    }
-
-    @Test
-    public void getMailboxShouldReturnEmptySharedWithWhenNoDelegation() {
-        String mailboxName = "myMailbox";
-        String myMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), mailboxName).serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + myMailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".name", equalTo(mailboxName))
-            .body(FIRST_MAILBOX + ".sharedWith", is(ImmutableMap.of()));
-    }
-
-    @Test
-    public void nonHandledRightsShouldBeFilteredOut() throws Exception {
-        String mailboxName = "myMailbox";
-        String myMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), mailboxName).serialize();
-        String targetUser1 = "touser1@" + DOMAIN;
-
-        aclProbe.replaceRights(MailboxPath.forUser(ALICE, mailboxName), targetUser1, new Rfc4314Rights(Right.Lookup, Right.Post));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + myMailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".name", equalTo(mailboxName))
-            .body(FIRST_MAILBOX + ".sharedWith", hasEntry(targetUser1, ImmutableList.of(LOOKUP)));
-    }
-    
-    @Test
-    public void getMailboxesShouldErrorInvalidArgumentsWhenRequestIsInvalid() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": true}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("Cannot deserialize value of type `java.util.ArrayList<org.apache.james.mailbox.model.MailboxId>` from Boolean value (token `JsonToken.VALUE_TRUE`)"))
-            .body(ARGUMENTS + ".description", containsString("(through reference chain: org.apache.james.jmap.draft.model.GetMailboxesRequest$Builder[\"ids\"])"));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnDefaultMailboxesWhenAuthenticatedUserDoesntHaveAnAccountYet() {
-        String token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMzM3QGRvbWFpbi50bGQiLCJuYW1lIjoiTmV3IFVzZXIif" +
-            "Q.bPeoAWAOyu4teilj27cL4uZ9jBO9zJOus3mJdqZYEeDe9OZeweopqkIE7ljuh-iTxBDE-f3OqaEqGa_mi6eOYT7XXAEPolcEAe4EooU" +
-            "lI8anYMrSlbMPBKGymH-QTWIcPS5P8XNFnIn94XheuEIXeaRHNvO5-SgENbFYS19kgyzOV54umQtIAewLyMdvG6aooLSk6lEy3AhVPIfl" +
-            "QJm6MLOsNzHMj7F7mM0Wm6QBfYeWIHzQLtEgGFFLyqeSXyzbgbbec2WYpVjXHNyWhAFcq7OMjOb2UEmb9gKr1fkL_XZgXna2CW46hzwaG" +
-            "jNO-6ZWpHjLfDEP7oHui51Hn_wJfw";
-
-        given()
-            .header("Authorization", "Bearer " + token)
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(DefaultMailboxes.DEFAULT_MAILBOXES.size()))
-            .body(ARGUMENTS + ".list.name", hasItems(DefaultMailboxes.DEFAULT_MAILBOXES.toArray()));
-    }
-
-    @Test
-    public void getMailboxesShouldErrorWithBadJWTToken() {
-
-        String badAuthToken = "BADTOKENOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0.T04BTk" +
-                "LXkJj24coSZkK13RfG25lpvmSl2MJ7N10KpBk9_-95EGYZdog-BDAn3PJzqVw52z-Bwjh4VOj1-j7cURu0cT4jXehhUrlCxS4n7QHZ" +
-                "DN_bsEYGu7KzjWTpTsUiHe-rN7izXVFxDGG1TGwlmBCBnPW-EFCf9ylUsJi0r2BKNdaaPRfMIrHptH1zJBkkUziWpBN1RNLjmvlAUf" +
-                "49t1Tbv21ZqYM5Ht2vrhJWczFbuC-TD-8zJkXhjTmA1GVgomIX5dx1cH-dZX1wANNmshUJGHgepWlPU-5VIYxPEhb219RMLJIELMY2" +
-                "qNOR8Q31ydinyqzXvCSzVJOf6T60-w";
-
-        given()
-            .header("Authorization", "Bearer " + badAuthToken)
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(401);
-    }
-
-    @Test
-    public void getMailboxesShouldReturnMailboxesWhenAvailable() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "name");
-
-        mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, "name"), AppendCommand.from(message));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list.name", hasItem("name"));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnMailboxPropertiesWhenAvailable() throws Exception {
-        String myMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "name").serialize();
-
-        mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, "name"), AppendCommand.from(message));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + myMailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list.name", hasItem("name"))
-            .body(FIRST_MAILBOX + ".parentId", nullValue())
-            .body(FIRST_MAILBOX + ".role", nullValue())
-            .body(FIRST_MAILBOX + ".sortOrder", equalTo(1000))
-            .body(FIRST_MAILBOX + ".mustBeOnlyMailbox", equalTo(false))
-            .body(FIRST_MAILBOX + ".mayReadItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayAddItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayRemoveItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayCreateChild", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayRename", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayDelete", equalTo(true))
-            .body(FIRST_MAILBOX + ".totalMessages", equalTo(1))
-            .body(FIRST_MAILBOX + ".unreadMessages", equalTo(1))
-            .body(FIRST_MAILBOX + ".unreadThreads", equalTo(0));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnFilteredMailboxesPropertiesWhenRequestContainsFilterProperties() {
-        String myMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "name").serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + myMailboxId + "\"], \"properties\" : [\"unreadMessages\", \"sortOrder\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".id", not(is(nullValue())))
-            .body(FIRST_MAILBOX + ".name", nullValue())
-            .body(FIRST_MAILBOX + ".parentId", nullValue())
-            .body(FIRST_MAILBOX + ".role", nullValue())
-            .body(FIRST_MAILBOX + ".sortOrder", equalTo(1000))
-            .body(FIRST_MAILBOX + ".mustBeOnlyMailbox", nullValue())
-            .body(FIRST_MAILBOX + ".mayReadItems", nullValue())
-            .body(FIRST_MAILBOX + ".mayAddItems", nullValue())
-            .body(FIRST_MAILBOX + ".mayRemoveItems", nullValue())
-            .body(FIRST_MAILBOX + ".mayCreateChild", nullValue())
-            .body(FIRST_MAILBOX + ".mayRename", nullValue())
-            .body(FIRST_MAILBOX + ".mayDelete", nullValue())
-            .body(FIRST_MAILBOX + ".totalMessages", nullValue())
-            .body(FIRST_MAILBOX + ".unreadMessages", equalTo(0))
-            .body(FIRST_MAILBOX + ".unreadThreads", nullValue());
-    }
-
-    @Test
-    public void getMailboxesShouldReturnIdWhenRequestContainsEmptyPropertyListFilter() {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "name");
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"properties\" : []}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".id", not(is(nullValue())))
-            .body(FIRST_MAILBOX + ".name", nullValue());
-    }
-
-    @Test
-    public void getMailboxesShouldIgnoreUnknownPropertiesWhenRequestContainsUnknownPropertyListFilter() {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "name");
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"properties\" : [\"unknown\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(FIRST_MAILBOX + ".id", not(is(nullValue())))
-            .body(FIRST_MAILBOX + ".name", nullValue());
-    }
-
-    @Test
-    public void getMailboxesShouldReturnMailboxesWithSortOrder() {
-        MailboxId inboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-        MailboxId trashId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.TRASH);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + inboxId.serialize() + "\", \"" + trashId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(2))
-            .body(ARGUMENTS + ".list[0].name", equalTo(DefaultMailboxes.INBOX))
-            .body(ARGUMENTS + ".list[0].sortOrder", equalTo(10))
-            .body(ARGUMENTS + ".list[1].name", equalTo(DefaultMailboxes.TRASH))
-            .body(ARGUMENTS + ".list[1].sortOrder", equalTo(60));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnMailboxesWithRolesInLowerCase() {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.OUTBOX);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".role", equalTo(DefaultMailboxes.OUTBOX.toLowerCase(Locale.US)));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnMailboxesWithFilteredSharedWithWhenShared() throws Exception {
-        String mailboxName = "name";
-        MailboxId bobMailbox = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), mailboxName);
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, mailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-        aclProbe.replaceRights(bobMailboxPath, CEDRIC.asString(), new Rfc4314Rights(Right.Lookup));
-
-        Map<String, String> sharedWith = given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + bobMailbox.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list.name", hasSize(1))
-        .extract()
-            .jsonPath()
-            .get(FIRST_MAILBOX + ".sharedWith");
-
-        assertThat(sharedWith).containsOnlyKeys(ALICE.asString());
-    }
-
-    @Test
-    public void getMailboxesShouldReturnMailboxesWithFullSharedWithWhenHasAdminRight() throws Exception {
-        String mailboxName = "name";
-        MailboxId bobMailbox = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), mailboxName);
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, mailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup, Right.Administer));
-        aclProbe.replaceRights(bobMailboxPath, CEDRIC.asString(), new Rfc4314Rights(Right.Lookup));
-
-        Map<String, String> sharedWith = given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + bobMailbox.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list.name", hasSize(1))
-        .extract()
-            .jsonPath()
-            .get(FIRST_MAILBOX + ".sharedWith");
-
-        assertThat(sharedWith).containsOnlyKeys(ALICE.asString(), CEDRIC.asString());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnAllAccessibleMailboxesWhenEmptyIds() throws Exception {
-        String sharedMailboxName = "BobShared";
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), DefaultMailboxes.INBOX);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedMailboxName);
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, sharedMailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-
-        List<String> expectedMailboxes = ImmutableList.<String>builder()
-            .addAll(DefaultMailboxes.DEFAULT_MAILBOXES)
-            .add(sharedMailboxName)
-            .build();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(expectedMailboxes.size()))
-            .body(ARGUMENTS + ".list.name", hasItems(expectedMailboxes.toArray()));
-    }
-
-    @Test
-    public void getMailboxesShouldFilterMailboxesWithLookupRightWhenEmptyIds() throws Exception {
-        String sharedReadMailboxName = "BobShared";
-        String sharedAdministerMailboxName = "BobShared1";
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), DefaultMailboxes.INBOX);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedReadMailboxName);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedAdministerMailboxName);
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-        MailboxPath bobSharedReadMailboxPath = MailboxPath.forUser(BOB, sharedReadMailboxName);
-        MailboxPath bobSharedAdministerMailboxPath = MailboxPath.forUser(BOB, sharedAdministerMailboxName);
-
-        aclProbe.replaceRights(bobSharedReadMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-        aclProbe.replaceRights(bobSharedAdministerMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Administer));
-
-        List<String> expectedMailboxes = ImmutableList.<String>builder()
-            .addAll(DefaultMailboxes.DEFAULT_MAILBOXES)
-            .add(sharedReadMailboxName)
-            .build();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(expectedMailboxes.size()))
-            .body(ARGUMENTS + ".list.name", hasItems(expectedMailboxes.toArray()));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnExactUserInbox() throws Exception {
-        String mailboxName = "BobShared";
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), mailboxName);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), DefaultMailboxes.INBOX);
-        MailboxId aliceInboxMailbox = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, mailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + aliceInboxMailbox.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list.name", hasItems(MailboxConstants.INBOX))
-            .body(ARGUMENTS + ".list.id", hasItems(aliceInboxMailbox.serialize()));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnSharedMailboxesWithRead() throws Exception {
-        String sharedMailboxName = "BobShared";
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), DefaultMailboxes.INBOX);
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedMailboxName);
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, sharedMailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(ARGUMENTS + ".list.id", hasItems(mailboxId.serialize()));
-    }
-
-    @Test
-    public void getMailboxesShouldNotExposeRoleOfSharedMailboxToSharee() throws Exception {
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, DefaultMailboxes.INBOX);
-        MailboxId mailboxId = mailboxProbe.createMailbox(bobMailboxPath);
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(FIRST_MAILBOX + ".role", nullValue())
-            .body(FIRST_MAILBOX + ".sortOrder", equalTo(1000));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnDelegatedNamespaceWhenSharedMailbox() throws Exception {
-        String sharedMailboxName = "BobShared";
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedMailboxName);
-
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, sharedMailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".namespace.type", equalTo(MailboxNamespace.Type.Delegated.toString()))
-            .body(FIRST_MAILBOX + ".namespace.owner", equalTo(BOB.asString()));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnPersonalNamespaceWhenOwnerMailbox() {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".namespace.type", equalTo(MailboxNamespace.Type.Personal.toString()))
-            .body(FIRST_MAILBOX + ".namespace.owner", is(nullValue()));
-    }
-
-
-    @Test
-    public void getMailboxesShouldReturnAllowedForAllMayPropertiesWhenOwner() {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX);
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".mayReadItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayAddItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayRemoveItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayCreateChild", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayDelete", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayRename", equalTo(true));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnPartiallyAllowedMayPropertiesWhenDelegated() throws Exception {
-        String sharedMailboxName = "BobShared";
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedMailboxName);
-
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, sharedMailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup, Right.Read));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".mayReadItems", equalTo(true))
-            .body(FIRST_MAILBOX + ".mayAddItems", equalTo(false))
-            .body(FIRST_MAILBOX + ".mayRemoveItems", equalTo(false))
-            .body(FIRST_MAILBOX + ".mayCreateChild", equalTo(false))
-            .body(FIRST_MAILBOX + ".mayDelete", equalTo(false))
-            .body(FIRST_MAILBOX + ".mayRename", equalTo(false));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnUnlimitedQuotasForInboxByDefault() {
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['STORAGE'].max", nullValue())
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].max", nullValue());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnMaxStorageQuotasForInboxWhenSet() throws Exception {
-        quotaProbe.setGlobalMaxStorage(QuotaSizeLimit.size(42));
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['STORAGE'].max", equalTo(42));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnMaxMessageQuotasForInboxWhenSet() throws Exception {
-        quotaProbe.setGlobalMaxMessageCount(QuotaCountLimit.count(43));
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].max", equalTo(43));
-    }
-
-    @Test
-    public void getMailboxesShouldDisplayDifferentMaxQuotaPerMailboxWhenSet() throws Exception {
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-        String sharedMailboxName = "BobShared";
-        MailboxId sharedMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), sharedMailboxName);
-
-        MailboxPath bobMailboxPath = MailboxPath.forUser(BOB, sharedMailboxName);
-        aclProbe.replaceRights(bobMailboxPath, ALICE.asString(), new Rfc4314Rights(Right.Lookup, Right.Read));
-
-        quotaProbe.setMaxMessageCount(quotaProbe.getQuotaRoot(MailboxPath.inbox(ALICE)), QuotaCountLimit.count(42));
-        quotaProbe.setMaxMessageCount(quotaProbe.getQuotaRoot(MailboxPath.inbox(BOB)), QuotaCountLimit.count(43));
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\",\"" + sharedMailboxId.serialize() + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(2))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].max", equalTo(42))
-            .body(SECOND_MAILBOX + ".quotas['#private&bob@domain.tld']['MESSAGE'].max", equalTo(43));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnQuotaRootForAllMailboxes() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list*.quotas", AllMatching.matcher(hasKey("#private&alice@domain.tld")));
-    }
-
-    @Test
-    public void getMailboxesShouldReturnEmptyQuotasForInboxWhenNoMail() {
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['STORAGE'].used", equalTo(0))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].used", equalTo(0));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMailboxesShouldReturnUpdatedQuotasForInboxWhenMailReceived() throws Exception {
-        String mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), DefaultMailboxes.INBOX).serialize();
-
-        mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, DefaultMailboxes.INBOX), AppendCommand.from(message));
-
-        calmlyAwait.untilAsserted(() ->
-            given()
-                .header("Authorization", accessToken.asString())
-                .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-            .when()
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(NAME, equalTo("mailboxes"))
-                .body(ARGUMENTS + ".list", hasSize(1))
-                .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['STORAGE'].used", equalTo(85))
-                .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].used", equalTo(1)));
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
deleted file mode 100644
index 2e4c7ccfeb..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
+++ /dev/null
@@ -1,2454 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.BOB;
-import static org.apache.james.jmap.JMAPTestingConstants.BOB_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapCommonRequests.bodyOfMessage;
-import static org.apache.james.jmap.JmapCommonRequests.getOutboxId;
-import static org.apache.james.jmap.JmapCommonRequests.listMessageIdsInMailbox;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.apache.james.transport.mailets.remote.delivery.HeloNameProvider.LOCALHOST;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Durations.TEN_SECONDS;
-import static org.hamcrest.Matchers.allOf;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.not;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.time.LocalDate;
-import java.time.ZoneId;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import jakarta.mail.Flags;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.categories.CassandraAndOpenSearchCategory;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.FlagsBuilder;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
-import org.apache.james.mailbox.model.MailboxACL.Right;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.mime4j.dom.Multipart;
-import org.apache.james.mime4j.message.BodyPartBuilder;
-import org.apache.james.mime4j.message.DefaultMessageWriter;
-import org.apache.james.mime4j.message.MultipartBuilder;
-import org.apache.james.mime4j.message.SingleBodyBuilder;
-import org.apache.james.modules.ACLProbeImpl;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.modules.protocols.ImapGuiceProbe;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.util.ClassLoaderUtils;
-import org.apache.james.util.date.ImapDateTimeFormatter;
-import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.utils.TestIMAPClient;
-import org.hamcrest.Matchers;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.github.fge.lambdas.Throwing;
-
-import io.restassured.RestAssured;
-
-public abstract class GetMessageListMethodTest {
-    private static final String FORWARDED = "$Forwarded";
-    private static final ZoneId ZONE_ID = ZoneId.of("Europe/Paris");
-    public static final MailboxPath ALICE_MAILBOX = MailboxPath.forUser(ALICE, "mailbox");
-    public static final MailboxPath ALICE_OTHER_MAILBOX = MailboxPath.forUser(ALICE, "othermailbox");
-    private ACLProbeImpl aclProbe;
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    protected abstract void await();
-
-    protected AccessToken aliceAccessToken;
-    private AccessToken bobAccessToken;
-    private GuiceJamesServer jmapServer;
-    protected MailboxProbeImpl mailboxProbe;
-    private DataProbe dataProbe;
-
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-        mailboxProbe = jmapServer.getProbe(MailboxProbeImpl.class);
-        dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        aclProbe = jmapServer.getProbe(ACLProbeImpl.class);
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-                .build();
-
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(ALICE.asString(), ALICE_PASSWORD);
-        this.aliceAccessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
-        dataProbe.addUser(BOB.asString(), BOB_PASSWORD);
-        this.bobAccessToken = authenticateJamesUser(baseUri(jmapServer), BOB, BOB_PASSWORD);
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Test
-    public void getMessageListShouldNotListMessageIfTheUserHasOnlyLookupRight() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), "delegated");
-        MailboxPath delegatedMailboxPath = MailboxPath.forUser(BOB, "delegated");
-        mailboxProbe.appendMessage(BOB.asString(), delegatedMailboxPath,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        await();
-
-        aclProbe.replaceRights(delegatedMailboxPath,
-            ALICE.asString(),
-            new Rfc4314Rights(Right.Lookup));
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessagesListShouldListMessageWhenTheUserHasOnlyReadRight() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), "delegated");
-        MailboxPath delegatedMailboxPath = MailboxPath.forUser(BOB, "delegated");
-        ComposedMessageId message = mailboxProbe.appendMessage(BOB.asString(), delegatedMailboxPath,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        await();
-
-        aclProbe.replaceRights(delegatedMailboxPath,
-            ALICE.asString(),
-            new Rfc4314Rights(Right.Read));
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldNotFilterMessagesWhenTextFilterMatchesBodyAfterTheMessageMailboxHasBeenChanged() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        MailboxId otherMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "otherMailbox");
-
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags());
-        await();
-
-        String messageId = message.getMessageId().serialize();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"setMessages\", {\"update\":{\"" + messageId + "\":{\"mailboxIds\": [\"" + otherMailboxId.serialize() + "\"]}}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"text\":\"tiramisu\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(messageId));
-    }
-
-    @Test
-    public void getMessageListShouldFilterMessagesMarkedAsDeleted() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.DELETED));
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"text\":\"tiramisu\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void searchByFromFieldShouldSupportUTF8FromName() throws Exception {
-        String toUsername = "username1@" + DOMAIN;
-        String password = "password";
-        dataProbe.addUser(toUsername, password);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, toUsername, DefaultMailboxes.INBOX);
-
-        String messageCreationId = "creationId1337";
-        String fromName = "Üsteliğhan Maşrapa";
-        String fromAddress = ALICE.asString();
-        String requestBody = "[" +
-            "  [" +
-            "    \"setMessages\"," +
-            "    {" +
-            "      \"create\": { \"" + messageCreationId  + "\" : {" +
-            "        \"from\": { \"name\": \"" + fromName + "\", \"email\": \"" + fromAddress + "\"}," +
-            "        \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB.asString() + "\"}]," +
-            "        \"subject\": \"Thank you for joining example.com!\"," +
-            "        \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
-            "        \"mailboxIds\": [\"" + getOutboxId(aliceAccessToken) + "\"]" +
-            "      }}" +
-            "    }," +
-            "    \"#0\"" +
-            "  ]" +
-            "]";
-
-        String messageId = with()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .extract()
-            .body()
-            .path(ARGUMENTS + ".created." + messageCreationId + ".id");
-
-        String searchedMessageId = calmlyAwait.atMost(TEN_SECONDS)
-            .until(() -> searchFirstMessageByFromField(fromName), Matchers.notNullValue());
-
-        assertThat(searchedMessageId)
-            .isEqualTo(messageId);
-    }
-
-    private String searchFirstMessageByFromField(String from) {
-        String searchRequest = "[" +
-            "  [" +
-            "    \"getMessageList\"," +
-            "    {" +
-            "      \"filter\": {" +
-            "        \"from\": \"" + from + "\"" +
-            "      }," +
-            "      \"sort\": [" +
-            "        \"date desc\"" +
-            "      ]," +
-            "      \"collapseThreads\": false," +
-            "      \"fetchMessages\": false," +
-            "      \"position\": 0," +
-            "      \"limit\": 1" +
-            "    }," +
-            "    \"#0\"" +
-            "  ]" +
-            "]";
-
-        return with()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(searchRequest)
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .extract()
-            .path(ARGUMENTS + ".messageIds[0]");
-    }
-
-    @Test
-    public void getMessageListShouldListMessageThatHasBeenMovedInAMailboxWhereTheUserHasOnlyReadRight() throws Exception {
-        MailboxId delegatedMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), "delegated");
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, BOB.asString(), "not_delegated");
-
-        MailboxPath notDelegatedMailboxPath = MailboxPath.forUser(BOB, "not_delegated");
-        MailboxPath delegatedMailboxPath = MailboxPath.forUser(BOB, "delegated");
-
-        ComposedMessageId message = mailboxProbe.appendMessage(BOB.asString(), notDelegatedMailboxPath,
-            new ByteArrayInputStream("Subject: chaussette\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        await();
-
-        aclProbe.replaceRights(delegatedMailboxPath,
-            ALICE.asString(),
-            new Rfc4314Rights(Right.Read));
-
-        String messageId = message.getMessageId().serialize();
-
-        given()
-            .header("Authorization", bobAccessToken.asString())
-            .body("[[\"setMessages\", {\"update\":{\"" + messageId + "\":{\"mailboxIds\": [\"" + delegatedMailboxId.serialize() + "\"]}}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200);
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"subject\":\"chaussette\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldNotDuplicateMessagesInSeveralMailboxes() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        MailboxId mailboxId2 = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        await();
-
-        jmapServer.getProbe(JmapGuiceProbe.class).setInMailboxes(message.getMessageId(), ALICE, mailboxId, mailboxId2);
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", hasSize(1));
-    }
-
-    @Test
-    public void getMessageListSetFlaggedFilterShouldResultFlaggedMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isFlagged\":\"true\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListUnsetFlaggedFilterShouldReturnNotFlaggedMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isFlagged\":\"false\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListReadFilterShouldReturnOnlyReadMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotRead = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageRead = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isUnread\":\"false\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageRead.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotRead.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListUnreadFilterShouldReturnOnlyUnreadMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotRead = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageRead = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isUnread\":\"true\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotRead.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageRead.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListSetDraftFilterShouldReturnOnlyDraftMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotDraft = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageDraft = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.DRAFT));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isDraft\":\"true\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageDraft.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotDraft.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListUnsetDraftFilterShouldReturnOnlyNonDraftMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotDraft = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageDraft = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.DRAFT));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isDraft\":\"false\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotDraft.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageDraft.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListSetAnsweredFilterShouldReturnOnlyAnsweredMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotAnswered = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageAnswered = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.ANSWERED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isAnswered\":\"true\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageAnswered.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotAnswered.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListUnsetAnsweredFilterShouldReturnOnlyNotAnsweredMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotAnswered = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageAnswered = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.ANSWERED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isAnswered\":\"false\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotAnswered.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageAnswered.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListSetForwardedFilterShouldReturnOnlyForwardedMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotForwarded = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageForwarded = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(FORWARDED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isForwarded\":\"true\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                containsInAnyOrder(messageForwarded.getMessageId().serialize()),
-                not(containsInAnyOrder(messageNotForwarded.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListUnsetForwardedFilterShouldReturnOnlyNotForwardedMessages() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotForwarded = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageForwarded = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(FORWARDED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"isForwarded\":\"false\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                containsInAnyOrder(messageNotForwarded.getMessageId().serialize()),
-                not(containsInAnyOrder(messageForwarded.getMessageId().serialize()))));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListANDOperatorShouldReturnMessagesWhichMatchAllConditions() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-        ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"AND\",\"conditions\":[{\"isFlagged\":\"true\"},{\"isUnread\":\"true\"}]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotSeenFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotSeenNotFlagged.getMessageId().serialize(),
-                            messageSeenNotFlagged.getMessageId().serialize(),
-                            messageSeenFlagged.getMessageId().serialize()))));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldFetchUnreadMessagesInMailbox() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "othermailbox");
-
-        ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-        ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build());
-
-        ComposedMessageId messageNotSeenFlaggedInOtherMailbox = mailboxProbe.appendMessage(ALICE.asString(), ALICE_OTHER_MAILBOX,
-                ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        ComposedMessageId messageSeenInOtherMailbox = mailboxProbe.appendMessage(ALICE.asString(), ALICE_OTHER_MAILBOX,
-                ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\": {\"inMailboxes\": [\"" + mailboxId.serialize() + "\"], \"isUnread\":\"true\"}}, \"#0\"]]")
-
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotSeenNotFlagged.getMessageId().serialize(), messageNotSeenFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageSeenNotFlagged.getMessageId().serialize(),
-                            messageSeenFlagged.getMessageId().serialize(),
-                            messageSeenInOtherMailbox.getMessageId().serialize(),
-                            messageNotSeenFlaggedInOtherMailbox.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListShouldRejectNestedInMailboxClause() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxPath.forUser(ALICE, "mailbox"));
-        mailboxProbe.createMailbox(MailboxPath.forUser(ALICE, "othermailbox"));
-        mailboxProbe.createMailbox(MailboxPath.inbox(ALICE));
-
-        ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-        ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build());
-
-        ComposedMessageId messageNotSeenFlaggedInOtherMailbox = mailboxProbe.appendMessage(ALICE.asString(), ALICE_OTHER_MAILBOX,
-                ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        ComposedMessageId messageSeenInOtherMailbox = mailboxProbe.appendMessage(ALICE.asString(), ALICE_OTHER_MAILBOX,
-                ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-                .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"AND\",\"conditions\":[{\"inMailboxes\": [\"" + mailboxId.serialize() + "\"]},{\"isUnread\":\"true\"}]}}, \"#0\"]]")
-                .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type",  equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description",  equalTo("'inMailboxes' and 'notInMailboxes' wrapped within Filter Operators are not implemented. Review your search request."));
-    }
-
-    @Test
-    public void getMessageListShouldRejectTooDeepFilter() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-                .body("[[\"getMessageList\", {\"filter\":" +
-                    "{\"operator\":\"AND\"," +
-                    " \"conditions\":[{\"operator\":\"AND\"," +
-                    "  \"conditions\":[{\"operator\":\"AND\"," +
-                    "   \"conditions\":[{\"operator\":\"AND\"," +
-                    "    \"conditions\":[{\"operator\":\"AND\"," +
-                    "     \"conditions\":[{\"operator\":\"AND\"," +
-                    "      \"conditions\":[{\"operator\":\"AND\"," +
-                    "       \"conditions\":[{\"operator\":\"AND\"," +
-                    "        \"conditions\":[{\"operator\":\"AND\"," +
-                    "         \"conditions\":[{\"operator\":\"AND\"," +
-                    "          \"conditions\":[{\"operator\":\"AND\"," +
-                    "           \"conditions\":[{\"operator\":\"AND\"," +
-                    "            \"conditions\":[{\"operator\":\"AND\"," +
-                    "             \"conditions\":[{\"isUnread\":\"true\"}" +
-                    "]}]}]}]}]}]}]}]}]}]}]}]}]}}, \"#0\"]]")
-                .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type",  equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description",  equalTo("Filter depth is higher than maximum allowed value 10"));
-    }
-
-    @Test
-    public void getMessageListOROperatorShouldReturnMessagesWhichMatchOneOfAllConditions() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-        ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"OR\",\"conditions\":[{\"isFlagged\":\"true\"},{\"isUnread\":\"true\"}]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageNotSeenFlagged.getMessageId().serialize(),
-                            messageSeenFlagged.getMessageId().serialize(),
-                            messageNotSeenNotFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageSeenNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListNOTOperatorShouldReturnMessagesWhichNotMatchAnyCondition() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-        ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"NOT\",\"conditions\":[{\"isFlagged\":\"true\"},{\"isUnread\":\"true\"}]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageSeenNotFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotSeenFlagged.getMessageId().serialize(),
-                            messageSeenFlagged.getMessageId().serialize(),
-                            messageNotSeenNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListNestedOperatorsShouldReturnMessagesWhichMatchConditions() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageNotSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageSeenNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags(Flags.Flag.SEEN));
-        ComposedMessageId messageSeenFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, FlagsBuilder.builder().add(Flags.Flag.SEEN, Flags.Flag.FLAGGED).build());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"OR\",\"conditions\":[" +
-                "{\"operator\":\"AND\", \"conditions\":[{\"isFlagged\":\"true\"},{\"isUnread\":\"true\"}]}," +
-                "{\"operator\":\"AND\", \"conditions\":[{\"isFlagged\":\"true\"},{\"isUnread\":\"false\"}]}" +
-                "]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                    containsInAnyOrder(messageSeenFlagged.getMessageId().serialize(),
-                            messageNotSeenFlagged.getMessageId().serialize()),
-                    not(containsInAnyOrder(messageNotSeenNotFlagged.getMessageId().serialize(),
-                            messageSeenNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListShouldReturnErrorInvalidArgumentsWhenRequestIsInvalid() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\": true}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"));
-    }
-
-    @Test
-    public void getMessageListShouldReturnErrorInvalidArgumentsWhenHeaderIsInvalid() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"header\":[\"132\", \"456\", \"789\"]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"));
-    }
-
-    @Test
-    public void getMessageListShouldSupportHasAttachmentSetToTrue() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags());
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"hasAttachment\":\"true\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSupportHasAttachmentSetToFalse() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags());
-        ComposedMessageId message3 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/oneInlinedImage.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"hasAttachment\":\"false\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message3.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldNotFailWhenHeaderIsValid() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"header\":[\"132\", \"456\"]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"));
-    }
-
-    @Test
-    public void getMessageListShouldReturnAllMessagesWhenSingleMailboxNoParameters() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldReturnAllMessagesWhenMultipleMailboxesAndNoParameters() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, "mailbox2"),
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldReturnAllMessagesOfCurrentUserOnlyWhenMultipleMailboxesAndNoParameters() throws Exception {
-        String otherUser = "other@" + DOMAIN;
-        String password = "password";
-        dataProbe.addUser(otherUser, password);
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, "mailbox2"),
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, otherUser, "mailbox");
-        mailboxProbe.appendMessage(otherUser, MailboxPath.forUser(Username.of(otherUser), "mailbox"),
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenInMailboxesFilterMatches() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + mailboxId.serialize() + "\"]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldNotExcludeMessagesWhenInMailboxesFilterMatchesMailboxAndText() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        List<String> messageIds = IntStream.range(0, 3)
-            .boxed()
-            .map(Throwing.function((ignored) -> mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                    new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags())).sneakyThrow())
-            .map(ComposedMessageId::getMessageId)
-            .map(MessageId::serialize)
-            .collect(Collectors.toList());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + mailboxId.serialize() + "\"],\"text\":\"test\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", equalTo(messageIds));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenMultipleInMailboxesFilterMatches() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        MailboxId mailboxId2 = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(String.format("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"%s\", \"%s\"]}}, \"#0\"]]", mailboxId.serialize(), mailboxId2.serialize()))
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenNotInMailboxesFilterMatches() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(String.format("[[\"getMessageList\", {\"filter\":{\"notInMailboxes\":[\"%s\"]}}, \"#0\"]]", mailboxId.serialize()))
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenNotInMailboxesFilterMatchesTwice() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        MailboxId mailbox2Id = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-        mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, "mailbox2"),
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(String.format("[[\"getMessageList\", {\"filter\":{\"notInMailboxes\":[\"%s\", \"%s\"]}}, \"#0\"]]", mailboxId.serialize(), mailbox2Id.serialize()))
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenIdenticalNotInMailboxesAndInMailboxesFilterMatch() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(String.format("[[\"getMessageList\", {\"filter\":{\"notInMailboxes\":[\"%s\"], \"inMailboxes\":[\"%s\"]}}, \"#0\"]]", mailboxId.serialize(), mailboxId.serialize()))
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenNotInMailboxesFilterDoesNotMatch() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        MailboxId mailbox2Id = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(String.format("[[\"getMessageList\", {\"filter\":{\"notInMailboxes\":[\"%s\"]}}, \"#0\"]]", mailbox2Id.serialize()))
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenEmptyNotInMailboxesFilter() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox2");
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"notInMailboxes\":[]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenInMailboxesFilterDoesntMatches() throws Exception {
-        MailboxId emptyMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "emptyMailbox");
-
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body(String.format("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"%s\"]}}, \"#0\"]]", emptyMailboxId.serialize()))
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenTextFilterDoesntMatches() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"text\":\"bad\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenTextFilterMatchesBody() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"text\":\"html\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    @Category(CassandraAndOpenSearchCategory.class)
-    public void getMessageListShouldIncludeMessagesWhenTextFilterMatchesBodyWithStemming() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                ClassLoader.getSystemResourceAsStream("eml/htmlMail.eml"), new Date(), false, new Flags());
-        await();
-        // text/html contains: "This is a mail with beautifull html content which contains a banana."
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"text\":\"contain banana\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenSubjectFilterMatchesSubject() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/twoAttachments.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"subject\":\"Image\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenFromFilterMatchesFrom() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"from\":\"from@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenFromFilterDoesntMatchFrom() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"from\":\"to@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenToFilterMatchesTo() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"to\":\"to@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenToFilterDoesntMatchTo() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"to\":\"from@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenCcFilterMatchesCc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"cc\":\"cc@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenCcFilterDoesntMatchCc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"cc\":\"bcc@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    public void getMessageListShouldIncludeMessagesWhenBccFilterMatchesBcc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"bcc\":\"bcc@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldExcludeMessagesWhenBccFilterDoesntMatchBcc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            ClassLoader.getSystemResourceAsStream("eml/mailWithRecipients.eml"), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"bcc\":\"to@james.org\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    @Category(CassandraAndOpenSearchCategory.class)
-    public void getMessageListShouldExcludeMessagesWhenAttachmentFilterDoesntMatch() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        byte[] attachmentContent = ClassLoaderUtils.getSystemResourceAsByteArray("eml/attachment.pdf");
-        Multipart multipart = MultipartBuilder.create("mixed")
-                .addBodyPart(BodyPartBuilder.create()
-                    .setBody(attachmentContent, "application/pdf")
-                    .setContentDisposition("attachment"))
-                .addBodyPart(BodyPartBuilder.create()
-                    .setBody("The message has a PDF attachment.", "plain", StandardCharsets.UTF_8))
-                .build();
-        Message message = Message.Builder.of()
-                .setBody(multipart)
-                .build();
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream(DefaultMessageWriter.asBytes(message)), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"attachments\":\"no apple inside\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", empty());
-    }
-
-    @Test
-    @Category(CassandraAndOpenSearchCategory.class)
-    public void getMessageListShouldIncludeMessagesWhenAttachmentFilterMatches() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        byte[] attachmentContent = ClassLoaderUtils.getSystemResourceAsByteArray("eml/attachment.pdf");
-        Multipart multipart = MultipartBuilder.create("mixed")
-                .addBodyPart(BodyPartBuilder.create()
-                    .setBody(attachmentContent, "application/pdf")
-                    .setContentDisposition("attachment"))
-                .addBodyPart(BodyPartBuilder.create()
-                    .setBody("The message has a PDF attachment.", "plain", StandardCharsets.UTF_8))
-                .build();
-        Message message = Message.Builder.of()
-                .setBody(multipart)
-                .build();
-        ComposedMessageId composedMessageId = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream(DefaultMessageWriter.asBytes(message)), new Date(), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"attachments\":\"beautiful banana\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(ARGUMENTS + ".messageIds", contains(composedMessageId.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByDateDefault() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"date\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenDateDoesntHaveCentury() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.parse("Wed, 28 Jun 17 09:23:01 +0200", ImapDateTimeFormatter.rfc5322());
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        LocalDate date2 = LocalDate.parse("Tue, 27 Jun 2017 09:23:01 +0200", ImapDateTimeFormatter.rfc5322());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date2), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"date desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByDateAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"date asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedBySubjectAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: a subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: b subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"subject asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedBySubjectDesc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: a subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: b subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"subject desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByFromAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nFrom: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nFrom: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"from asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByFromDesc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nFrom: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nFrom: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"from desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByToAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nTo: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nTo: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"to asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByToDesc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\nTo: aaa\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\nTo: bbb\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"to desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedBySizeAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail bigger".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"size asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedBySizeDesc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: subject\r\n\r\ntestmail bigger".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"size desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedBySizeAndDateAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject: test\r\n\r\ntestmail smaller".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message3 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 15:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"size asc\", \"date desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message3.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByDateAndSizeAsc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject: test\r\n\r\ntestmail smaller".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message3 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 15:54:59 +0200\r\nSubject: test\r\n\r\ntestmail really bigger".getBytes()), convertToDate(date), false, new Flags());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"date desc\", \"size asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message3.getMessageId().serialize(), message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldSupportIdSorting() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"id\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByDateDesc() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"date desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortMessagesWhenSortedByDateDescAndInMailbox() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + mailboxId.serialize() + "\"]}, \"sort\":[\"date desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldWorkWhenCollapseThreadIsFalse() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"collapseThreads\":false}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"));
-    }
-
-    @Test
-    public void getMessageListShouldWorkWhenCollapseThreadIsTrue() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"collapseThreads\":true}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"));
-    }
-
-    @Test
-    public void getMessageListShouldReturnAllMessagesWhenPositionIsNotGiven() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldReturnSkipMessagesWhenPositionIsGiven() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"position\":1, \"sort\":[\"date desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldReturnSkipMessagesWhenPositionAndLimitGiven() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(2)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test3\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"position\":1, \"limit\":1, \"sort\":[\"date desc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldReturnAllMessagesWhenLimitIsNotGiven() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message1.getMessageId().serialize(), message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldReturnLimitMessagesWhenLimitGiven() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"limit\":1}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldReturnLimitMessagesWithDefaultValueWhenLimitIsNotGiven() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        ComposedMessageId message3 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test3\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test4\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", containsInAnyOrder(message1.getMessageId().serialize(), message2.getMessageId().serialize(), message3.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldChainFetchingMessagesWhenAskedFor() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"fetchMessages\":true}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body("[0][0]", equalTo("messageList"))
-            .body("[1][0]", equalTo("messages"))
-            .body("[0][1].messageIds", hasSize(1))
-            .body("[0][1].messageIds[0]", equalTo(message.getMessageId().serialize()))
-            .body("[1][1].list", hasSize(1))
-            .body("[1][1].list[0].id", equalTo(message.getMessageId().serialize()));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getMessageListShouldComputeTextBodyWhenNoTextBodyButHtmlBody() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        String mailContent = "Content-Type: text/html\r\n"
-            + "Subject: message 1 subject\r\n"
-            + "\r\n"
-            + "Hello <b>someone</b>, and thank you for joining example.com!";
-        LocalDate date = LocalDate.now();
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream(mailContent.getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"fetchMessages\": true, \"fetchMessageProperties\": [\"htmlBody\", \"textBody\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body("[0][0]", equalTo("messageList"))
-            .body("[1][0]", equalTo("messages"))
-            .body("[0][1].messageIds", hasSize(1))
-            .body("[1][1].list[0].htmlBody", equalTo("Hello <b>someone</b>, and thank you for joining example.com!"))
-            .body("[1][1].list[0].textBody", equalTo("Hello someone, and thank you for joining example.com!"));
-    }
-
-    @Test
-    public void getMessageListHasKeywordFilterShouldReturnMessagesWithKeywords() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"hasKeyword\":\"$Flagged\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                containsInAnyOrder(messageFlagged.getMessageId().serialize()),
-                not(containsInAnyOrder(messageNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListHasKeywordFilterShouldReturnMessagesWithUserKeywords() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        Flags flags = FlagsBuilder.builder()
-            .add(Flags.Flag.FLAGGED)
-            .add(FORWARDED)
-            .build();
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, flags);
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"AND\",\"conditions\":[{\"hasKeyword\":\"$Flagged\"},{\"hasKeyword\":\"$Forwarded\"}]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-            containsInAnyOrder(messageFlagged.getMessageId().serialize()),
-            not(containsInAnyOrder(messageNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListNotKeywordFilterShouldReturnMessagesWithoutKeywords() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"notKeyword\":\"$Flagged\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                containsInAnyOrder(messageNotFlagged.getMessageId().serialize()),
-                not(containsInAnyOrder(messageFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListNotKeywordFilterShouldReturnMessagesWithoutUserKeywords() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        Flags flags = FlagsBuilder.builder()
-            .add(Flags.Flag.FLAGGED)
-            .add(FORWARDED)
-            .build();
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, flags);
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"AND\",\"conditions\":[{\"notKeyword\":\"$Flagged\"},{\"notKeyword\":\"$Forwarded\"}]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                containsInAnyOrder(messageNotFlagged.getMessageId().serialize()),
-                not(containsInAnyOrder(messageFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListNotKeywordFilterShouldReturnMessagesWithoutKeywordsWhenMultipleNotKeywordAndFilterOperator() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        Flags flags = FlagsBuilder.builder()
-            .add(FORWARDED)
-            .add(Flags.Flag.DRAFT)
-            .build();
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, flags);
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"operator\":\"OR\",\"conditions\":[{\"notKeyword\":\"$Flagged\"},{\"notKeyword\":\"$Forwarded\"}]}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds",
-                containsInAnyOrder(messageNotFlagged.getMessageId().serialize(), messageFlagged.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListHasKeywordAndNotKeywordFilterShouldReturnMessagesWithAndWithoutKeywords() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.FLAGGED));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"hasKeyword\":\"$Flagged\", \"notKeyword\":\"$Draft\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", allOf(
-                containsInAnyOrder(messageFlagged.getMessageId().serialize()),
-                not(containsInAnyOrder(messageNotFlagged.getMessageId().serialize()))));
-    }
-
-    @Test
-    public void getMessageListHasKeywordShouldIgnoreRecent() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.RECENT));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"hasKeyword\":\"$Recent\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds",
-                containsInAnyOrder(messageFlagged.getMessageId().serialize(), messageNotFlagged.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListNotKeywordShouldIgnoreRecent() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        ComposedMessageId messageNotFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags());
-        ComposedMessageId messageFlagged = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), false, new Flags(Flags.Flag.RECENT));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"notKeyword\":\"$Recent\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds",
-                containsInAnyOrder(messageFlagged.getMessageId().serialize(), messageNotFlagged.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListShouldSortUsingInternalDateWhenNoDateHeader() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        LocalDate date = LocalDate.now();
-        ComposedMessageId message1 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"sort\":[\"date asc\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(), message1.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListFileNameFilterShouldReturnOnlyMessagesWithMatchingAttachmentFileNames() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            MessageManager.AppendCommand.builder()
-                .build(Message.Builder.of()
-                    .setSubject("test")
-                    .setBody("content", StandardCharsets.UTF_8)));
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            MessageManager.AppendCommand.builder()
-                .build(Message.Builder.of()
-                    .setBody(
-                        MultipartBuilder.create("alternative")
-                            .addBodyPart(BodyPartBuilder.create()
-                                .setContentDisposition("attachment", "matchme.txt")
-                                .setBody(SingleBodyBuilder.create()
-                                    .setText("this is the file content...")
-                                    .setCharset(StandardCharsets.UTF_8)
-                                    .build())
-                                .build())
-                            .build())));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"attachmentFileName\":\"matchme.txt\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize()));
-    }
-
-    @Test
-    public void getMessageListFileNameFilterShouldNotReturnMessagesWithOnlyAttachmentContentMatching() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            MessageManager.AppendCommand.builder()
-                .build(Message.Builder.of()
-                    .setBody(
-                        MultipartBuilder.create("alternative")
-                            .addBodyPart(BodyPartBuilder.create()
-                                .setContentDisposition("attachment", "nomatch.md")
-                                .setBody(SingleBodyBuilder.create()
-                                    .setText("matchme.txt ...")
-                                    .setCharset(StandardCharsets.UTF_8)
-                                    .build())
-                                .build())
-                            .build())));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"attachmentFileName\":\"matchme.txt\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", hasSize(0));
-    }
-
-    @Test
-    public void getMessageListTextFilterShouldReturnOnlyMessagesWithMatchingAttachmentFileNames() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            MessageManager.AppendCommand.builder()
-                .build(Message.Builder.of()
-                    .setSubject("test")
-                    .setBody("content", StandardCharsets.UTF_8)));
-        ComposedMessageId message2 = mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            MessageManager.AppendCommand.builder()
-                .build(Message.Builder.of()
-                    .setBody(
-                        MultipartBuilder.create("alternative")
-                            .addBodyPart(BodyPartBuilder.create()
-                                .setContentDisposition("attachment", "matchme.txt")
-                                .setBody(SingleBodyBuilder.create()
-                                    .setText("this is the file content...")
-                                    .setCharset(StandardCharsets.UTF_8)
-                                    .build())
-                                .build())
-                            .build())));
-
-        await();
-
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"filter\":{\"text\":\"matchme.txt\"}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize()));
-    }
-
-    private Date convertToDate(LocalDate localDate) {
-        return Date.from(localDate.atStartOfDay(ZONE_ID).toInstant());
-    }
-
-    @Test
-    public void getMessageListShouldAcceptLessThan2Pow53NumberForPosition() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"position\":" + Number.MAX_VALUE + "}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("messageList"));
-    }
-
-    @Test
-    public void getMessageListShouldErrorWhenPositionOver2Pow53() {
-        given()
-            .header("Authorization", aliceAccessToken.asString())
-            .body("[[\"getMessageList\", {\"position\":" + Number.MAX_VALUE + 1 + "}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("value should be positive and less than 2^53"));
-    }
-
-    @Test
-    public void getMessageListShouldReturnTwoMessagesWhenCopiedAtOnceViaIMAP() throws Exception {
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "mailbox");
-        MailboxId otherMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "otherMailbox");
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-            MessageManager.AppendCommand.builder()
-            .build(Message.Builder.of()
-                    .setSubject("test 1")
-                    .setBody("content 1", StandardCharsets.UTF_8)));
-
-        mailboxProbe.appendMessage(ALICE.asString(), ALICE_MAILBOX,
-                MessageManager.AppendCommand.builder()
-                .build(Message.Builder.of()
-                        .setSubject("test 2")
-                        .setBody("content 2", StandardCharsets.UTF_8)));
-
-        try (TestIMAPClient imap = new TestIMAPClient()) {
-            imap.connect(LOCALHOST, jmapServer.getProbe(ImapGuiceProbe.class).getImapPort())
-            .login(ALICE, ALICE_PASSWORD)
-            .select("mailbox")
-            .copyAllMessagesInMailboxTo("otherMailbox");
-        }
-
-        await();
-
-        calmlyAwait
-            .atMost(30, TimeUnit.SECONDS)
-            .until(() -> twoMessagesFoundInMailbox(otherMailboxId));
-    }
-
-    @Test
-    public void aMessageInOutboxShouldBeAccessibleViaJmap() throws Exception {
-        MailboxId outboxMailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, ALICE.asString(), "Outbox");
-        String messageBody = "We're all mad here.";
-        mailboxProbe.appendMessage(
-            ALICE.asString(),
-            MailboxPath.forUser(ALICE, "Outbox"),
-            new ByteArrayInputStream(("Subject: test\r\n\r\n" + messageBody).getBytes(StandardCharsets.UTF_8)),
-            new Date(), false, new Flags());
-
-        calmlyAwait
-            .atMost(30, TimeUnit.SECONDS)
-            .until(() -> listMessageIdsInMailbox(aliceAccessToken, outboxMailboxId.serialize()).size() == 1);
-
-        assertThat(bodyOfMessage(aliceAccessToken, listMessageIdsInMailbox(aliceAccessToken, outboxMailboxId.serialize()).get(0)))
-            .isEqualTo(messageBody);
-    }
-
-    private boolean twoMessagesFoundInMailbox(MailboxId mailboxId) {
-        try {
-            with()
-                .header("Authorization", aliceAccessToken.asString())
-                .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + mailboxId.serialize() + "\"]}}, \"#0\"]]")
-            .when()
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(NAME, equalTo("messageList"))
-                .body(ARGUMENTS + ".messageIds", hasSize(2));
-            return true;
-        } catch (AssertionError e) {
-            return false;
-        }
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java
deleted file mode 100644
index 5b790dec87..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE;
-import static org.apache.james.jmap.JMAPTestingConstants.ALICE_PASSWORD;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.core.IsNull.nullValue;
-
-import java.io.IOException;
-import java.time.ZonedDateTime;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
-import org.apache.james.jmap.api.model.AccountId;
-import org.apache.james.vacation.api.VacationPatch;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.util.date.ZonedDateTimeProvider;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import io.restassured.RestAssured;
-import io.restassured.http.ContentType;
-
-public abstract class GetVacationResponseTest {
-    public static final String SUBJECT = "subject";
-    public static final ZonedDateTime DATE_2015 = ZonedDateTime.parse("2015-10-15T14:10:00Z");
-    public static final ZonedDateTime DATE_2014 = ZonedDateTime.parse("2014-09-30T14:10:00+02:00");
-    public static final ZonedDateTime DATE_2016 = ZonedDateTime.parse("2016-04-15T11:56:32.224+07:00[Asia/Vientiane]");
-    private JmapGuiceProbe jmapGuiceProbe;
-
-    protected abstract GuiceJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) throws IOException;
-
-    private AccessToken accessToken;
-    private GuiceJamesServer jmapServer;
-    private FixedDateZonedDateTimeProvider fixedDateZonedDateTimeProvider;
-
-    @Before
-    public void setup() throws Throwable {
-        fixedDateZonedDateTimeProvider = new FixedDateZonedDateTimeProvider();
-        fixedDateZonedDateTimeProvider.setFixedDateTime(DATE_2015);
-
-        jmapServer = createJmapServer(fixedDateZonedDateTimeProvider);
-        jmapServer.start();
-
-        jmapGuiceProbe = jmapServer.getProbe(JmapGuiceProbe.class);
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapGuiceProbe.getJmapPort().getValue())
-                .build();
-
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(ALICE.asString(), ALICE_PASSWORD);
-        accessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getVacationResponseShouldReturnDefaultValue() {
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "\"getVacationResponse\", " +
-                "{}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("vacationResponse"))
-            .body(ARGUMENTS + ".accountId", equalTo(ALICE.asString()))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(ARGUMENTS + ".list[0].id", equalTo("singleton"))
-            .body(ARGUMENTS + ".list[0].fromDate", nullValue())
-            .body(ARGUMENTS + ".list[0].toDate", nullValue())
-            .body(ARGUMENTS + ".list[0].isEnabled", equalTo(false))
-            .body(ARGUMENTS + ".list[0].subject", nullValue())
-            .body(ARGUMENTS + ".list[0].textBody", nullValue())
-            .body(ARGUMENTS + ".list[0].htmlBody", nullValue());
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void getVacationResponseShouldReturnStoredValue() {
-        jmapGuiceProbe.modifyVacation(AccountId.fromUsername(ALICE),
-            VacationPatch.builder()
-                .isEnabled(true)
-                .fromDate(ZonedDateTime.parse("2014-09-30T14:10:00Z"))
-                .toDate(ZonedDateTime.parse("2014-10-30T14:10:00Z"))
-                .textBody("Test explaining my vacations")
-                .subject(SUBJECT)
-                .htmlBody("<p>Test explaining my vacations</p>")
-                .build());
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "\"getVacationResponse\", " +
-                "{}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("vacationResponse"))
-            .body(ARGUMENTS + ".accountId", equalTo(ALICE.asString()))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(ARGUMENTS + ".list[0].id", equalTo("singleton"))
-            .body(ARGUMENTS + ".list[0].fromDate", equalTo("2014-09-30T14:10:00Z"))
-            .body(ARGUMENTS + ".list[0].toDate", equalTo("2014-10-30T14:10:00Z"))
-            .body(ARGUMENTS + ".list[0].isEnabled", equalTo(true))
-            .body(ARGUMENTS + ".list[0].textBody", equalTo("Test explaining my vacations"))
-            .body(ARGUMENTS + ".list[0].subject", equalTo(SUBJECT))
-            .body(ARGUMENTS + ".list[0].htmlBody", equalTo("<p>Test explaining my vacations</p>"));
-    }
-
-    @Test
-    public void getVacationResponseShouldReturnStoredValueWithNonDefaultTimezone() {
-        jmapGuiceProbe.modifyVacation(AccountId.fromUsername(ALICE),
-            VacationPatch.builder()
-                .isEnabled(true)
-                .fromDate(ZonedDateTime.parse("2014-09-30T14:10:00+02:00"))
-                .toDate(ZonedDateTime.parse("2016-04-15T11:56:32.224+07:00[Asia/Vientiane]"))
-                .textBody("Test explaining my vacations")
-                .build());
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "\"getVacationResponse\", " +
-                "{}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("vacationResponse"))
-            .body(ARGUMENTS + ".accountId", equalTo(ALICE.asString()))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(ARGUMENTS + ".list[0].id", equalTo("singleton"))
-            .body(ARGUMENTS + ".list[0].fromDate", equalTo("2014-09-30T14:10:00+02:00"))
-            .body(ARGUMENTS + ".list[0].toDate", equalTo("2016-04-15T11:56:32.224+07:00[Asia/Vientiane]"))
-            .body(ARGUMENTS + ".list[0].isEnabled", equalTo(true))
-            .body(ARGUMENTS + ".list[0].textBody", equalTo("Test explaining my vacations"));
-    }
-
-    @Test
-    public void getVacationResponseShouldReturnIsActivatedWhenInRange() {
-        jmapGuiceProbe.modifyVacation(AccountId.fromUsername(ALICE),
-            VacationPatch.builder()
-                .isEnabled(true)
-                .fromDate(DATE_2014)
-                .toDate(DATE_2016)
-                .textBody("Test explaining my vacations")
-                .build());
-
-        given()
-            .accept(ContentType.JSON)
-            .contentType(ContentType.JSON)
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                    "\"getVacationResponse\", " +
-                    "{}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("vacationResponse"))
-            .body(ARGUMENTS + ".list[0].isActivated", equalTo(true));
-    }
-
-    @Test
-    public void getVacationResponseShouldNotReturnIsActivatedWhenOutOfRange() {
-        fixedDateZonedDateTimeProvider.setFixedDateTime(DATE_2014);
-
-        jmapGuiceProbe.modifyVacation(AccountId.fromUsername(ALICE),
-            VacationPatch.builder()
-                .isEnabled(true)
-                .fromDate(DATE_2015)
-                .toDate(DATE_2016)
-                .textBody("Test explaining my vacations")
-                .build());
-
-        given()
-            .accept(ContentType.JSON)
-            .contentType(ContentType.JSON)
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                    "\"getVacationResponse\", " +
-                    "{}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("vacationResponse"))
-            .body(ARGUMENTS + ".list[0].isActivated", equalTo(false));
-    }
-
-    @Test
-    public void accountIdIsNotSupported() {
-        jmapGuiceProbe.modifyVacation(AccountId.fromUsername(ALICE),
-            VacationPatch.builder()
-                .isEnabled(true)
-                .fromDate(ZonedDateTime.parse("2014-09-30T14:10:00+02:00"))
-                .toDate(ZonedDateTime.parse("2014-10-30T14:10:00+02:00"))
-                .textBody("Test explaining my vacations")
-                .build());
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[" +
-                "\"getVacationResponse\", " +
-                "{\"accountId\":\"1\"}, " +
-                "\"#0\"" +
-                "]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".description", equalTo("The field 'accountId' of 'GetVacationRequest' is not supported"));
-    }
-
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java
deleted file mode 100644
index e052db70e2..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapCommonRequests.concatMessageIds;
-import static org.apache.james.jmap.JmapCommonRequests.getOutboxId;
-import static org.apache.james.jmap.JmapCommonRequests.listMessageIdsForAccount;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.awaitility.Durations.TWO_MINUTES;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.hasItem;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.core.quota.QuotaSizeLimit;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.probe.MailboxProbe;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.modules.QuotaProbesImpl;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.awaitility.core.ConditionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.google.common.base.Strings;
-
-import io.restassured.RestAssured;
-import io.restassured.parsing.Parser;
-
-public abstract class QuotaMailingTest {
-    private static final Username HOMER = Username.of("homer@" + DOMAIN);
-    private static final Username BART = Username.of("bart@" + DOMAIN);
-    private static final String PASSWORD = "password";
-    private static final String BOB_PASSWORD = "bobPassword";
-    private static final ConditionFactory WAIT_TWO_MINUTES = calmlyAwait.atMost(TWO_MINUTES);
-    private QuotaProbesImpl quotaProbe;
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    private AccessToken homerAccessToken;
-    private AccessToken bartAccessToken;
-    private GuiceJamesServer jmapServer;
-
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-        MailboxProbe mailboxProbe = jmapServer.getProbe(MailboxProbeImpl.class);
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        quotaProbe = jmapServer.getProbe(QuotaProbesImpl.class);
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-            .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-            .build();
-        RestAssured.defaultParser = Parser.JSON;
-
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(HOMER.asString(), PASSWORD);
-        dataProbe.addUser(BART.asString(), BOB_PASSWORD);
-        mailboxProbe.createMailbox("#private", HOMER.asString(), DefaultMailboxes.INBOX);
-        homerAccessToken = authenticateJamesUser(baseUri(jmapServer), HOMER, PASSWORD);
-        bartAccessToken = authenticateJamesUser(baseUri(jmapServer), BART, BOB_PASSWORD);
-    }
-
-    @After
-    public void tearDown() {
-        jmapServer.stop();
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void shouldSendANoticeWhenThresholdExceeded() throws Exception {
-        quotaProbe.setMaxStorage(quotaProbe.getQuotaRoot(MailboxPath.inbox(HOMER)), QuotaSizeLimit.size(100 * 1000));
-
-        bartSendMessageToHomer();
-        // Homer receives a mail big enough to trigger a configured threshold
-
-        WAIT_TWO_MINUTES.until(() -> listMessageIdsForAccount(homerAccessToken).size() == 2);
-
-        List<String> ids = listMessageIdsForAccount(homerAccessToken);
-        String idString = concatMessageIds(ids);
-
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"getMessages\", {\"ids\": [" + idString + "]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .log().ifValidationFails()
-            .body(ARGUMENTS + ".list.subject",
-                hasItem("Warning: Your email usage just exceeded a configured threshold"));
-    }
-
-    @Test
-    public void configurationShouldBeWellLoaded() throws Exception {
-        quotaProbe.setMaxStorage(quotaProbe.getQuotaRoot(MailboxPath.inbox(HOMER)), QuotaSizeLimit.size(100 * 1000));
-
-        bartSendMessageToHomer();
-        // Homer receives a mail big enough to trigger a 10% configured threshold
-        WAIT_TWO_MINUTES.until(() -> listMessageIdsForAccount(homerAccessToken).size() == 2);
-
-        bartSendMessageToHomer();
-        // Homer receives a mail big enough to trigger a 20% configured threshold
-        WAIT_TWO_MINUTES.until(() -> listMessageIdsForAccount(homerAccessToken).size() == 4);
-
-        List<String> ids = listMessageIdsForAccount(homerAccessToken);
-        String idString = concatMessageIds(ids);
-
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"getMessages\", {\"ids\": [" + idString + "]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .log().ifValidationFails()
-            .body(ARGUMENTS + ".list.textBody",
-                hasItem(containsString("You currently occupy more than 10 % of the total size allocated to you")))
-            .body(ARGUMENTS + ".list.textBody",
-                hasItem(containsString("You currently occupy more than 20 % of the total size allocated to you")));
-    }
-
-    private void bartSendMessageToHomer() {
-        String messageCreationId = "creationId";
-        String outboxId = getOutboxId(bartAccessToken);
-        String bigEnoughBody = Strings.repeat("123456789\n", 12 * 100);
-        String requestBody = "[" +
-            "  [" +
-            "    \"setMessages\"," +
-            "    {" +
-            "      \"create\": { \"" + messageCreationId  + "\" : {" +
-            "        \"headers\":{\"Disposition-Notification-To\":\"" + BART.asString() + "\"}," +
-            "        \"from\": { \"name\": \"Bob\", \"email\": \"" + BART.asString() + "\"}," +
-            "        \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER.asString() + "\"}]," +
-            "        \"subject\": \"Message without an attachment\"," +
-            "        \"textBody\": \"" + bigEnoughBody + "\"," +
-            "        \"htmlBody\": \"Test <b>body</b>, HTML version\"," +
-            "        \"mailboxIds\": [\"" + outboxId + "\"] " +
-            "      }}" +
-            "    }," +
-            "    \"#0\"" +
-            "  ]" +
-            "]";
-
-        with()
-            .header("Authorization", bartAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .extract()
-            .body()
-            .path(ARGUMENTS + ".created." + messageCreationId + ".id");
-    }
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java
deleted file mode 100644
index c3067834a7..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapCommonRequests.getInboxId;
-import static org.apache.james.jmap.JmapCommonRequests.getOutboxId;
-import static org.apache.james.jmap.JmapCommonRequests.listMessageIdsForAccount;
-import static org.apache.james.jmap.JmapCommonRequests.listMessageIdsInMailbox;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.awaitility.Durations.TWO_MINUTES;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasEntry;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.hamcrest.Matchers.startsWith;
-
-import java.util.List;
-
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.core.quota.QuotaSizeLimit;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.MessageAppender;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.QuotaRoot;
-import org.apache.james.mailbox.probe.MailboxProbe;
-import org.apache.james.mailbox.probe.QuotaProbe;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.modules.QuotaProbesImpl;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.junit.experimental.categories.Category;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.Iterables;
-
-import io.restassured.RestAssured;
-import io.restassured.parsing.Parser;
-
-public abstract class SendMDNMethodTest {
-    private static final Username HOMER = Username.of("homer@" + DOMAIN);
-    private static final Username BART = Username.of("bart@" + DOMAIN);
-    private static final String PASSWORD = "password";
-    private static final String BOB_PASSWORD = "bobPassword";
-
-    protected abstract MessageId randomMessageId();
-
-    private AccessToken homerAccessToken;
-    private AccessToken bartAccessToken;
-    private GuiceJamesServer jmapServer;
-
-    @BeforeEach
-    void setup(GuiceJamesServer jmapServer) throws Throwable {
-        this.jmapServer = jmapServer;
-        MailboxProbe mailboxProbe = jmapServer.getProbe(MailboxProbeImpl.class);
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-                .build();
-        RestAssured.defaultParser = Parser.JSON;
-
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(HOMER.asString(), PASSWORD);
-        dataProbe.addUser(BART.asString(), BOB_PASSWORD);
-        mailboxProbe.createMailbox("#private", HOMER.asString(), DefaultMailboxes.INBOX);
-        mailboxProbe.createMailbox("#private", HOMER.asString(), DefaultMailboxes.OUTBOX);
-        homerAccessToken = authenticateJamesUser(baseUri(jmapServer), HOMER, PASSWORD);
-        bartAccessToken = authenticateJamesUser(baseUri(jmapServer), BART, BOB_PASSWORD);
-    }
-
-    private String bartSendMessageToHomer() {
-        String messageCreationId = "creationId";
-        String outboxId = getOutboxId(bartAccessToken);
-        String requestBody = "[" +
-            "  [" +
-            "    \"setMessages\"," +
-            "    {" +
-            "      \"create\": { \"" + messageCreationId  + "\" : {" +
-            "        \"headers\":{\"Disposition-Notification-To\":\"" + BART.asString() + "\"}," +
-            "        \"from\": { \"name\": \"Bob\", \"email\": \"" + BART.asString() + "\"}," +
-            "        \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER.asString() + "\"}]," +
-            "        \"subject\": \"Message with an attachment\"," +
-            "        \"textBody\": \"Test body, plain text version\"," +
-            "        \"htmlBody\": \"Test <b>body</b>, HTML version\"," +
-            "        \"mailboxIds\": [\"" + outboxId + "\"] " +
-            "      }}" +
-            "    }," +
-            "    \"#0\"" +
-            "  ]" +
-            "]";
-
-        String id = with()
-            .header("Authorization", bartAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .extract()
-            .body()
-            .path(ARGUMENTS + ".created." + messageCreationId + ".id");
-
-        calmlyAwait.until(() -> !listMessageIdsForAccount(homerAccessToken).isEmpty());
-        return id;
-    }
-
-    private void sendAWrongInitialMessage() {
-        String messageCreationId = "creationId";
-        String outboxId = getOutboxId(bartAccessToken);
-        String requestBody = "[" +
-            "  [" +
-            "    \"setMessages\"," +
-            "    {" +
-            "      \"create\": { \"" + messageCreationId  + "\" : {" +
-            "        \"from\": { \"name\": \"Bob\", \"email\": \"" + BART.asString() + "\"}," +
-            "        \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER.asString() + "\"}]," +
-            "        \"subject\": \"Message with an attachment\"," +
-            "        \"textBody\": \"Test body, plain text version\"," +
-            "        \"htmlBody\": \"Test <b>body</b>, HTML version\"," +
-            "        \"mailboxIds\": [\"" + outboxId + "\"] " +
-            "      }}" +
-            "    }," +
-            "    \"#0\"" +
-            "  ]" +
-            "]";
-
-        with()
-            .header("Authorization", bartAccessToken.asString())
-            .body(requestBody)
-            .post("/jmap")
-        .then()
-            .extract()
-            .body()
-            .path(ARGUMENTS + ".created." + messageCreationId + ".id");
-
-        calmlyAwait.until(() -> !listMessageIdsForAccount(homerAccessToken).isEmpty());
-    }
-
-    @Test
-    void sendMDNShouldReturnCreatedMessageId() {
-        bartSendMessageToHomer();
-
-        List<String> messageIds = listMessageIdsForAccount(homerAccessToken);
-
-        String creationId = "creation-1";
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                    "    \"messageId\":\"" + messageIds.get(0) + "\"," +
-                    "    \"subject\":\"subject\"," +
-                    "    \"textBody\":\"textBody\"," +
-                    "    \"reportingUA\":\"reportingUA\"," +
-                    "    \"disposition\":{" +
-                    "        \"actionMode\":\"automatic-action\"," +
-                    "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                    "        \"type\":\"processed\"" +
-                    "    }" +
-                    "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("messagesSet"))
-            .body(ARGUMENTS + ".MDNSent." + creationId, notNullValue());
-    }
-
-    @Test
-    void sendMDNShouldFailOnUnknownMessageId() {
-        bartSendMessageToHomer();
-
-        String creationId = "creation-1";
-        String randomMessageId = randomMessageId().serialize();
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                    "    \"messageId\":\"" + randomMessageId + "\"," +
-                    "    \"subject\":\"subject\"," +
-                    "    \"textBody\":\"textBody\"," +
-                    "    \"reportingUA\":\"reportingUA\"," +
-                    "    \"disposition\":{" +
-                    "        \"actionMode\":\"automatic-action\"," +
-                    "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                    "        \"type\":\"processed\"" +
-                    "    }" +
-                    "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("messagesSet"))
-            .body(ARGUMENTS + ".MDNNotSent", hasEntry(
-                equalTo(creationId),
-                hasEntry("type", "invalidArguments")))
-            .body(ARGUMENTS + ".MDNNotSent", hasEntry(
-                equalTo(creationId),
-                hasEntry("description", "Message with id " + randomMessageId + " not found. Thus could not send MDN.")));
-    }
-
-    @Test
-    void sendMDNShouldFailOnInvalidMessages() {
-        sendAWrongInitialMessage();
-        List<String> messageIds = listMessageIdsForAccount(homerAccessToken);
-
-        String creationId = "creation-1";
-
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                    "    \"messageId\":\"" + messageIds.get(0) + "\"," +
-                    "    \"subject\":\"subject\"," +
-                    "    \"textBody\":\"textBody\"," +
-                    "    \"reportingUA\":\"reportingUA\"," +
-                    "    \"disposition\":{" +
-                    "        \"actionMode\":\"automatic-action\"," +
-                    "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                    "        \"type\":\"processed\"" +
-                    "    }" +
-                    "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("messagesSet"))
-            .body(ARGUMENTS + ".MDNNotSent", hasEntry(
-                equalTo(creationId),
-                hasEntry("type", "invalidArguments")))
-            .body(ARGUMENTS + ".MDNNotSent", hasEntry(
-                equalTo(creationId),
-                hasEntry("description", "Origin messageId '" + messageIds.get(0) + "' is invalid. " +
-                    "A Message Delivery Notification can not be generated for it. " +
-                    "Explanation: Disposition-Notification-To header is missing")));
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    void sendMDNShouldSendAMDNBackToTheOriginalMessageAuthor() {
-        String bartSentJmapMessageId = bartSendMessageToHomer();
-
-        String homerReceivedMessageId = Iterables.getOnlyElement(listMessageIdsForAccount(homerAccessToken));
-
-        // HOMER sends a MDN back to BART
-        String creationId = "creation-1";
-        with()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                "    \"messageId\":\"" + homerReceivedMessageId + "\"," +
-                "    \"subject\":\"subject\"," +
-                "    \"textBody\":\"Read confirmation\"," +
-                "    \"reportingUA\":\"reportingUA\"," +
-                "    \"disposition\":{" +
-                "        \"actionMode\":\"automatic-action\"," +
-                "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                "        \"type\":\"processed\"" +
-                "    }" +
-                "}" +
-                "}}, \"#0\"]]")
-            .post("/jmap");
-
-        // BART should have received it
-        calmlyAwait.atMost(TWO_MINUTES).until(() -> !listMessageIdsInMailbox(bartAccessToken, getInboxId(bartAccessToken)).isEmpty());
-        String bartInboxMessageIds = Iterables.getOnlyElement(listMessageIdsInMailbox(bartAccessToken, getInboxId(bartAccessToken)));
-
-        String firstMessage = ARGUMENTS + ".list[0]";
-        given()
-            .header("Authorization", bartAccessToken.asString())
-            .body("[[\"getMessages\", {\"ids\": [\"" + bartInboxMessageIds + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(firstMessage + ".from.email", is(HOMER.asString()))
-            .body(firstMessage + ".to.email", contains(BART.asString()))
-            .body(firstMessage + ".hasAttachment", is(false))
-            .body(firstMessage + ".textBody", is("Read confirmation"))
-            .body(firstMessage + ".subject", is("subject"))
-            .body(firstMessage + ".headers.Content-Type", startsWith("multipart/report;"))
-            .body(firstMessage + ".headers.X-JAMES-MDN-JMAP-MESSAGE-ID", equalTo(bartSentJmapMessageId));
-    }
-
-    @Test
-    void sendMDNShouldIndicateMissingFields() {
-        String creationId = "creation-1";
-        // Missing subject
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                    "    \"messageId\":\"" + randomMessageId().serialize() + "\"," +
-                    "    \"textBody\":\"textBody\"," +
-                    "    \"reportingUA\":\"reportingUA\"," +
-                    "    \"disposition\":{" +
-                    "        \"actionMode\":\"automatic-action\"," +
-                    "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                    "        \"type\":\"processed\"" +
-                    "    }" +
-                    "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("problem: 'subject' is mandatory"));
-    }
-
-    @Test
-    void sendMDNShouldReturnMaxQuotaReachedWhenUserReachedHisQuota() throws MailboxException {
-        bartSendMessageToHomer();
-
-        List<String> messageIds = listMessageIdsForAccount(homerAccessToken);
-
-        QuotaProbe quotaProbe = jmapServer.getProbe(QuotaProbesImpl.class);
-        QuotaRoot inboxQuotaRoot = quotaProbe.getQuotaRoot(MailboxPath.inbox(HOMER));
-        quotaProbe.setMaxStorage(inboxQuotaRoot, QuotaSizeLimit.size(100));
-
-        MessageAppender.fillMailbox(jmapServer.getProbe(MailboxProbeImpl.class), HOMER.asString(), MailboxConstants.INBOX);
-
-        String creationId = "creation-1";
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                "    \"messageId\":\"" + messageIds.get(0) + "\"," +
-                "    \"subject\":\"subject\"," +
-                "    \"textBody\":\"textBody\"," +
-                "    \"reportingUA\":\"reportingUA\"," +
-                "    \"disposition\":{" +
-                "        \"actionMode\":\"automatic-action\"," +
-                "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                "        \"type\":\"processed\"" +
-                "    }" +
-                "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("messagesSet"))
-            .body(ARGUMENTS + ".MDNNotSent", hasEntry(
-                equalTo(creationId),
-                hasEntry("type", "maxQuotaReached")));
-    }
-
-    @Test
-    void sendMDNShouldIndicateMissingFieldsInDisposition() {
-        String creationId = "creation-1";
-        // Missing actionMode
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                "    \"messageId\":\"" + randomMessageId().serialize() + "\"," +
-                "    \"subject\":\"subject\"," +
-                "    \"textBody\":\"textBody\"," +
-                "    \"reportingUA\":\"reportingUA\"," +
-                "    \"disposition\":{" +
-                "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                "        \"type\":\"processed\"" +
-                "    }" +
-                "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("problem: 'actionMode' is mandatory"));
-    }
-
-    @Test
-    void invalidEnumValuesInMDNShouldBeReported() {
-        String creationId = "creation-1";
-        given()
-            .header("Authorization", homerAccessToken.asString())
-            .body("[[\"setMessages\", {\"sendMDN\": {" +
-                "\"" + creationId + "\":{" +
-                "    \"messageId\":\"" + randomMessageId().serialize() + "\"," +
-                "    \"subject\":\"subject\"," +
-                "    \"textBody\":\"textBody\"," +
-                "    \"reportingUA\":\"reportingUA\"," +
-                "    \"disposition\":{" +
-                "        \"actionMode\":\"invalid\"," +
-                "        \"sendingMode\":\"MDN-sent-automatically\"," +
-                "        \"type\":\"processed\"" +
-                "    }" +
-                "}" +
-                "}}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .log().ifValidationFails()
-            .statusCode(200)
-            .body(NAME, equalTo("error"))
-            .body(ARGUMENTS + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".description", containsString("Unrecognized MDN Disposition action mode invalid. Should be one of [manual-action, automatic-action]"));
-    }
-
-}
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMailboxesMethodTest.java
deleted file mode 100644
index 1c0c72c47a..0000000000
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMailboxesMethodTest.java
+++ /dev/null
@@ -1,2439 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods.integration;
-
-import static io.restassured.RestAssured.given;
-import static io.restassured.RestAssured.with;
-import static io.restassured.http.ContentType.JSON;
-import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
-import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS;
-import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
-import static org.apache.james.jmap.JMAPTestingConstants.FIRST_MAILBOX;
-import static org.apache.james.jmap.JMAPTestingConstants.NAME;
-import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
-import static org.apache.james.jmap.JmapURIBuilder.baseUri;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasEntry;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.hasKey;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.collection.IsMapWithSize.aMapWithSize;
-
-import java.io.IOException;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.james.GuiceJamesServer;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.AccessToken;
-import org.apache.james.jmap.categories.CassandraAndOpenSearchCategory;
-import org.apache.james.jmap.JmapGuiceProbe;
-import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.mailbox.DefaultMailboxes;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.model.MailboxACL;
-import org.apache.james.mailbox.model.MailboxACL.Right;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.probe.MailboxProbe;
-import org.apache.james.modules.ACLProbeImpl;
-import org.apache.james.modules.MailboxProbeImpl;
-import org.apache.james.probe.DataProbe;
-import org.apache.james.utils.DataProbeImpl;
-import org.hamcrest.Matchers;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-import io.restassured.RestAssured;
-import io.restassured.response.Response;
-
-public abstract class SetMailboxesMethodTest {
-
-    private static final String ADMINISTER = String.valueOf(Right.Administer.asCharacter());
-    private static final String WRITE = String.valueOf(Right.Write.asCharacter());
-    private static final String DELETE_MESSAGES = String.valueOf(Right.DeleteMessages.asCharacter());
-
-    private static final int MAILBOX_NAME_LENGTH_64K = 65536;
-    private MailboxId draftId;
-    private MailboxId outboxId;
-
-    protected abstract GuiceJamesServer createJmapServer() throws IOException;
-
-    private AccessToken accessToken;
-    private Username username;
-    private GuiceJamesServer jmapServer;
-    private MailboxProbe mailboxProbe;
-    private MailboxId inboxId;
-
-    @Before
-    public void setup() throws Throwable {
-        jmapServer = createJmapServer();
-        jmapServer.start();
-        mailboxProbe = jmapServer.getProbe(MailboxProbeImpl.class);
-        DataProbe dataProbe = jmapServer.getProbe(DataProbeImpl.class);
-        
-        RestAssured.requestSpecification = jmapRequestSpecBuilder
-                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
-                .build();
-        RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
-
-        username = Username.of("username@" + DOMAIN);
-        String password = "password";
-        dataProbe.addDomain(DOMAIN);
-        dataProbe.addUser(username.asString(), password);
-        inboxId = mailboxProbe.createMailbox("#private", username.asString(), DefaultMailboxes.INBOX);
-        outboxId = mailboxProbe.createMailbox("#private", username.asString(), DefaultMailboxes.OUTBOX);
-        mailboxProbe.createMailbox("#private", username.asString(), DefaultMailboxes.TRASH);
-        mailboxProbe.createMailbox("#private", username.asString(), DefaultMailboxes.SENT);
-        draftId = mailboxProbe.createMailbox("#private", username.asString(), DefaultMailboxes.DRAFTS);
-        accessToken = authenticateJamesUser(baseUri(jmapServer), username, password);
-    }
-
-    @After
-    public void teardown() {
-        jmapServer.stop();
-    }
-
-    @Test
-    @Category(CassandraAndOpenSearchCategory.class)
-    public void setMailboxesShouldNotCreateWhenOverLimitName() {
-        String overLimitName = StringUtils.repeat("a", MAILBOX_NAME_LENGTH_64K);
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"create\": {" +
-                "        \"create-id01\" : {" +
-                "          \"name\" : \"" + overLimitName + "\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notCreated", aMapWithSize(1))
-            .body(ARGUMENTS + ".notCreated", hasEntry(equalTo("create-id01"), Matchers.allOf(
-                    hasEntry(equalTo("type"), equalTo("invalidArguments")),
-                    hasEntry(equalTo("description"), equalTo("The mailbox name length is too long")))));
-    }
-
-    @Test
-    @Category(CassandraAndOpenSearchCategory.class)
-    public void setMailboxesShouldNotUpdateMailboxWhenOverLimitName() {
-        String overLimitName = StringUtils.repeat("a", MAILBOX_NAME_LENGTH_64K);
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username.asString(), "myBox");
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"update\": {" +
-                "        \"" + mailboxId.serialize() + "\" : {" +
-                "          \"name\" : \"" + overLimitName + "\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notUpdated", aMapWithSize(1))
-            .body(ARGUMENTS + ".notUpdated", hasEntry(equalTo(mailboxId.serialize()), Matchers.allOf(
-                    hasEntry(equalTo("type"), equalTo("invalidArguments")),
-                    hasEntry(equalTo("description"), equalTo("The mailbox name length is too long")))));
-    }
-
-    @Test
-    public void setMailboxesCreateShouldFailWhenOverLimitName() {
-        String overLimitName = StringUtils.repeat("a", MailboxManager.MAX_MAILBOX_NAME_LENGTH + 1);
-        String creationId = "create-id01";
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"create\": {" +
-                "        \"" + creationId + "\" : {" +
-                "          \"name\" : \"" + overLimitName + "\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notCreated", hasKey(creationId))
-            .body(ARGUMENTS + ".notCreated." + creationId + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".notCreated." + creationId + ".description", is("The mailbox name length is too long"));
-    }
-
-    @Test
-    public void setMailboxesCreateShouldFailWhenBlankName() {
-        String creationId = "create-id01";
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"create\": {" +
-                "        \"" + creationId + "\" : {" +
-                "          \"name\" : \"        \"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notCreated", hasKey(creationId))
-            .body(ARGUMENTS + ".notCreated." + creationId + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".notCreated." + creationId + ".description", is("'#private:username@domain.tld:        ' has an empty part within its mailbox name considering . as a delimiter"));
-    }
-
-    @Test
-    public void setMailboxesUpdateShouldFailWhenOverLimitName() throws Exception {
-        String overLimitName = StringUtils.repeat("a", MailboxManager.MAX_MAILBOX_NAME_LENGTH + 1);
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username.asString(), "myBox");
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"update\": {" +
-                "        \"" + mailboxId.serialize() + "\" : {" +
-                "          \"name\" : \"" + overLimitName + "\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notUpdated", hasKey(mailboxId.serialize()))
-            .body(ARGUMENTS + ".notUpdated." + mailboxId.serialize() + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".notUpdated." + mailboxId.serialize() + ".description", is("The mailbox name length is too long"));
-
-        assertThat(mailboxProbe.listSubscriptions(username.asString())).doesNotContain(overLimitName);
-    }
-
-    @Test
-    public void setMailboxesUpdateShouldFailWhenBlankName() throws Exception {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username.asString(), "myBox");
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"update\": {" +
-                "        \"" + mailboxId.serialize() + "\" : {" +
-                "          \"name\" : \"    \"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notUpdated", hasKey(mailboxId.serialize()))
-            .body(ARGUMENTS + ".notUpdated." + mailboxId.serialize() + ".type", is("invalidArguments"))
-            .body(ARGUMENTS + ".notUpdated." + mailboxId.serialize() + ".description", is("'#private:username@domain.tld:    ' has an empty part within its mailbox name considering . as a delimiter"));
-
-        assertThat(mailboxProbe.listSubscriptions(username.asString())).doesNotContain("    ");
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void userShouldBeSubscribedOnCreatedMailboxWhenCreateMailbox() throws Exception {
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"create\": {" +
-                "        \"create-id01\" : {" +
-                "          \"name\" : \"foo\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".created", hasKey("create-id01"));
-
-        assertThat(mailboxProbe.listSubscriptions(username.asString())).contains("foo");
-    }
-
-    @Category(BasicFeature.class)
-    @Test
-    public void userShouldGetAnErrorWhenNotBeAbleToCreateACaseVariationOfINBOX() throws Exception {
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"create\": {" +
-                "        \"create-id01\" : {" +
-                "          \"name\" : \"iNbOx\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxesSet"))
-            .body(ARGUMENTS + ".notCreated", hasKey("create-id01"))
-            .body(ARGUMENTS + ".notCreated.create-id01.type", equalTo("invalidArguments"))
-            .body(ARGUMENTS + ".notCreated.create-id01.description", equalTo("The mailbox 'iNbOx' already exists as 'INBOX'"));
-
-        assertThat(mailboxProbe.listUserMailboxes(username.asString())).doesNotContain("iNbOx");
-    }
-
-    @Test
-    public void userShouldBeSubscribedOnCreatedMailboxWhenCreateChildOfInboxMailbox() throws Exception {
-        MailboxId inboxId = mailboxProbe.getMailboxId(MailboxConstants.USER_NAMESPACE, username.asString(), MailboxConstants.INBOX);
-
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"create\": {" +
-                "        \"create-id01\" : {" +
-                "          \"name\" : \"foo\"," +
-                "          \"parentId\" : \"" + inboxId.serialize() + "\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-
-        given()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-        .when()
-            .post("/jmap");
-
-        assertThat(mailboxProbe.listSubscriptions(username.asString())).contains(DefaultMailboxes.INBOX + ".foo");
-    }
-
-    @Test
-    public void subscriptionUserShouldBeChangedWhenUpdateMailbox() throws Exception {
-        String initialMailboxName = "myBox";
-        String mailboxId = createMailBoxThroughJMAP(initialMailboxName);
-
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"update\": {" +
-                "        \"" + mailboxId + "\" : {" +
-                "          \"name\" : \"mySecondBox\"" +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-        with()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        assertThat(mailboxProbe.listSubscriptions(username.asString()))
-            .contains("mySecondBox")
-            .doesNotContain(initialMailboxName);
-    }
-
-    @Test
-    public void subscriptionUserShouldBeChangedWhenUpdateParentMailbox() throws Exception {
-        MailboxId parentId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username.asString(), "root");
-
-        String secondMailboxName = "second";
-        String secondMailboxId = createSubMailBox(parentId.serialize(), secondMailboxName);
-
-        String thirdMailBoxName = "third";
-        String thirdMailboxId = createSubMailBox(secondMailboxId, thirdMailBoxName);
-
-        String fourthMailboxName = "fourth";
-        createSubMailBox(thirdMailboxId, fourthMailboxName);
-
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"update\": {" +
-                "        \"" + thirdMailboxId + "\" : {" +
-                "          \"name\" : \"thirdtest\" ,"  +
-                "          \"parentId\" : \"" + secondMailboxId + "\""  +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
-        with()
-            .header("Authorization", accessToken.asString())
-            .body(requestBody)
-            .post("/jmap");
-
-        assertThat(mailboxProbe.listSubscriptions(username.asString()))
-            .contains("root.second.thirdtest.fourth")
-            .doesNotContain("root.second.third.fourth");
-    }
-
-    @Test
-    public void subscriptionUserShouldBeChangedForAllChildrenWhenUpdateParentMailbox() throws Exception {
-        MailboxId parentId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, username.asString(), "root");
-
-        String secondMailboxName = "second";
-        String secondMailboxId = createSubMailBox(parentId.serialize(), secondMailboxName);
-
-        String thirdMailBoxName = "third";
-        String thirdMailboxId = createSubMailBox(secondMailboxId, thirdMailBoxName);
-
-        String fourthMailboxName = "fourth";
-        createSubMailBox(thirdMailboxId, fourthMailboxName);
-
-        String requestBody =
-            "[" +
-                "  [ \"setMailboxes\"," +
-                "    {" +
-                "      \"update\": {" +
-                "        \"" + secondMailboxId + "\" : {" +
-                "          \"name\" : \"secondtest\" ,"  +
-                "          \"parentId\" : \"" + parentId.serialize() + "\""  +
-                "        }" +
-                "      }" +
-                "    }," +
-                "    \"#0\"" +
-                "  ]" +
-                "]";
... 22986 lines suppressed ...


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


(james-project) 03/10: JAMES-4025 Drop JMAP draft guice binding

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

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

commit d176f771548a72ab946e7c8cb19c816d4fa177a0
Author: Tung Tran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Drop JMAP draft guice binding
---
 server/container/guice/protocols/jmap/pom.xml      |   6 +-
 .../java/org/apache/james/jmap/JMAPModule.java     |  38 ++----
 .../james/jmap/JMAPWithoutDraftCommonModule.java   |   7 ++
 .../james/jmap/draft/DraftMethodsModule.java       | 127 ---------------------
 .../jmap/draft/JMAPConfigurationStartUpCheck.java  |  75 ------------
 .../james/jmap/draft/JMAPDraftCommonModule.java    |  80 -------------
 .../jmap/draft/JmapConfigurationSanitizer.java     |  66 -----------
 .../james/modules/protocols/JMAPServerModule.java  |  25 +---
 .../apache/james/modules/TestJMAPServerModule.java |  40 +------
 9 files changed, 25 insertions(+), 439 deletions(-)

diff --git a/server/container/guice/protocols/jmap/pom.xml b/server/container/guice/protocols/jmap/pom.xml
index 58bd487a4c..ace63a7dd4 100644
--- a/server/container/guice/protocols/jmap/pom.xml
+++ b/server/container/guice/protocols/jmap/pom.xml
@@ -29,7 +29,7 @@
     <artifactId>james-server-guice-jmap</artifactId>
 
     <name>Apache James :: Server :: Guice :: JMAP</name>
-    <description>JMAP (draft and RFC8621) modules for Guice implementation of James server</description>
+    <description>JMAP RFC8621 modules for Guice implementation of James server</description>
 
     <dependencies>
         <dependency>
@@ -57,10 +57,6 @@
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-mailet</artifactId>
         </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-draft</artifactId>
-        </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-jmap-rfc-8621</artifactId>
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
index 7f7ff399c2..741d05ae82 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -19,7 +19,6 @@
 package org.apache.james.jmap;
 
 import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.time.Clock;
 import java.util.EnumSet;
@@ -47,10 +46,6 @@ import org.apache.james.jmap.core.SharesCapabilityFactory$;
 import org.apache.james.jmap.core.SubmissionCapabilityFactory;
 import org.apache.james.jmap.core.VacationResponseCapabilityFactory$;
 import org.apache.james.jmap.core.WebSocketCapabilityFactory$;
-import org.apache.james.jmap.draft.DraftMethodsModule;
-import org.apache.james.jmap.draft.JMAPDraftCommonModule;
-import org.apache.james.jmap.draft.JMAPDraftConfiguration;
-import org.apache.james.jmap.draft.methods.RequestHandler;
 import org.apache.james.jmap.mailet.filter.JMAPFiltering;
 import org.apache.james.jmap.rfc8621.RFC8621MethodsModule;
 import org.apache.james.jmap.send.PostDequeueDecoratorFactory;
@@ -120,16 +115,13 @@ public class JMAPModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        install(new JMAPDraftCommonModule());
         install(new JMAPWithoutDraftCommonModule());
-        install(new DraftMethodsModule());
         install(new RFC8621MethodsModule());
         install(binder -> binder
             .bind(MailetContainerModule.DefaultProcessorsConfigurationSupplier.class)
             .toInstance(DEFAULT_JMAP_PROCESSORS_CONFIGURATION_SUPPLIER));
 
         bind(JMAPServer.class).in(Scopes.SINGLETON);
-        bind(RequestHandler.class).in(Scopes.SINGLETON);
         bind(JsoupHtmlTextExtractor.class).in(Scopes.SINGLETON);
 
         bind(HtmlTextExtractor.class).to(JsoupHtmlTextExtractor.class);
@@ -228,35 +220,19 @@ public class JMAPModule extends AbstractModule {
 
     @Provides
     @Singleton
-    JMAPDraftConfiguration provideDraftConfiguration(PropertiesProvider propertiesProvider, FileSystem fileSystem) throws ConfigurationException, IOException {
+    @Named("jmap")
+    JwtTokenVerifier providesJwtTokenVerifier(PropertiesProvider propertiesProvider, FileSystem fileSystem) throws ConfigurationException {
         try {
             Configuration configuration = propertiesProvider.getConfiguration("jmap");
-            return JMAPDraftConfiguration.builder()
-                .enabled(configuration.getBoolean("enabled", true))
-                .keystore(configuration.getString("tls.keystoreURL", null))
-                .privateKey(configuration.getString("tls.privateKey", null))
-                .certificates(configuration.getString("tls.certificates", null))
-                .keystoreType(configuration.getString("tls.keystoreType", null))
-                .secret(configuration.getString("tls.secret", null))
-                .jwtPublicKeyPem(loadPublicKey(fileSystem, ImmutableList.copyOf(configuration.getStringArray("jwt.publickeypem.url"))))
-                .authenticationStrategies(Optional.ofNullable(configuration.getList(String.class, "authentication.strategy.draft", null)))
-                .build();
+            List<String> loadedPublicKey = loadPublicKey(fileSystem, ImmutableList.copyOf(configuration.getStringArray("jwt.publickeypem.url")));
+            JwtConfiguration jwtConfiguration = new JwtConfiguration(loadedPublicKey);
+            return JwtTokenVerifier.create(jwtConfiguration);
         } catch (FileNotFoundException e) {
-            LOGGER.warn("Could not find JMAP configuration file. JMAP server will not be enabled.");
-            return JMAPDraftConfiguration.builder()
-                .disable()
-                .build();
+            LOGGER.warn("Could not find JMAP configuration file. JwtTokenVerifier was initialized with empty public key ");
+            return JwtTokenVerifier.create(new JwtConfiguration(List.of()));
         }
     }
 
-    @Provides
-    @Singleton
-    @Named("jmap")
-    JwtTokenVerifier providesJwtTokenVerifier(JMAPDraftConfiguration jmapConfiguration) {
-        JwtConfiguration jwtConfiguration = new JwtConfiguration(jmapConfiguration.getJwtPublicKeyPem());
-        return JwtTokenVerifier.create(jwtConfiguration);
-    }
-
     private List<String> loadPublicKey(FileSystem fileSystem, List<String> jwtPublickeyPemUrl) {
         return jwtPublickeyPemUrl.stream()
             .map(Throwing.function(url -> FileUtils.readFileToString(fileSystem.getFile(url), StandardCharsets.US_ASCII)))
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
index 4bef219409..3e645f75b5 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
@@ -19,6 +19,9 @@
 
 package org.apache.james.jmap;
 
+import java.util.concurrent.TimeUnit;
+
+import org.apache.james.jmap.api.access.AccessTokenRepository;
 import org.apache.james.jmap.json.ObjectMapperFactory;
 import org.apache.james.jmap.methods.BlobManager;
 import org.apache.james.jmap.methods.BlobManagerImpl;
@@ -34,8 +37,10 @@ import org.apache.james.util.mime.MessageContentExtractor;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Scopes;
+import com.google.inject.name.Names;
 
 public class JMAPWithoutDraftCommonModule extends AbstractModule {
+    private static final long DEFAULT_TOKEN_EXPIRATION_IN_MS = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES);
 
     @Override
     protected void configure() {
@@ -53,5 +58,7 @@ public class JMAPWithoutDraftCommonModule extends AbstractModule {
         bind(ObjectMapperFactory.class).in(Scopes.SINGLETON);
         bind(JmapResponseWriterImpl.class).in(Scopes.SINGLETON);
         bind(JmapResponseWriter.class).to(JmapResponseWriterImpl.class);
+
+        bindConstant().annotatedWith(Names.named(AccessTokenRepository.TOKEN_EXPIRATION_IN_MS)).to(DEFAULT_TOKEN_EXPIRATION_IN_MS);
     }
 }
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/DraftMethodsModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/DraftMethodsModule.java
deleted file mode 100644
index e9ccbb2866..0000000000
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/DraftMethodsModule.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft;
-
-import java.util.List;
-import java.util.Set;
-
-import org.apache.james.jmap.draft.methods.GetFilterMethod;
-import org.apache.james.jmap.draft.methods.GetMailboxesMethod;
-import org.apache.james.jmap.draft.methods.GetMessageListMethod;
-import org.apache.james.jmap.draft.methods.GetMessagesMethod;
-import org.apache.james.jmap.draft.methods.GetVacationResponseMethod;
-import org.apache.james.jmap.draft.methods.JmapRequestParser;
-import org.apache.james.jmap.draft.methods.JmapRequestParserImpl;
-import org.apache.james.jmap.draft.methods.SendMDNProcessor;
-import org.apache.james.jmap.draft.methods.SetFilterMethod;
-import org.apache.james.jmap.draft.methods.SetMailboxesCreationProcessor;
-import org.apache.james.jmap.draft.methods.SetMailboxesDestructionProcessor;
-import org.apache.james.jmap.draft.methods.SetMailboxesMethod;
-import org.apache.james.jmap.draft.methods.SetMailboxesProcessor;
-import org.apache.james.jmap.draft.methods.SetMailboxesUpdateProcessor;
-import org.apache.james.jmap.draft.methods.SetMessagesCreationProcessor;
-import org.apache.james.jmap.draft.methods.SetMessagesDestructionProcessor;
-import org.apache.james.jmap.draft.methods.SetMessagesMethod;
-import org.apache.james.jmap.draft.methods.SetMessagesProcessor;
-import org.apache.james.jmap.draft.methods.SetMessagesUpdateProcessor;
-import org.apache.james.jmap.draft.methods.SetVacationResponseMethod;
-import org.apache.james.jmap.http.AccessTokenAuthenticationStrategy;
-import org.apache.james.jmap.http.AuthenticationStrategy;
-import org.apache.james.jmap.http.Authenticator;
-import org.apache.james.jmap.http.InjectionKeys;
-import org.apache.james.jmap.http.JWTAuthenticationStrategy;
-import org.apache.james.jmap.http.QueryParameterAccessTokenAuthenticationStrategy;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.utils.ClassName;
-import org.apache.james.utils.GuiceGenericLoader;
-import org.apache.james.utils.NamingScheme;
-import org.apache.james.utils.PackageName;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-import com.google.inject.Scopes;
-import com.google.inject.Singleton;
-import com.google.inject.multibindings.Multibinder;
-import com.google.inject.name.Named;
-import com.google.inject.name.Names;
-
-public class DraftMethodsModule extends AbstractModule {
-    private static PackageName IMPLICIT_AUTHENTICATION_STRATEGY_FQDN_PREFIX = PackageName.of("org.apache.james.jmap.http");
-    private static List<String> DEFAULT_AUTHENTICATION_STRATEGIES = ImmutableList.of(AccessTokenAuthenticationStrategy.class.getSimpleName(),
-        JWTAuthenticationStrategy.class.getSimpleName(),
-        QueryParameterAccessTokenAuthenticationStrategy.class.getSimpleName());
-
-    @Override
-    protected void configure() {
-        bind(JmapRequestParserImpl.class).in(Scopes.SINGLETON);
-        bind(JmapRequestParser.class).to(JmapRequestParserImpl.class);
-
-        bindConstant().annotatedWith(Names.named(GetMessageListMethod.MAXIMUM_LIMIT)).to(GetMessageListMethod.DEFAULT_MAXIMUM_LIMIT);
-
-        Multibinder<Method> methods = Multibinder.newSetBinder(binder(), Method.class);
-        methods.addBinding().to(GetMailboxesMethod.class);
-        methods.addBinding().to(GetMessageListMethod.class);
-        methods.addBinding().to(GetMessagesMethod.class);
-        methods.addBinding().to(SetMessagesMethod.class);
-        methods.addBinding().to(SetMailboxesMethod.class);
-        methods.addBinding().to(GetVacationResponseMethod.class);
-        methods.addBinding().to(SetVacationResponseMethod.class);
-        methods.addBinding().to(GetFilterMethod.class);
-        methods.addBinding().to(SetFilterMethod.class);
-
-        Multibinder<SetMailboxesProcessor> setMailboxesProcessor =
-            Multibinder.newSetBinder(binder(), SetMailboxesProcessor.class);
-        setMailboxesProcessor.addBinding().to(SetMailboxesCreationProcessor.class);
-        setMailboxesProcessor.addBinding().to(SetMailboxesUpdateProcessor.class);
-        setMailboxesProcessor.addBinding().to(SetMailboxesDestructionProcessor.class);
-
-        Multibinder<SetMessagesProcessor> setMessagesProcessors =
-                Multibinder.newSetBinder(binder(), SetMessagesProcessor.class);
-        setMessagesProcessors.addBinding().to(SetMessagesUpdateProcessor.class);
-        setMessagesProcessors.addBinding().to(SetMessagesCreationProcessor.class);
-        setMessagesProcessors.addBinding().to(SetMessagesDestructionProcessor.class);
-        setMessagesProcessors.addBinding().to(SendMDNProcessor.class);
-    }
-
-    @Provides
-    @Named(InjectionKeys.DRAFT)
-    Authenticator provideAuthenticator(MetricFactory metricFactory,
-                                       @Named("draftJmapAuthenticationStrategies") Set<AuthenticationStrategy> strategies) {
-        return Authenticator.of(metricFactory, strategies);
-    }
-
-    @Provides
-    @Singleton
-    @Named("draftJmapAuthenticationStrategies")
-    public Set<AuthenticationStrategy> provideAuthenticationStrategies(GuiceGenericLoader loader,
-                                                                       JMAPDraftConfiguration configuration) {
-        return configuration.getAuthenticationStrategies()
-            .orElse(DEFAULT_AUTHENTICATION_STRATEGIES)
-            .stream()
-            .map(ClassName::new)
-            .map(Throwing.function(loader.<AuthenticationStrategy>withNamingSheme(
-                new NamingScheme.OptionalPackagePrefix(IMPLICIT_AUTHENTICATION_STRATEGY_FQDN_PREFIX))::instantiate))
-            .collect(ImmutableSet.toImmutableSet());
-    }
-}
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPConfigurationStartUpCheck.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPConfigurationStartUpCheck.java
deleted file mode 100644
index 30766ed647..0000000000
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPConfigurationStartUpCheck.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.crypto.SecurityKeyLoader;
-import org.apache.james.lifecycle.api.StartUpCheck;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JMAPConfigurationStartUpCheck implements StartUpCheck {
-    private static final Logger LOGGER = LoggerFactory.getLogger(JMAPConfigurationStartUpCheck.class);
-    public static final String CHECK_NAME = "JMAPConfigurationStartUpCheck";
-
-    private final SecurityKeyLoader securityKeyLoader;
-    private final JMAPDraftConfiguration jmapConfiguration;
-
-    @Inject
-    JMAPConfigurationStartUpCheck(SecurityKeyLoader securityKeyLoader, JMAPDraftConfiguration jmapConfiguration) {
-        this.securityKeyLoader = securityKeyLoader;
-        this.jmapConfiguration = jmapConfiguration;
-    }
-
-    @Override
-    public CheckResult check() {
-        if (jmapConfiguration.isEnabled()) {
-            return checkSecurityKey();
-        }
-
-        return CheckResult.builder()
-            .checkName(checkName())
-            .resultType(ResultType.GOOD)
-            .build();
-    }
-
-    private CheckResult checkSecurityKey() {
-        try {
-            securityKeyLoader.load();
-            return CheckResult.builder()
-                .checkName(checkName())
-                .resultType(ResultType.GOOD)
-                .build();
-        } catch (Exception e) {
-            LOGGER.error("Cannot load security key from jmap configuration", e);
-            return CheckResult.builder()
-                .checkName(checkName())
-                .resultType(ResultType.BAD)
-                .description(e.getMessage())
-                .build();
-        }
-    }
-
-    @Override
-    public String checkName() {
-        return CHECK_NAME;
-    }
-}
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPDraftCommonModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPDraftCommonModule.java
deleted file mode 100644
index 5b4f147ff6..0000000000
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPDraftCommonModule.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.draft.api.AccessTokenManager;
-import org.apache.james.jmap.draft.api.SimpleTokenFactory;
-import org.apache.james.jmap.draft.api.SimpleTokenManager;
-import org.apache.james.jmap.draft.crypto.AccessTokenManagerImpl;
-import org.apache.james.jmap.draft.crypto.JamesSignatureHandler;
-import org.apache.james.jmap.draft.crypto.SecurityKeyLoader;
-import org.apache.james.jmap.draft.crypto.SignatureHandler;
-import org.apache.james.jmap.draft.crypto.SignedTokenFactory;
-import org.apache.james.jmap.draft.crypto.SignedTokenManager;
-import org.apache.james.jmap.draft.model.MailboxFactory;
-import org.apache.james.jmap.draft.send.MailSpool;
-import org.apache.james.lifecycle.api.ConfigurationSanitizer;
-import org.apache.james.lifecycle.api.StartUpCheck;
-import org.apache.james.utils.InitializationOperation;
-import org.apache.james.utils.InitilizationOperationBuilder;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
-import com.google.inject.multibindings.Multibinder;
-import com.google.inject.multibindings.ProvidesIntoSet;
-import com.google.inject.name.Names;
-
-public class JMAPDraftCommonModule extends AbstractModule {
-    
-    private static final long DEFAULT_TOKEN_EXPIRATION_IN_MS = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES);
-
-    @Override
-    protected void configure() {
-        bind(JamesSignatureHandler.class).in(Scopes.SINGLETON);
-        bind(SignedTokenManager.class).in(Scopes.SINGLETON);
-        bind(AccessTokenManagerImpl.class).in(Scopes.SINGLETON);
-        bind(MailSpool.class).in(Scopes.SINGLETON);
-        bind(MailboxFactory.class).in(Scopes.SINGLETON);
-        bind(SecurityKeyLoader.class).in(Scopes.SINGLETON);
-
-        bind(SignatureHandler.class).to(JamesSignatureHandler.class);
-
-        bind(SimpleTokenManager.class).to(SignedTokenManager.class);
-        bind(SimpleTokenFactory.class).to(SignedTokenFactory.class);
-
-        bindConstant().annotatedWith(Names.named(AccessTokenRepository.TOKEN_EXPIRATION_IN_MS)).to(DEFAULT_TOKEN_EXPIRATION_IN_MS);
-        bind(AccessTokenManager.class).to(AccessTokenManagerImpl.class);
-
-        Multibinder.newSetBinder(binder(), StartUpCheck.class)
-            .addBinding().to(JMAPConfigurationStartUpCheck.class);
-
-        Multibinder.newSetBinder(binder(), ConfigurationSanitizer.class)
-            .addBinding().to(JmapConfigurationSanitizer.class);
-    }
-
-    @ProvidesIntoSet
-    InitializationOperation workQueue(MailSpool instance) {
-        return InitilizationOperationBuilder
-            .forClass(MailSpool.class)
-            .init(instance::start);
-    }
-}
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapConfigurationSanitizer.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapConfigurationSanitizer.java
deleted file mode 100644
index c63e114dfb..0000000000
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JmapConfigurationSanitizer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft;
-
-import java.io.FileNotFoundException;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.RunArguments;
-import org.apache.james.filesystem.api.FileSystem;
-import org.apache.james.lifecycle.api.ConfigurationSanitizer;
-import org.apache.james.utils.KeystoreCreator;
-
-public class JmapConfigurationSanitizer implements ConfigurationSanitizer {
-    private final JMAPDraftConfiguration jmapDraftConfiguration;
-    private final KeystoreCreator keystoreCreator;
-    private final FileSystem fileSystem;
-    private final RunArguments runArguments;
-
-    @Inject
-    public JmapConfigurationSanitizer(JMAPDraftConfiguration jmapDraftConfiguration, KeystoreCreator keystoreCreator, FileSystem fileSystem, RunArguments runArguments) {
-        this.jmapDraftConfiguration = jmapDraftConfiguration;
-        this.keystoreCreator = keystoreCreator;
-        this.fileSystem = fileSystem;
-        this.runArguments = runArguments;
-    }
-
-    @Override
-    public void sanitize() throws Exception {
-        if (jmapDraftConfiguration.isEnabled()
-            && jmapDraftConfiguration.getKeystore().isPresent()
-            && !keystoreExists()
-            && runArguments.contain(RunArguments.Argument.GENERATE_KEYSTORE)) {
-
-            keystoreCreator.generateKeystore(jmapDraftConfiguration.getKeystore().get(),
-                jmapDraftConfiguration.getSecret()
-                    .orElseThrow(() -> new IllegalArgumentException("Can not auto-generate keystore as the keystore secret is missing from the configuration")),
-                jmapDraftConfiguration.getKeystoreType());
-        }
-    }
-
-    private boolean keystoreExists() {
-        try {
-            return fileSystem.getFile(jmapDraftConfiguration.getKeystore().get()).exists();
-        } catch (FileNotFoundException e) {
-            return false;
-        }
-    }
-}
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
index a0d03712f7..637f0a6534 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
@@ -23,16 +23,10 @@ import java.security.Security;
 
 import org.apache.james.jmap.JMAPConfiguration;
 import org.apache.james.jmap.JMAPModule;
-import org.apache.james.jmap.JMAPRoutesHandler;
 import org.apache.james.jmap.JMAPServer;
 import org.apache.james.jmap.JmapGuiceProbe;
 import org.apache.james.jmap.MessageIdProbe;
-import org.apache.james.jmap.Version;
-import org.apache.james.jmap.draft.crypto.JamesSignatureHandler;
-import org.apache.james.jmap.http.AuthenticationRoutes;
-import org.apache.james.jmap.http.DownloadRoutes;
-import org.apache.james.jmap.http.JMAPApiRoutes;
-import org.apache.james.jmap.http.UploadRoutes;
+import org.apache.james.jmap.methods.Method;
 import org.apache.james.utils.GuiceProbe;
 import org.apache.james.utils.InitializationOperation;
 import org.apache.james.utils.InitilizationOperationBuilder;
@@ -49,33 +43,22 @@ public class JMAPServerModule extends AbstractModule {
         install(new JMAPModule());
         Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(JmapGuiceProbe.class);
         Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(MessageIdProbe.class);
+
+        Multibinder.newSetBinder(binder(), Method.class);
     }
 
     @ProvidesIntoSet
-    InitializationOperation startJmap(JMAPServer server, JamesSignatureHandler signatureHandler, JMAPConfiguration jmapConfiguration) {
+    InitializationOperation startJmap(JMAPServer server, JMAPConfiguration jmapConfiguration) {
         return InitilizationOperationBuilder
             .forClass(JMAPServer.class)
             .init(() -> {
                 if (jmapConfiguration.isEnabled()) {
-                    signatureHandler.init();
                     server.start();
                     registerPEMWithSecurityProvider();
                 }
             });
     }
 
-    @ProvidesIntoSet
-    JMAPRoutesHandler routesHandler(AuthenticationRoutes authenticationRoutes,
-                                    JMAPApiRoutes jmapApiRoutes,
-                                    UploadRoutes uploadRoutes,
-                                    DownloadRoutes  downloadRoutes) {
-        return new JMAPRoutesHandler(Version.DRAFT,
-            authenticationRoutes,
-            jmapApiRoutes,
-            uploadRoutes,
-            downloadRoutes);
-    }
-
     private void registerPEMWithSecurityProvider() {
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/modules/TestJMAPServerModule.java b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/modules/TestJMAPServerModule.java
index 9f4541f1a9..7b70263afc 100644
--- a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/modules/TestJMAPServerModule.java
+++ b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/modules/TestJMAPServerModule.java
@@ -22,41 +22,20 @@ package org.apache.james.modules;
 import java.io.FileNotFoundException;
 import java.util.Optional;
 
+import jakarta.inject.Named;
 import jakarta.inject.Singleton;
 
 import org.apache.commons.configuration2.ex.ConfigurationException;
 import org.apache.james.jmap.JMAPConfiguration;
-import org.apache.james.jmap.draft.JMAPDraftConfiguration;
-import org.apache.james.jmap.draft.methods.GetMessageListMethod;
-import org.apache.james.jmap.pushsubscription.PushClientConfiguration;
+import org.apache.james.jwt.JwtConfiguration;
+import org.apache.james.jwt.JwtTokenVerifier;
 import org.apache.james.modules.mailbox.FastRetryBackoffModule;
 
 import com.google.common.collect.ImmutableList;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
-import com.google.inject.name.Names;
 
 public class TestJMAPServerModule extends AbstractModule {
-    public static class SearchModule extends AbstractModule {
-        public static final long LIMIT_TO_3_MESSAGES = 3;
-
-        public static SearchModule maximumMessages(long maximumLimit) {
-            return new SearchModule(maximumLimit);
-        }
-
-        private final long maximumLimit;
-
-        public SearchModule(long maximumLimit) {
-            this.maximumLimit = maximumLimit;
-        }
-
-        @Override
-        protected void configure() {
-            bindConstant().annotatedWith(Names.named(GetMessageListMethod.MAXIMUM_LIMIT)).to(maximumLimit);
-
-            bind(PushClientConfiguration.class).toInstance(PushClientConfiguration.UNSAFE_DEFAULT());
-        }
-    }
 
     private static final String PUBLIC_PEM_KEY =
         "-----BEGIN PUBLIC KEY-----\n" +
@@ -101,14 +80,6 @@ public class TestJMAPServerModule extends AbstractModule {
             "ICQil1aaN7/2au+p7E4n7nzfYG7nRX5syDoqgBbdhpJxV8/5ohA=\n" +
             "-----END RSA PRIVATE KEY-----\n";
 
-    public static JMAPDraftConfiguration.Builder jmapDraftConfigurationBuilder() {
-        return JMAPDraftConfiguration.builder()
-                .enable()
-                .keystore("keystore")
-                .keystoreType("JKS")
-                .secret("james72laBalle")
-                .jwtPublicKeyPem(ImmutableList.of(PUBLIC_PEM_KEY));
-    }
 
     @Override
     protected void configure() {
@@ -128,7 +99,8 @@ public class TestJMAPServerModule extends AbstractModule {
 
     @Provides
     @Singleton
-    JMAPDraftConfiguration provideDraftConfiguration() throws FileNotFoundException, ConfigurationException {
-        return jmapDraftConfigurationBuilder().build();
+    @Named("jmap")
+    JwtTokenVerifier providesJwtTokenVerifier() {
+        return JwtTokenVerifier.create(new JwtConfiguration(ImmutableList.of(PUBLIC_PEM_KEY)));
     }
 }


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


(james-project) 10/10: JAMES-4025 Remove JMAP Version.DRAFT

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

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

commit 0a34f3c0dbb38546bd33a724c7009193fb5c4d51
Author: vttran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:03 2024 +0700

    JAMES-4025 Remove JMAP Version.DRAFT
---
 .../java/org/apache/james/jmap/JMAPModule.java     |  1 -
 .../james/jmap/routes/JMAPApiRoutesTest.scala      | 32 +---------------------
 .../james/jmap/routes/SessionRoutesTest.scala      |  2 +-
 .../org/apache/james/jmap/JMAPConfiguration.java   |  2 +-
 .../main/java/org/apache/james/jmap/Version.java   |  1 -
 .../apache/james/jmap/JMAPConfigurationTest.java   |  6 ++--
 .../java/org/apache/james/jmap/JMAPServerTest.java | 19 +++++++------
 .../org/apache/james/jmap/VersionParserTest.java   |  1 -
 8 files changed, 16 insertions(+), 48 deletions(-)

diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
index 741d05ae82..13b3931e01 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -130,7 +130,6 @@ public class JMAPModule extends AbstractModule {
         bind(MailQueueItemDecoratorFactory.class).to(PostDequeueDecoratorFactory.class).in(Scopes.SINGLETON);
 
         Multibinder<Version> supportedVersions = Multibinder.newSetBinder(binder(), Version.class);
-        supportedVersions.addBinding().toInstance(Version.DRAFT);
         supportedVersions.addBinding().toInstance(Version.RFC8621);
 
         Multibinder<CapabilityFactory> supportedCapabilities = Multibinder.newSetBinder(binder(), CapabilityFactory.class);
diff --git a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
index c41260a508..31103af0ff 100644
--- a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
+++ b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
@@ -59,7 +59,6 @@ import reactor.core.scala.publisher.SFlux
 object JMAPApiRoutesTest {
   private val TEST_CONFIGURATION: JMAPConfiguration = JMAPConfiguration.builder().enable().randomPort().build()
   private val ACCEPT_JMAP_VERSION_HEADER = "application/json; jmapVersion="
-  private val ACCEPT_DRAFT_VERSION_HEADER = ACCEPT_JMAP_VERSION_HEADER + Version.DRAFT.asString()
   private val ACCEPT_RFC8621_VERSION_HEADER = ACCEPT_JMAP_VERSION_HEADER + Version.RFC8621.asString()
 
   private val empty_set: ImmutableSet[PreDeletionHook] = ImmutableSet.of()
@@ -210,7 +209,7 @@ object JMAPApiRoutesTest {
       |  ]
       |}""".stripMargin
 
-  private val SUPPORTED_VERSIONS = ImmutableSet.of(Version.DRAFT, Version.RFC8621)
+  private val SUPPORTED_VERSIONS = ImmutableSet.of(Version.RFC8621)
 
   private val WRONG_OBJECT_REQUEST: String =
     """
@@ -347,35 +346,6 @@ class JMAPApiRoutesTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
     assertThatJson(response).isEqualTo(RESPONSE_OBJECT_WITH_UNSUPPORTED_METHOD)
   }
 
-  "Draft version, GET" should "return 404 status" in {
-    val headers: Headers = Headers.headers(
-      new Header(ACCEPT.toString, ACCEPT_DRAFT_VERSION_HEADER),
-      new Header("Authorization", s"Basic ${userBase64String}")
-    )
-
-    RestAssured
-      .`given`()
-        .headers(headers)
-      .when()
-        .get
-      .`then`
-        .statusCode(HttpStatus.SC_NOT_FOUND)
-  }
-
-  "Draft version, POST, without body" should "return 400 status" in {
-    val headers: Headers = Headers.headers(
-      new Header(ACCEPT.toString, ACCEPT_DRAFT_VERSION_HEADER),
-      new Header("Authorization", s"Basic ${userBase64String}")
-    )
-    RestAssured
-      .`given`()
-        .headers(headers)
-      .when()
-        .post
-      .`then`
-        .statusCode(HttpStatus.SC_NOT_FOUND)
-  }
-
   "RFC-8621 version, POST, with wrong requestObject body" should "return 400 status" in {
     val headers: Headers = Headers.headers(
       new Header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER),
diff --git a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/SessionRoutesTest.scala b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/SessionRoutesTest.scala
index 699f51dbab..3cb88e4124 100644
--- a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/SessionRoutesTest.scala
+++ b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/SessionRoutesTest.scala
@@ -78,7 +78,7 @@ class SessionRoutesTest extends AnyFlatSpec with BeforeAndAfter with Matchers {
     jmapServer = new JMAPServer(
       TEST_CONFIGURATION,
       Set(new JMAPRoutesHandler(Version.RFC8621, sessionRoutes)).asJava,
-      new VersionParser(Set(Version.RFC8621, Version.DRAFT).asJava, JMAPConfiguration.DEFAULT))
+      new VersionParser(Set(Version.RFC8621).asJava, JMAPConfiguration.DEFAULT))
     jmapServer.start()
 
     RestAssured.requestSpecification = new RequestSpecBuilder()
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPConfiguration.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPConfiguration.java
index 4ca7b96bec..7bfb1809cb 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPConfiguration.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPConfiguration.java
@@ -118,7 +118,7 @@ public class JMAPConfiguration {
             Preconditions.checkState(enabled.isPresent(), "You should specify if JMAP server should be started");
             return new JMAPConfiguration(enabled.get(), port, emailQueryViewEnabled.orElse(false),
                 userProvisioningEnabled.orElse(true),
-                defaultVersion.orElse(Version.DRAFT), maximumSendSize);
+                defaultVersion.orElse(Version.RFC8621), maximumSendSize);
         }
     }
 
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/Version.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/Version.java
index 5437789341..3b7d78bd53 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/Version.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/Version.java
@@ -22,7 +22,6 @@ package org.apache.james.jmap;
 import java.util.Objects;
 
 public class Version {
-    public static final Version DRAFT = new Version("draft");
     public static final Version RFC8621 = new Version("rfc-8621");
 
     public static Version of(String value) {
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPConfigurationTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPConfigurationTest.java
index 4a17270b0b..a027cdcc0a 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPConfigurationTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPConfigurationTest.java
@@ -41,7 +41,7 @@ class JMAPConfigurationTest {
 
     @Test
     void buildShouldWorkWhenRandomPort() {
-        JMAPConfiguration expectedJMAPConfiguration = new JMAPConfiguration(ENABLED, Optional.empty(), ENABLED, ENABLED, Version.DRAFT, Optional.empty());
+        JMAPConfiguration expectedJMAPConfiguration = new JMAPConfiguration(ENABLED, Optional.empty(), ENABLED, ENABLED, Version.RFC8621, Optional.empty());
 
         JMAPConfiguration jmapConfiguration = JMAPConfiguration.builder()
             .enable()
@@ -53,7 +53,7 @@ class JMAPConfigurationTest {
 
     @Test
     void buildShouldWorkWhenFixedPort() {
-        JMAPConfiguration expectedJMAPConfiguration = new JMAPConfiguration(ENABLED, Optional.of(Port.of(80)), ENABLED, ENABLED, Version.DRAFT, Optional.empty());
+        JMAPConfiguration expectedJMAPConfiguration = new JMAPConfiguration(ENABLED, Optional.of(Port.of(80)), ENABLED, ENABLED, Version.RFC8621, Optional.empty());
 
         JMAPConfiguration jmapConfiguration = JMAPConfiguration.builder()
             .enable()
@@ -67,7 +67,7 @@ class JMAPConfigurationTest {
 
     @Test
     void buildShouldWorkWhenDisabled() {
-        JMAPConfiguration expectedJMAPConfiguration = new JMAPConfiguration(DISABLED, Optional.empty(), DISABLED, DISABLED, Version.DRAFT, Optional.empty());
+        JMAPConfiguration expectedJMAPConfiguration = new JMAPConfiguration(DISABLED, Optional.empty(), DISABLED, DISABLED, Version.RFC8621, Optional.empty());
 
         JMAPConfiguration jmapConfiguration = JMAPConfiguration.builder()
             .disable()
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServerTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServerTest.java
index f856a126cb..a77295b932 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServerTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServerTest.java
@@ -50,8 +50,9 @@ import reactor.core.publisher.Mono;
 import reactor.netty.http.server.HttpServerResponse;
 
 class JMAPServerTest {
+    private static final Version DRAFT = new Version("draft");
     private static final String ACCEPT_JMAP_VERSION_HEADER = "application/json; jmapVersion=";
-    private static final String ACCEPT_DRAFT_VERSION_HEADER = ACCEPT_JMAP_VERSION_HEADER + Version.DRAFT.asString();
+    private static final String ACCEPT_DRAFT_VERSION_HEADER = ACCEPT_JMAP_VERSION_HEADER + DRAFT.asString();
     private static final String ACCEPT_RFC8621_VERSION_HEADER = ACCEPT_JMAP_VERSION_HEADER + Version.RFC8621.asString();
 
     private static final JMAPConfiguration DISABLED_CONFIGURATION = JMAPConfiguration.builder().disable().build();
@@ -72,9 +73,9 @@ class JMAPServerTest {
 
     private static final ImmutableSet<JMAPRoutesHandler> FAKE_ROUTES_HANDLERS = ImmutableSet.of(
         new JMAPRoutesHandler(
-            Version.DRAFT,
-            new FakeJMAPRoutes(AUTHENTICATION_ENDPOINTS, Version.DRAFT),
-            new FakeJMAPRoutes(JMAP_ENDPOINTS, Version.DRAFT)),
+            DRAFT,
+            new FakeJMAPRoutes(AUTHENTICATION_ENDPOINTS, DRAFT),
+            new FakeJMAPRoutes(JMAP_ENDPOINTS, DRAFT)),
         new JMAPRoutesHandler(
             Version.RFC8621,
             new FakeJMAPRoutes(AUTHENTICATION_ENDPOINTS, Version.RFC8621))
@@ -82,14 +83,14 @@ class JMAPServerTest {
 
     private static final ImmutableSet<JMAPRoutesHandler> CORS_ROUTES = ImmutableSet.of(
         new JMAPRoutesHandler(
-            Version.DRAFT,
-            new FakeJMAPRoutes(ImmutableSet.of(Endpoint.ofFixedPath(HttpMethod.OPTIONS, "/a")), Version.DRAFT)),
+            DRAFT,
+            new FakeJMAPRoutes(ImmutableSet.of(Endpoint.ofFixedPath(HttpMethod.OPTIONS, "/a")), DRAFT)),
         new JMAPRoutesHandler(
             Version.RFC8621,
             new FakeJMAPRoutes(ImmutableSet.of(new Endpoint(HttpMethod.OPTIONS, "/b")), Version.RFC8621)));
 
     private static final ImmutableSet<Version> SUPPORTED_VERSIONS = ImmutableSet.of(
-        Version.DRAFT,
+        DRAFT,
         Version.RFC8621
     );
 
@@ -179,7 +180,7 @@ class JMAPServerTest {
                 .get()
             .then()
                 .statusCode(HttpResponseStatus.OK.code())
-                .body("Version", is(Version.DRAFT.asString()));
+                .body("Version", is(Version.RFC8621.asString()));
         }
 
         @Test
@@ -203,7 +204,7 @@ class JMAPServerTest {
                 .post()
             .then()
                 .statusCode(HttpResponseStatus.OK.code())
-                .body("Version", is(Version.DRAFT.asString()));
+                .body("Version", is(DRAFT.asString()));
         }
 
         @Test
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/VersionParserTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/VersionParserTest.java
index 570962098f..cafd78d776 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/VersionParserTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/VersionParserTest.java
@@ -29,7 +29,6 @@ import com.google.common.collect.ImmutableSet;
 
 class VersionParserTest {
     private static final ImmutableSet<Version> SUPPORTED_VERSIONS = ImmutableSet.of(
-        Version.DRAFT,
         Version.RFC8621
     );
 


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


(james-project) 05/10: JAMES-4025 Drop artifact james-server-jmap-draft

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

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

commit 349ae752837d9b1491f58db897d6d7166f5a4745
Author: Tung Tran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Drop artifact james-server-jmap-draft
---
 pom.xml                                            |    5 -
 server/pom.xml                                     |    1 -
 server/protocols/jmap-draft/doc/Dockerfile         |   19 -
 server/protocols/jmap-draft/doc/README.md          |   15 -
 server/protocols/jmap-draft/doc/annotation.css     |   16 -
 server/protocols/jmap-draft/doc/mkdocs.yml         |    6 -
 server/protocols/jmap-draft/doc/specs/LICENSE.md   |  190 ----
 server/protocols/jmap-draft/doc/specs/README       |    8 -
 .../doc/specs/client-guide/jmap-client-guide.mdwn  |  653 -----------
 .../protocols/jmap-draft/doc/specs/home/faq.mdwn   |   49 -
 .../doc/specs/server-guide/jmap-server-guide.mdwn  |  312 ------
 .../jmap-draft/doc/specs/software/software.mdwn    |   19 -
 .../jmap-draft/doc/specs/spec/account.mdwn         |  119 --
 .../jmap-draft/doc/specs/spec/apimodel.mdwn        |  259 -----
 .../jmap-draft/doc/specs/spec/authentication.mdwn  |  193 ----
 .../jmap-draft/doc/specs/spec/calendar.mdwn        |  195 ----
 .../jmap-draft/doc/specs/spec/calendarevent.mdwn   |  305 -----
 .../doc/specs/spec/calendareventlist.mdwn          |   97 --
 .../jmap-draft/doc/specs/spec/contact.mdwn         |  246 ----
 .../jmap-draft/doc/specs/spec/contactgroup.mdwn    |  138 ---
 .../jmap-draft/doc/specs/spec/contactlist.mdwn     |  114 --
 .../jmap-draft/doc/specs/spec/datamodel.mdwn       |   39 -
 .../jmap-draft/doc/specs/spec/mailbox.mdwn         |  342 ------
 .../jmap-draft/doc/specs/spec/message.mdwn         |  533 ---------
 .../jmap-draft/doc/specs/spec/messagelist.mdwn     |  341 ------
 .../protocols/jmap-draft/doc/specs/spec/push.mdwn  |   65 --
 .../jmap-draft/doc/specs/spec/searchsnippet.mdwn   |   44 -
 .../jmap-draft/doc/specs/spec/thread.mdwn          |  123 --
 .../jmap-draft/doc/specs/spec/upload.mdwn          |   53 -
 .../doc/specs/spec/vacationresponse.mdwn           |   71 --
 server/protocols/jmap-draft/pom.xml                |  328 ------
 .../james/jmap/draft/JMAPDraftConfiguration.java   |  168 ---
 .../james/jmap/draft/api/AccessTokenManager.java   |   37 -
 .../james/jmap/draft/api/SimpleTokenFactory.java   |   29 -
 .../james/jmap/draft/api/SimpleTokenManager.java   |   34 -
 .../jmap/draft/crypto/AccessTokenManagerImpl.java  |   72 --
 .../james/jmap/draft/crypto/AsymmetricKeys.java    |   42 -
 .../jmap/draft/crypto/JamesSignatureHandler.java   |   86 --
 .../james/jmap/draft/crypto/SecurityKeyLoader.java |  114 --
 .../james/jmap/draft/crypto/SignatureHandler.java  |   30 -
 .../jmap/draft/crypto/SignedTokenFactory.java      |   73 --
 .../jmap/draft/crypto/SignedTokenManager.java      |   66 --
 .../exceptions/AttachmentsNotFoundException.java   |   40 -
 .../jmap/draft/exceptions/BadRequestException.java |   30 -
 .../draft/exceptions/InternalErrorException.java   |   30 -
 .../exceptions/InvalidDraftKeywordsException.java  |   26 -
 .../InvalidMailboxForCreationException.java        |   30 -
 .../InvalidOriginMessageForMDNException.java       |   38 -
 .../exceptions/InvalidOutboxMoveException.java     |   26 -
 .../exceptions/JmapFieldNotSupportedException.java |   41 -
 .../draft/exceptions/MailboxHasChildException.java |   23 -
 .../draft/exceptions/MailboxNotOwnedException.java |   29 -
 .../exceptions/MailboxParentNotFoundException.java |   42 -
 .../MalformedContinuationTokenException.java       |   31 -
 .../draft/exceptions/MessageNotFoundException.java |   23 -
 .../draft/exceptions/SizeExceededException.java    |   26 -
 .../SystemMailboxNotUpdatableException.java        |   23 -
 .../jmap/draft/json/FieldNamePropertyFilter.java   |   40 -
 .../james/jmap/draft/json/FilterDeserializer.java  |   62 -
 .../draft/json/MultipleClassesDeserializer.java    |   66 --
 .../draft/json/MultipleObjectMapperBuilder.java    |   40 -
 .../json/OptionalZonedDateTimeDeserializer.java    |   37 -
 .../json/OptionalZonedDateTimeSerializer.java      |   39 -
 .../james/jmap/draft/methods/GetFilterMethod.java  |  117 --
 .../jmap/draft/methods/GetMailboxesMethod.java     |  180 ---
 .../jmap/draft/methods/GetMessageListMethod.java   |  312 ------
 .../jmap/draft/methods/GetMessagesMethod.java      |  145 ---
 .../draft/methods/GetVacationResponseMethod.java   |  104 --
 .../jmap/draft/methods/JmapRequestParser.java      |   34 -
 .../jmap/draft/methods/JmapRequestParserImpl.java  |   51 -
 .../jmap/draft/methods/MIMEMessageConverter.java   |  371 ------
 .../MailboxInvalidMessageCreationException.java    |   26 -
 .../methods/MailboxSendingNotAllowedException.java |   45 -
 .../james/jmap/draft/methods/MessageAppender.java  |  199 ----
 .../james/jmap/draft/methods/MessageSender.java    |   98 --
 .../james/jmap/draft/methods/ReferenceUpdater.java |  112 --
 .../james/jmap/draft/methods/RequestHandler.java   |  117 --
 .../james/jmap/draft/methods/SendMDNProcessor.java |  180 ---
 .../james/jmap/draft/methods/SetFilterMethod.java  |  245 ----
 .../methods/SetMailboxesCreationProcessor.java     |  226 ----
 .../methods/SetMailboxesDestructionProcessor.java  |  170 ---
 .../jmap/draft/methods/SetMailboxesMethod.java     |  102 --
 .../jmap/draft/methods/SetMailboxesProcessor.java  |   38 -
 .../draft/methods/SetMailboxesUpdateProcessor.java |  305 -----
 .../methods/SetMessagesCreationProcessor.java      |  351 ------
 .../methods/SetMessagesDestructionProcessor.java   |   97 --
 .../jmap/draft/methods/SetMessagesMethod.java      |   95 --
 .../jmap/draft/methods/SetMessagesProcessor.java   |   38 -
 .../draft/methods/SetMessagesUpdateProcessor.java  |  498 ---------
 .../draft/methods/SetVacationResponseMethod.java   |  134 ---
 .../draft/methods/UpdateMessagePatchConverter.java |   59 -
 .../draft/methods/UpdateMessagePatchValidator.java |   80 --
 .../james/jmap/draft/methods/ValidationResult.java |   94 --
 .../apache/james/jmap/draft/methods/Validator.java |   28 -
 .../james/jmap/draft/methods/ValueWithId.java      |   79 --
 .../james/jmap/draft/model/AccessTokenRequest.java |   87 --
 .../jmap/draft/model/AccessTokenResponse.java      |  104 --
 .../jmap/draft/model/AttachmentAccessToken.java    |  180 ---
 .../jmap/draft/model/AuthenticatedRequest.java     |   39 -
 .../james/jmap/draft/model/ContinuationToken.java  |  160 ---
 .../jmap/draft/model/ContinuationTokenRequest.java |   97 --
 .../draft/model/ContinuationTokenResponse.java     |  104 --
 .../james/jmap/draft/model/CreationMessage.java    |  513 ---------
 .../james/jmap/draft/model/CreationMessageId.java  |   67 --
 .../james/jmap/draft/model/EndPointsResponse.java  |   89 --
 .../james/jmap/draft/model/EnvelopeUtils.java      |   53 -
 .../org/apache/james/jmap/draft/model/Filter.java  |   70 --
 .../james/jmap/draft/model/FilterCondition.java    |  492 --------
 .../james/jmap/draft/model/FilterOperator.java     |  136 ---
 .../james/jmap/draft/model/GetFilterRequest.java   |   58 -
 .../james/jmap/draft/model/GetFilterResponse.java  |   88 --
 .../jmap/draft/model/GetMailboxesRequest.java      |  102 --
 .../jmap/draft/model/GetMailboxesResponse.java     |  113 --
 .../jmap/draft/model/GetMessageListRequest.java    |  205 ----
 .../jmap/draft/model/GetMessageListResponse.java   |  179 ---
 .../james/jmap/draft/model/GetMessagesRequest.java |   94 --
 .../jmap/draft/model/GetMessagesResponse.java      |  105 --
 .../james/jmap/draft/model/GetVacationRequest.java |   51 -
 .../jmap/draft/model/GetVacationResponse.java      |   89 --
 .../org/apache/james/jmap/draft/model/Header.java  |   76 --
 .../james/jmap/draft/model/InvocationRequest.java  |   59 -
 .../org/apache/james/jmap/draft/model/JmapMDN.java |  231 ----
 .../apache/james/jmap/draft/model/JmapRuleDTO.java |  191 ----
 .../james/jmap/draft/model/MDNDisposition.java     |  119 --
 .../james/jmap/draft/model/MailboxCreationId.java  |   63 --
 .../james/jmap/draft/model/MailboxFactory.java     |  248 ----
 .../james/jmap/draft/model/MailboxProperty.java    |   71 --
 .../apache/james/jmap/draft/model/OldKeyword.java  |  218 ----
 .../apache/james/jmap/draft/model/Operator.java    |   32 -
 .../apache/james/jmap/draft/model/SetError.java    |  158 ---
 .../james/jmap/draft/model/SetFilterRequest.java   |   81 --
 .../james/jmap/draft/model/SetFilterResponse.java  |   56 -
 .../jmap/draft/model/SetMailboxesRequest.java      |  117 --
 .../jmap/draft/model/SetMailboxesResponse.java     |  192 ----
 .../james/jmap/draft/model/SetMessagesError.java   |   93 --
 .../james/jmap/draft/model/SetMessagesRequest.java |  178 ---
 .../jmap/draft/model/SetMessagesResponse.java      |  265 -----
 .../james/jmap/draft/model/SetVacationRequest.java |   84 --
 .../jmap/draft/model/SetVacationResponse.java      |   98 --
 .../jmap/draft/model/SignedExpiringToken.java      |   32 -
 .../james/jmap/draft/model/UpdateMessagePatch.java |  197 ----
 .../james/jmap/draft/model/UploadResponse.java     |  146 ---
 .../james/jmap/draft/model/VacationResponse.java   |  235 ----
 .../deserialization/JmapRuleDTODeserializer.java   |   57 -
 .../james/jmap/draft/model/mailbox/Mailbox.java    |  382 -------
 .../draft/model/mailbox/MailboxCreateRequest.java  |  160 ---
 .../jmap/draft/model/mailbox/MailboxNamespace.java |   94 --
 .../draft/model/mailbox/MailboxUpdateRequest.java  |  162 ---
 .../james/jmap/draft/model/mailbox/Quotas.java     |  133 ---
 .../james/jmap/draft/model/mailbox/SortOrder.java  |   96 --
 .../apache/james/jmap/draft/send/MailSpool.java    |   72 --
 .../send/exception/MessageIdNotFoundException.java |   30 -
 .../james/jmap/draft/utils/DependencyGraph.java    |   69 --
 .../james/jmap/draft/utils/DownloadPath.java       |   48 -
 .../james/jmap/draft/utils/FilterToCriteria.java   |  123 --
 .../james/jmap/draft/utils/MailboxUtils.java       |   59 -
 .../james/jmap/draft/utils/SortConverter.java      |   92 --
 .../utils/SortingHierarchicalCollections.java      |   64 --
 .../draft/utils/quotas/DefaultQuotaLoader.java     |   55 -
 .../james/jmap/draft/utils/quotas/QuotaLoader.java |   56 -
 .../quotas/QuotaLoaderWithDefaultPreloaded.java    |   72 --
 .../http/AccessTokenAuthenticationStrategy.java    |   66 --
 .../james/jmap/http/AuthenticationRoutes.java      |  316 ------
 .../jmap/http/DefaultMailboxesProvisioner.java     |   85 --
 .../org/apache/james/jmap/http/DownloadRoutes.java |  259 -----
 .../org/apache/james/jmap/http/InjectionKeys.java  |   24 -
 .../org/apache/james/jmap/http/JMAPApiRoutes.java  |  148 ---
 .../org/apache/james/jmap/http/LoggingHelper.java  |   49 -
 ...ParameterAccessTokenAuthenticationStrategy.java |   94 --
 .../org/apache/james/jmap/http/UploadRoutes.java   |  165 ---
 .../apache/james/jmap/http/UserProvisioner.java    |   82 --
 .../jmap-draft/src/main/resources/jwt-public.der   |    0
 .../MessageFastViewProjectionItemFactoryTest.java  |  144 ---
 .../org/apache/james/jmap/PreviewFactoryTest.java  |   73 --
 .../org/apache/james/jmap/draft/BeansTest.java     |   34 -
 .../jmap/draft/FixedDateZonedDateTimeProvider.java |   39 -
 .../jmap/draft/JMAPDraftConfigurationTest.java     |  119 --
 .../draft/crypto/AccessTokenManagerImplTest.java   |  151 ---
 .../draft/crypto/JamesSignatureHandlerFixture.java |   54 -
 .../draft/crypto/JamesSignatureHandlerTest.java    |   84 --
 .../jmap/draft/crypto/SecurityKeyLoaderTest.java   |  149 ---
 .../jmap/draft/crypto/SignedTokenFactoryTest.java  |   79 --
 .../jmap/draft/crypto/SignedTokenManagerTest.java  |  182 ---
 .../jmap/draft/json/MultipleObjectMapperTest.java  |   90 --
 .../json/OperatorSerializeDeserializeTest.java     |   55 -
 .../jmap/draft/json/ParsingWritingObjects.java     |  109 --
 .../jmap/draft/json/ParsingWritingObjectsTest.java |   92 --
 .../jmap/draft/methods/ErrorResponseTest.java      |   90 --
 .../jmap/draft/methods/GetMailboxesMethodTest.java |  460 --------
 .../jmap/draft/methods/GetMessagesMethodTest.java  |  777 -------------
 .../methods/GetVacationResponseMethodTest.java     |  192 ----
 .../draft/methods/JmapRequestParserImplTest.java   |   81 --
 .../draft/methods/JmapResponseWriterImplTest.java  |  272 -----
 .../draft/methods/MIMEMessageConverterTest.java    | 1182 --------------------
 .../jmap/draft/methods/MessageSenderTest.java      |  125 ---
 .../jmap/draft/methods/RequestHandlerTest.java     |  227 ----
 .../methods/SetMailboxesCreationProcessorTest.java |   78 --
 .../jmap/draft/methods/SetMailboxesMethodTest.java |  146 ---
 .../methods/SetMailboxesUpdateProcessorTest.java   |  128 ---
 .../methods/SetMessagesCreationProcessorTest.java  |  507 ---------
 .../methods/SetMessagesUpdateProcessorTest.java    |  290 -----
 .../methods/SetVacationResponseMethodTest.java     |  222 ----
 .../methods/UpdateMessagePatchConverterTest.java   |   74 --
 .../methods/UpdateMessagePatchValidatorTest.java   |  100 --
 .../draft/model/AttachmentAccessTokenTest.java     |  127 ---
 .../jmap/draft/model/ContinuationTokenTest.java    |   97 --
 .../jmap/draft/model/CreationMessageTest.java      |  228 ----
 .../jmap/draft/model/FilterConditionTest.java      |  204 ----
 .../james/jmap/draft/model/FilterOperatorTest.java |  127 ---
 .../apache/james/jmap/draft/model/FilterTest.java  |  192 ----
 .../model/GetMailboxMessageListResponseTest.java   |   89 --
 .../jmap/draft/model/GetMailboxesRequestTest.java  |   85 --
 .../draft/model/GetMessageListRequestTest.java     |   92 --
 .../jmap/draft/model/GetMessagesRequestTest.java   |   93 --
 .../jmap/draft/model/GetVacationRequestTest.java   |   32 -
 .../jmap/draft/model/GetVacationResponseTest.java  |   53 -
 .../apache/james/jmap/draft/model/HeaderTest.java  |   71 --
 .../jmap/draft/model/InvocationRequestTest.java    |   95 --
 .../jmap/draft/model/InvocationResponseTest.java   |   61 -
 .../apache/james/jmap/draft/model/JmapMDNTest.java |  185 ---
 .../james/jmap/draft/model/MDNDispositionTest.java |   83 --
 .../james/jmap/draft/model/MailboxFactoryTest.java |  397 -------
 .../jmap/draft/model/MailboxPropertyTest.java      |   46 -
 .../draft/model/MessageHeaderPropertyTest.java     |   86 --
 .../jmap/draft/model/MessagePropertiesTest.java    |  203 ----
 .../jmap/draft/model/MessagePropertyTest.java      |   44 -
 .../apache/james/jmap/draft/model/NumberTest.java  |   67 --
 .../james/jmap/draft/model/OldKeywordTest.java     |  218 ----
 .../james/jmap/draft/model/SetErrorTest.java       |  133 ---
 .../jmap/draft/model/SetMailboxesRequestTest.java  |   70 --
 .../jmap/draft/model/SetMailboxesResponseTest.java |  119 --
 .../jmap/draft/model/SetMessagesRequestTest.java   |   65 --
 .../jmap/draft/model/SetMessagesResponseTest.java  |  187 ----
 .../jmap/draft/model/SetVacationRequestTest.java   |   65 --
 .../jmap/draft/model/SetVacationResponseTest.java  |   46 -
 .../jmap/draft/model/UpdateMessagePatchTest.java   |  269 -----
 .../james/jmap/draft/model/UploadResponseTest.java |   31 -
 .../jmap/draft/model/VacationResponseTest.java     |  126 ---
 .../model/mailbox/MailboxCreateRequestTest.java    |   81 --
 .../draft/model/mailbox/MailboxNamespaceTest.java  |   72 --
 .../jmap/draft/model/mailbox/MailboxTest.java      |  240 ----
 .../model/mailbox/MailboxUpdateRequestTest.java    |   62 -
 .../jmap/draft/model/mailbox/QuotaIdTest.java      |   32 -
 .../jmap/draft/model/mailbox/SortOrderTest.java    |   56 -
 .../james/jmap/draft/send/MailSpoolTest.java       |   87 --
 .../jmap/draft/utils/DependencyGraphTest.java      |  182 ---
 .../jmap/draft/utils/FilterToCriteriaTest.java     |  457 --------
 .../james/jmap/draft/utils/MailboxUtilsTest.java   |   69 --
 .../james/jmap/draft/utils/SortConverterTest.java  |  138 ---
 .../utils/SortingHierarchicalCollectionsTest.java  |  148 ---
 .../AccessTokenAuthenticationStrategyTest.java     |  151 ---
 .../apache/james/jmap/http/AuthenticatorTest.java  |  178 ---
 .../jmap/http/DefaultMailboxesProvisionerTest.java |  100 --
 .../DefaultMailboxesProvisionerThreadTest.java     |   69 --
 .../apache/james/jmap/http/DownloadRoutesTest.java |   61 -
 .../apache/james/jmap/http/JMAPApiRoutesTest.java  |  163 ---
 .../jmap/http/JWTAuthenticationStrategyTest.java   |  170 ---
 ...meterAccessTokenAuthenticationStrategyTest.java |   63 --
 .../james/jmap/http/UserProvisionerTest.java       |   95 --
 .../james/jmap/http/UserProvisionerThreadTest.java |   57 -
 .../jmap/http/XUserAuthenticationStrategyTest.java |  128 ---
 .../jmap-draft/src/test/resources/badAliasKeystore |  Bin 2246 -> 0 bytes
 .../jmap-draft/src/test/resources/calendar.eml     |   42 -
 .../emptyBodyMessageWithOneAttachment.eml          |   52 -
 .../jmap-draft/src/test/resources/example.html     |   21 -
 .../jmap-draft/src/test/resources/fullMessage.eml  |   60 -
 .../src/test/resources/inlineAttachment.eml        |   24 -
 .../src/test/resources/json/message.json           |   28 -
 .../src/test/resources/json/subMessage.json        |   14 -
 .../jmap-draft/src/test/resources/key.pub          |    9 -
 .../jmap-draft/src/test/resources/keystore         |  Bin 2245 -> 0 bytes
 .../jmap-draft/src/test/resources/keystoreJava11   |  Bin 2581 -> 0 bytes
 .../jmap-draft/src/test/resources/keystoreJava7    |  Bin 2239 -> 0 bytes
 .../jmap-draft/src/test/resources/noReplyTo.eml    |   69 --
 .../src/test/resources/oneAttachment.eml           |   16 -
 .../src/test/resources/private.nopass.key          |   27 -
 .../jmap-draft/src/test/resources/spamMail.eml     |  135 ---
 277 files changed, 34595 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8ba38345c4..1b5e5d97ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1562,11 +1562,6 @@
                 <artifactId>james-server-jmap</artifactId>
                 <version>${project.version}</version>
             </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
-                <artifactId>james-server-jmap-draft</artifactId>
-                <version>${project.version}</version>
-            </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>
                 <artifactId>james-server-jmap-rfc-8621</artifactId>
diff --git a/server/pom.xml b/server/pom.xml
index 5bfb6f8c58..fc24429ea9 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -94,7 +94,6 @@
 
         <module>protocols/fetchmail</module>
         <module>protocols/jmap</module>
-        <module>protocols/jmap-draft</module>
         <module>protocols/jmap-rfc-8621</module>
         <module>protocols/jmap-rfc-8621-integration-tests</module>
         <module>protocols/jwt</module>
diff --git a/server/protocols/jmap-draft/doc/Dockerfile b/server/protocols/jmap-draft/doc/Dockerfile
deleted file mode 100644
index cd71a809a3..0000000000
--- a/server/protocols/jmap-draft/doc/Dockerfile
+++ /dev/null
@@ -1,19 +0,0 @@
-FROM iron/python:2-dev
-
-RUN pip install mkdocs
-
-COPY . /doc
-
-RUN find . -name "*.mdwn" | while IFS= read -r f; do mv -v "$f" "$(echo "$f" | sed -e 's/.mdwn$/.md/' - )"; done
-
-RUN mv /doc/specs/spec/apimodel.md /doc/specs/index.md
-
-WORKDIR /doc
-
-RUN mkdocs build --clean
-
-WORKDIR site
-
-EXPOSE 8000
-
-CMD python -m SimpleHTTPServer 8000
\ No newline at end of file
diff --git a/server/protocols/jmap-draft/doc/README.md b/server/protocols/jmap-draft/doc/README.md
deleted file mode 100644
index 99c78b26fe..0000000000
--- a/server/protocols/jmap-draft/doc/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-Annotated JMAP documentation
-============================
-
-This directory contains annotated jmap documentation as found on http://jmap.io/.
-
-Annotations aim at tracking implementation progress in James project.
-
-You can read it as an html site using the provided Dockerfile.
-
-Ì€
-$ docker build --tag=mkdocs .
-$ docker run --rm -p 8000:8000 mkdocs
-Ì€
-
-Then open http://localhost:8000/ in your browser.
diff --git a/server/protocols/jmap-draft/doc/annotation.css b/server/protocols/jmap-draft/doc/annotation.css
deleted file mode 100644
index 70134ddaa3..0000000000
--- a/server/protocols/jmap-draft/doc/annotation.css
+++ /dev/null
@@ -1,16 +0,0 @@
-aside {
-  padding: 1em;
-  margin-top: 1.5em;
-  margin-bottom: 1.5em;
-  background: #6F8000;
-  line-height: 1.6;
-  font-family: 'FontAwesome';
-}
-aside:before {
-  padding-right: 0.5em;
-  font-size: 14px;
-}
-aside.warning { background: #ac5c64; }
-aside.warning:before { content: "\f071"; }
-aside.notice { background: #67875C; }
-aside.notice:before { content: "\f06a"; }
diff --git a/server/protocols/jmap-draft/doc/mkdocs.yml b/server/protocols/jmap-draft/doc/mkdocs.yml
deleted file mode 100644
index 0e5c77f930..0000000000
--- a/server/protocols/jmap-draft/doc/mkdocs.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-docs_dir: specs
-site_name: JMAP specifications with annotations from apache/james contributors
-theme: readthedocs
-use_directory_urls: false
-extra_css:
-  - annotations.css
diff --git a/server/protocols/jmap-draft/doc/specs/LICENSE.md b/server/protocols/jmap-draft/doc/specs/LICENSE.md
deleted file mode 100644
index bbe7cbf44a..0000000000
--- a/server/protocols/jmap-draft/doc/specs/LICENSE.md
+++ /dev/null
@@ -1,190 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-   
-   Copyright 2016 FastMail Pty Ltd
-
-   Licensed 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.
diff --git a/server/protocols/jmap-draft/doc/specs/README b/server/protocols/jmap-draft/doc/specs/README
deleted file mode 100644
index 0ef3d2cce9..0000000000
--- a/server/protocols/jmap-draft/doc/specs/README
+++ /dev/null
@@ -1,8 +0,0 @@
-JSON Mail Access Protocol Specification (JMAP)
-----------------------------------------------
-
-This repository contains the specification for JMAP, a new JSON-based API for synchronising a mail client with a mail server. It is intended as a replacement for IMAP. The specification is based on the API currently used by the FastMail (https://www.fastmail.com) web app.  It aims to be compatible with the IMAP data model, so that it can be easily implemented on a server that currently supports IMAP, but allows for reduced data usage and more efficient synchronisation, bundling of reques [...]
-
-The pretty HTML version of the spec is hosted at http://jmap.io.
-
-Want to get involved? Join the mailing list at https://groups.google.com/forum/#!forum/jmap-discuss. Feedback is welcome: send your thoughts or comments on anything that is imprecise, incomplete, or could simply be done better in another way. Discussion is preferred prior to pull requests, except in the case of minor typos etc.!
diff --git a/server/protocols/jmap-draft/doc/specs/client-guide/jmap-client-guide.mdwn b/server/protocols/jmap-draft/doc/specs/client-guide/jmap-client-guide.mdwn
deleted file mode 100644
index c61c24ab1c..0000000000
--- a/server/protocols/jmap-draft/doc/specs/client-guide/jmap-client-guide.mdwn
+++ /dev/null
@@ -1,653 +0,0 @@
-Guide for client developers
-===========================
-
-This guide shows how you can use JMAP to efficiently minimise bandwidth usage and round trips whilst still giving the user a complete view of their mail. This is particularly relevant to clients on mobile devices, where there is not the space to store a complete cache of all messages, or for web clients where you often do not have a permanent cache at all and must efficiently start from scratch each time the app is loaded.
-
-A single login may have access to multiple accounts. In this guide I'm going to ignore this and just use the primary account, which I'm going to presume has full read-write mail access.
-
-## Cold boot
-
-When a user first logs in and you have no data cached for them, first call:
-
-    [
-        [ "getMailboxes", {}, "#0" ]
-    ]
-
-This will fetch the list of mailboxes (folders or labels) for the user, and the permissions and roles for each. Here's an example of the response you might receive:
-
-    [
-        [ "mailboxes", {
-            accountId: 'user@example.com',
-            state: "m123456789",
-            list: [
-                {
-                    id: "mailbox1",
-                    name: "Inbox",
-                    parentId: null,
-                    role: "inbox",
-                    mustBeOnlyMailbox: false,
-                    mayAddMessages: true,
-                    mayRemoveMessages: true,
-                    mayCreateChild: false,
-                    mayRenameMailbox: true,
-                    mayDeleteMailbox: false,
-                    totalMessages: 1424,
-                    unreadMessages: 3,
-                    totalThreads: 1213,
-                    unreadThreads: 2
-                },
-                {
-                    id: "mailbox2",
-                    name: "Sent",
-                    parentId: null,
-                    role: "sent",
-                    mustBeOnlyMailbox: false,
-                    mayAddMessages: true,
-                    mayRemoveMessages: true,
-                    mayCreateChild: false,
-                    mayRenameMailbox: true,
-                    mayDeleteMailbox: false,
-                    totalMessages: 41,
-                    unreadMessages: 0,
-                    totalThreads: 32,
-                    unreadThreads: 2
-                },
-                {
-                    id: "mailbox3",
-                    name: "Trash",
-                    parentId: null,
-                    role: "trash",
-                    mustBeOnlyMailbox: true,
-                    mayAddMessages: true,
-                    mayRemoveMessages: true,
-                    mayCreateChild: false,
-                    mayRenameMailbox: true,
-                    mayDeleteMailbox: false,
-                    totalMessages: 3,
-                    unreadMessages: 0,
-                    totalThreads: 2,
-                    unreadThreads: 0
-                },
-                {
-                    id: "mailbox4",
-                    name: "Awaiting Reply",
-                    parentId: "mailbox2",
-                    role: null,
-                    mustBeOnlyMailbox: false,
-                    mayAddMessages: true,
-                    mayRemoveMessages: true,
-                    mayCreateChild: true,
-                    mayRenameMailbox: true,
-                    mayDeleteMailbox: true,
-                    totalMessages: 0,
-                    unreadMessages: 0,
-                    totalThreads: 0,
-                    unreadThreads: 0
-                }
-            ],
-            notFound: null
-        }, "#0"]
-    ]
-
-In this (simple) example, the user has four mailboxes. Three at the top level (Inbox, Sent and Trash) and one submailbox of Sent called "Awaiting Reply". The first 3 have `role` attributes, so they are to be used for the designated system roles (these are much as you would expect, but see the spec for full details). Note, you should always use the `role` attribute, as names may be localised (or even different between different servers with the same language)!
-
-The Inbox, Sent and Awaiting Reply mailboxes all have `mustBeOnlyMailbox:false`. The Trash mailbox on the other hand has `mustBeOnlyMailbox:true`. This means that a message in the trash may not be in any other mailbox, and vice versa. However, a message belonging to the Sent mailbox could also be in, for example, the Awaiting Reply mailbox.
-
-The Sent mailbox has no unread messages, but 2 unread threads. This is not an error! A thread is considered unread if any of the messages in it are unread, even if those messages are actually in a different mailbox. In this case, the 3 unread messages in the Inbox must all be replies to messages in the Sent mailbox. Email clients will probably want to hide unread thread counts for mailboxes with a role of "sent" or "archive".
-
-Presuming the client defaults to showing the `role=inbox` mailbox, we now get the list of messages at the top of the mailbox, and the data for each one that we need to show it in the interface.
-
-    [
-        [ "getMessageList", {
-            filter: {
-                inMailboxes: [ "mailbox1" ]
-            },
-            sort: [ "date desc", "id desc" ]
-            collapseThreads: true,
-            position: 0,
-            limit: 10,
-            fetchThreads: true,
-            fetchMessages: true,
-            fetchMessageProperties: [
-                "threadId",
-                "mailboxId",
-                "isUnread",
-                "isFlagged",
-                "isAnswered",
-                "isDraft",
-                "hasAttachment",
-                "from",
-                "to",
-                "subject",
-                "date",
-                "preview"
-            ],
-            fetchSearchSnippets: false
-        }, "call1"]
-    ]
-
-This might return the following:
-
-    [
-        [ "messageList", {
-            accountId: 'user@example.com',
-            filter: {
-                inMailboxes: [ "mailbox1" ]
-            },
-            sort: [ "date desc", "id desc" ]
-            collapseThreads: true,
-            state: "m8231u341",
-            canCalculateUpdates: true,
-            position: 0,
-            total: 1213,
-            messageIds: [
-                "fm1u314",
-                "fm1u312",
-                "fm1u298",
-                "fm1u286",
-                "fm1u265",
-                "fm1u254",
-                "fm1u241",
-                "fm1u211",
-                "fm1u109",
-                "fm1u3"
-            ],
-            threadIds: [
-                "4f512aafed75e7fb",
-                "fed75e7fb4f512aa",
-                "75e7fb4f512aafed",
-                "512aafed75e7fb4f",
-                "fb4f512aafed75e7",
-                "2aafed75e7fb4f51",
-                "afed75fb4f512ae7",
-                "e7fb4f512aafed75",
-                "ed75e74f51fb2aaf",
-                "b4f5ed75e712aaff"
-            ]
-        }, "call1" ],
-        [ "threads", {
-            accountId: 'user@example.com',
-            state: "mc1264092",
-            list: [{
-                id: "4f512aafed75e7fb",
-                messageIds: [ "fm1u314" ]
-            }, {
-                id: "fed75e7fb4f512aa",
-                messageIds: [ "fm1u312", "fm2u12", "fm1u304" ]
-            },
-                … 8 more thread objects, omitted for brevity …
-            ],
-            notFound: null
-        }],
-        [ "messages", {
-            accountId: 'user@example.com',
-            state: "m815034",
-            list: [{
-                "id": "fm1u314",
-                "threadId": "4f512aafed75e7fb",
-                "mailboxIds": [ "mailbox1" ],
-                "isUnread": true,
-                "isFlagged": false,
-                "isAnswered": false,
-                "isDraft": false,
-                "hasAttachment": false,
-                "from": [
-                    { name: "Joe Bloggs", email: "joebloggs@fastmail.fm" }
-                ],
-                "to": [
-                    { name: "Jane Doe", email: "janedoe@fastmail.fm" }
-                ],
-                "subject": "Camping trip",
-                "date": "2014-07-24T15:04:51Z",
-                "preview": "Hey Joe. Fancy a trip out west next week? I hea…"
-            },
-            {
-                "id": "fm1u312",
-                "threadId": "fed75e7fb4f512aa",
-                "mailboxIds": [ "mailbox1" ],
-                "isUnread": false,
-                "isFlagged": true,
-                "isAnswered": false,
-                "isDraft": false,
-                "hasAttachment": true,
-                "from": [
-                    { name: "James Connor", email: "jamesconnorwork@fastmail.fm" }
-                ],
-                "to": [
-                    { name: "Jane Doe", email: "janedoe@fastmail.fm" },
-                    { name: "Joe Bloggs", email: "joebloggs@fastmail.fm" }
-                ],
-                "subject": "Re: I need the swallow velocity report ASAP",
-                "date": "2014-07-24T12:01:43Z",
-                "preview": "Come on you guys. How long can it take to do a simple scientif…"
-            },
-            {
-                "id": "fm2u12",
-                "threadId": "fed75e7fb4f512aa",
-                "mailboxIds": [ "mailbox2" ],
-                "isUnread": false,
-                "isFlagged": false,
-                "isAnswered": false,
-                "isDraft": false,
-                "hasAttachment": false,
-                "from": [
-                    { name: "Jane Doe", email: "janedoe@fastmail.fm" }
-                ],
-                "to": [
-                    { name: "James Connor", email: "jamesconnorwork@fastmail.fm" },
-                    { name: "Joe Bloggs", email: "joebloggs@fastmail.fm" }
-                ],
-                "subject": "Re: I need the swallow velocity report ASAP",
-                "date": "2014-07-24T11:32:15Z",
-                "preview": "It's on its way. Jane."
-            },
-                … more message objects, omitted for brevity …
-            ],
-            notFound: null
-        }, "call1" ]
-    ]
-
-We now have the header information for all the messages in the top 10 threads in the Inbox, plus a full list of mailboxes and their unread counts. Providing the screen cannot fit more than 10 messages without scrolling, this is sufficient to display a standard mail interface as though **all data was loaded**, even though we have only made 2 round trips to the server, and transferred minimal data. (Obviously, you can request more than 10 in the request if you need more to show the initial [...]
-
-## Paging in data as the interface is navigated
-
-In our example Inbox, there are 1213 threads, but so far we have only loaded in data for the first 10. As the user scrolls down, we need to page in the data for the section of the mailbox that becomes visible (and indeed, to avoid the user having to wait, it's advisable to preload a little way ahead too). This is just another call to `getMessageList`, as in the cold boot example, but with the `position` property changed to the index for the section required.
-
-Similarly, if we switch mailboxes, or want to do a search, we can use the same call as well. However, remember in JMAP the same message may appear in multiple mailboxes, so to avoid downloading the same data multiple times, it's advisable to just fetch the message list without also getting the message or thread objects (except in certain situations, such as the very first request; the exact heuristics for deciding between the two can be made arbitrarily clever and complex).
-
-    [
-        [ "getMessageList", {
-            filter: {
-                inMailboxes: [ "mailbox2" ]
-            },
-            sort: [ "date desc", "id desc" ]
-            collapseThreads: true,
-            position: 11,
-            limit: 10,
-            fetchThreads: false,
-            fetchMessages: false,
-            fetchMessageProperties: null,
-            fetchSearchSnippets: false
-        }, "call1"]
-    ]
-
-After the list has been returned, a second request can be made directly to `getThreads` with the thread ids (or to `getMessages` with the message ids) to fetch the ones you are missing.
-
-## Opening a thread
-
-So far we have only fetched the minimal amount of information we need to display a mailbox entry for a message or thread. When opening a thread from the mailbox, we now need to fetch the rest of the message details. Exactly what you wish to fetch depends on what information your client displays. Suppose we open the 2nd thread in the example Inbox above. I'm presuming we already know the list of message ids in the thread from the data received when we fetched the mailbox.
-
-    [
-        [ "getMessages", {
-            ids: [ "fm1u312", "fm2u12", "fm1u304" ],
-            properties: [
-                "threadId",
-                "mailboxIds",
-                "isUnread",
-                "isFlagged",
-                "isAnswered",
-                "isDraft",
-                "hasAttachment",
-                "from",
-                "to",
-                "cc",
-                "bcc",
-                "replyTo",
-                "subject",
-                "date",
-                "size",
-                "body",
-                "attachments",
-                "attachedMessages"
-            ]
-        }]
-    ]
-
-Alternatively, a client may want to just request the "rawUrl" property, then download the original RFC2822 message from the URL returned and parse it in the client.
-
-## Staying in sync
-
-Suppose a new message arrives, or the user performs some actions on their messages using a different client. A push notification comes in to indicate the state has changed on the server, or you get a response back to a method call with a different state string to the previous call. We now need efficiently work out exactly what has changed so that we can update the model in the client and keep it in sync, without throwing away all of our data and starting again.
-
-To efficiently stay in sync, we can call:
-
-    [
-        [ "getMailboxUpdates", {
-            sinceState: "m123456789",
-            fetchRecords: true,
-            fetchRecordProperties: null
-        }, "call1" ],
-        [ "getMessageListUpdates", {
-            filter: {
-                inMailboxes: [ "mailbox1" ]
-            },
-            sort: [ "date desc", "id desc" ]
-            collapseThreads: true,
-            sinceState: "m8231u341",
-            uptoMessageId: "fm1u3",
-            maxChanges: 100
-        }, "call2" ],
-        [ "getMessageUpdates", {
-            sinceState: "m815034"
-            maxChanges: 30,
-            fetchRecords: true,
-            fetchRecordProperties: [
-                "threadId",
-                "mailboxIds",
-                "isUnread",
-                "isFlagged",
-                "isAnswered",
-                "isDraft",
-                "hasAttachment",
-                "labels",
-                "from",
-                "to",
-                "subject",
-                "date",
-                "preview"
-            ]
-        }, "call3" ],
-        [ "getThreadUpdates", {
-            sinceState: "mc1264092"
-            maxChanges: 20,
-            fetchRecords: true
-        }, "call4" ]
-    ]
-
-This is a good example of multiple method calls combined into a single request. Let's have a look at what they are doing.
-
-1. `getMailboxUpdates`: This will return the ids of any mailboxes that have been created or modified (e.g. renamed, or have changed counts). It will also return the ids of any mailboxes that have been deleted. Because we set `fetchMailboxes == true`, any new or changed mailboxes will be fetched. If the server supports the `onlyCountsChanged` property of the mailboxes response, then we will only receive the counts properties for the changed mailboxes if that is the only change (the common case).
-2. `getMessageListUpdates`: All our message lists may have changed, so we must mark all of them as needing a refresh, and immediately refresh the one that is currently selected in the client (here, presuming the Inbox). We'll look at the response to this and how it is used to update the client cache below.
-3. `getMessageUpdates`: Gets the list of ids for all messages which have been added or modified, plus the list of messages which have been deleted. We have also specified `fetchMessages` and `fetchMessageProperties` arguments here to request the standard header information we need to display a message in a mailbox for any new/changed messages. This includes all mutable properties of a message, so is sufficient to bring any changed messages up to date.
-4. `getThreadUpdates`: Gets the list of threads which have had messages added or removed from the thread. We also fetch the `Thread` object for those threads that have changed.
-
-In each case, the `sinceState` argument comes from the response to our previous calls to get the records of that type.
-
-### Handling a standard response
-
-In the common case, not many changes will have occurred since we last synced with the server, and the data returned from this request will be sufficient to fully bring the client into sync with the server.
-
-The `maxChanges` argument prevents methods from returning huge volumes of data in the case where a large number of changes have been made. If we get a `tooManyChanges` error in response to one of our method calls then we will then have to do more work to get back in sync, as detailed below.
-
-Let's look at a common case example, where two new messages have been delivered to the Inbox and one other existing message has been marked as read. We might get back a response something like:
-
-    [
-        [ "mailboxUpdates", {
-            accountId: 'user@example.com',
-            oldState: "m123456789",
-            newState: "m123471231",
-            changed: [ "mailbox1" ],
-            removed: [],
-            onlyCountsChanged: true
-        }, "call1" ],
-        [ "mailboxes", {
-            accountId: 'user@example.com',
-            state: "m123471231"
-            list: [{
-                totalMessages: 1426,
-                unreadMessages: 4,
-                totalThreads: 1214,
-                unreadThreads: 3
-            }],
-            notFound: null
-        }, "call1" ],
-        [ "messageListUpdates", {
-            accountId: 'user@example.com',
-            filter: {
-                inMailboxes: [ "mailbox1" ]
-            },
-            sort: [ "date desc", "id desc" ]
-            collapseThreads: true,
-            oldState: "m8231u341",
-            newState: "m8239u342",
-            uptoMessageId: "fm1u3",
-            removed: [{
-                messageId: "fm1u241",
-                threadId:
-            }],
-            added: [{
-                messageId: "fm1u316",
-                threadId: "afed75fb4f512ae7",
-                index: 0
-            }, {
-                messageId: "fm1u315",
-                threadId: "b4aae3925af0a0a2",
-                index: 1
-            }],
-            total: 1214
-        }, "call2" ],
-        [ "messageUpdates", {
-            accountId: 'user@example.com',
-            oldState: "m815034",
-            newState: "m815039",
-            changed: [ "fm1u316", "fm1u315", "fm1u314" ]
-            removed: []
-        }, "call3" ],
-        [ "messages", {
-            accountId: 'user@example.com',
-            state: "m815039",
-            list: [{
-                "id": "fm1u316",
-                "threadId": "afed75fb4f512ae7",
-                "mailboxId": "mailbox1",
-                "isUnread": true,
-                "isFlagged": false,
-                "isAnswered": false,
-                "isDraft": false,
-                "hasAttachment": false,
-                "from": [
-                    { name: "Joe Bloggs", email: "joebloggs@fastmail.fm" }
-                ],
-                "to": [
-                    { name: "Jane Doe", email: "janedoe@fastmail.fm" }
-                ],
-                "subject": "Camping trip",
-                "date": "2014-07-24T15:04:51Z",
-                "preview": "Hey Joe. Fancy a trip out west next week? I hea…"
-            }, {
-                "id": "fm1u315",
-                "threadId": "b4aae3925af0a0a2",
-                "mailboxId": "mailbox1",
-                "isUnread": true,
-                "isFlagged": false,
-                "isAnswered": false,
-                "isDraft": false,
-                "hasAttachment": false,
-                "from": [
-                    { name: "Joe Bloggs", email: "joebloggs@fastmail.fm" }
-                ],
-                "to": [
-                    { name: "Jane Doe", email: "janedoe@fastmail.fm" }
-                ],
-                "subject": "Camping trip",
-                "date": "2014-07-24T15:04:51Z",
-                "preview": "Hey Joe. Fancy a trip out west next week? I hea…"
-            }, {
-                "id": "fm1u314",
-                "threadId": "4f512aafed75e7fb",
-                "mailboxId": "mailbox1",
-                "isUnread": false,
-                "isFlagged": false,
-                "isAnswered": false,
-                "isDraft": false,
-                "hasAttachment": false,
-                "from": [
-                    { name: "Joe Bloggs", email: "joebloggs@fastmail.fm" }
-                ],
-                "to": [
-                    { name: "Jane Doe", email: "janedoe@fastmail.fm" }
-                ],
-                "subject": "Camping trip",
-                "date": "2014-07-24T15:04:51Z",
-                "preview": "Hey Joe. Fancy a trip out west next week? I hea…"
-            }],
-            notFound: null
-        }, "call3" ],
-        [ "threadUpdates", {
-            accountId: 'user@example.com',
-            oldState: "mc1264092",
-            newState: "mc1264097",
-            changed: [ "afed75fb4f512ae7", "b4aae3925af0a0a2" ],
-            removed: []
-        }, "call4" ]
-        [ "threads", {
-            accountId: 'user@example.com',
-            state: "mc1264097",
-            list: [{
-                id: "afed75fb4f512ae7",
-                messageIds: [ "fm1u241", "fm1u316" ]
-            }, {
-                id: "b4aae3925af0a0a2",
-                messageIds: [ "fm1u315" ]
-            }],
-            notFound: null
-        }, "call4" ]
-    ]
-
-Here's how we apply this information to our current state to stay in sync:
-
-1. `mailboxUpdates`/`mailboxes`: The inbox is the only mailbox to have changed, and only the counts have changed. The new counts are returned in the `mailboxes` response, so we just need to update our cache with the new properties to bring us fully in sync.
-2. `messageListUpdates`: This is more interesting.
-
-    Suppose the client has a sparse list of messageIds (for example, the user opened the folder, loading the first section, then jumped to the middle):
-
-        [ 'm1u1', 'm1u2', 'm1u3', 'm1u4', -, -, -, 'm1u8', -, ...]
-
-    To update this to match the new server state:
-
-    1. Check the oldState property matches the current state of the list. Also check the sort and search are the same. If any of these don't match, abort and re-request an update from the actual current state.
-    2. If the newState property is the same as the current state of the list, nothing to do, so return.
-    3. If there's an `uptoMessageId`, search for this id. If found, remove anything after it in the list. If not found, abort, reset the list and start again with `getMailboxMessageList`.
-    4. Search for each of the messageIds in the `removed` list and remove them from the client's list (without leaving a gap – this is a splice operation). If any can't be found, keep processing but after finishing, null out anything after the first gap in the list. e.g. referring to the example sparse list above, 'm1u8' would be removed as it's after the first gap.
-    5. Iterate through the `added` list **in order**, inserting the messageIds at the positions indicated (again this is a splice operation and will shift everything else further along).
-    6. Set the list length to that given in the `total` property.
-
-    Note, adding or removing an item to/from the list shifts the position of
-    everything around it.
-
-    e.g. adding 'm2' in position 2: `[ 'm1', 'm3' ] -> [ 'm1', 'm2', 'm3' ]`
-
-    e.g. removing 'm2': `[ 'm1', 'm2', 'm3' ] -> [ 'm1', 'm3' ]`
-
-3. `messageUpdates`: The `removed` array has 0 length (so, although a message was removed from the Inbox message list, it has not been deleted: it is simply no longer the first message in the thread in the given sort order). The `changed` array has three message ids: the first two we don't have in memory, so we can ignore, but the last one we have in our cache so we should mark is as needing an update (i.e. the flags might be out of date).
-4. `messages`: Because we specified a `fetchMessages` argument to `getMessageUpdates`, this response contains the requested data for the messages that have been modified or added. The first two are new messages, and we can add this data to our header cache information so we have the info we need to display the mailbox. The final message is one we already have in cache, but a property of it has now changed (in this case, it is no longer unread). We can update this data and clear the flag  [...]
-5. `threadUpdates`: There are two changed threads here. One existing thread has a new message in it, the other is a brand new thread to create in our cache.
-
-After applying these changes, or cache is completely in sync with the server, even though we only have a partial data set cached, and we only made a single HTTP request.
-
-Now let's look at the more difficult cases, when errors occur.
-
-### Handling errors
-
-The most common error will be a `tooManyChanges` error, when the number of changes exceeds the number we were prepared to accept. In this case, it would be more efficient to throw away much of our cache, or mark it as potentially dirty, and then just fetch the information we need right now (similar to the cold boot situation), rather than fetching a potentially large set of updates. Let's look at the errors for each method.
-
-`getMessageListUpdates`: If there are more changes than the `maxChanges` argument, or the server is unable to calculate updates from the state requested, you will receive an appropriate error back. In these cases, you simply have to throw away the current message list cache and request the section you are interested in with a standard `getMessageList` call.
-
-`getMessageUpdates`: If there are too many changes, you will get an error back. In this case, there are two strategies you could adopt. The first is simple: mark each message you have in cache as needing an update, and fetch these when the message is next required by the user (note, since only the flags and mailboxes it belongs to are mutable, the data you need to fetch can be reduced). As an extra possible optimisation, you could try another `getMessageUpdates` call first, with a higher [...]
-
-`getThreadUpdates`: Just like with `getMessageUpdates`, if there are too many changes you can either flush your cache of threads, or try with a higher `maxChanges` but `fetchThreads: false`.
-
-In each of the error cases, a single further HTTP request should be sufficient to get the necessary data to update the client to the correct state.
-
-### Handling message list without delta updates
-
-The response to `getMessageList` includes a property called `canCalculateUpdates`, which lets you know whether the server supports a call to `getMessageListUpdates` for the given message list (servers may not support it at all, or may only support it when there is no search involved etc.). In this case, we have to fetch the bit of the message list currently on display, and just throw away all of our cached data for the message list. Note, however, we don't have to throw away all the mess [...]
-
-## Performing actions
-
-Modifying the state is the most complex operation to get right, as changes to messages may change counts in mailboxes, or thread membership, and the client may not have sufficient information to work out all the effects; it must apply the change then get the rest of the updates from the server.
-
-### Selecting all
-
-If you select all, you need to fetch the complete message list for the mailbox currently displayed.
-
-When applying actions to threads, you will often wish to apply the same action to every message in the thread in the same mailbox as the one explicitly selected, or even to all the messages in the thread, regardless of mailbox. The most efficient way to do the former is to fetch the same message list, but with `collapseConversations == false`. You can then easily build a map of threadId to messages ids for messages in the list. If you need to find all messages in the thread, regardless o [...]
-
-### Moving a message
-
-Moving a message from the Inbox to the Trash is simple:
-
-    [ "setMessages", {
-        update: {
-            "fm1u254": {
-                mailboxes: [ "mailbox3" ]
-            }
-        }
-    }, "call1" ]
-
-We can then do a resync as in section 4 to update the client cache. This is easy, but means there's a noticeable delay performing every action, and we cannot operate in an offline mode and resync later. We can improve on this, although it makes it considerably more complicated. We can apply the effects we think the changes will have instantly then compare this with the results we get back from the server.
-
-1. **Mailbox counts**.
-
-   For each message moved:
-   - Decrement the `totalMessages` count for the source mailbox.
-   - Increment the `totalMessages` count for the destination mailbox.
-   - If unread, decrement the `unreadMessages` count for the source mailbox.
-   - If unread, increment the `unreadMessages` count for the destination mailbox.
-
-   If there are no other messages in the thread in the source mailbox:
-   - Decrement the `totalThreads` count for the source mailbox.
-   - If any of the messages in the thread are unread, decrement the
-     `unreadThreads` count for the source mailbox.
-
-   If there are no other messages in the thread already in the destination mailbox:
-   - Increment the `totalThreads` count for the destination mailbox.
-   - If any of the messages in the thread are unread, increment the
-     `unreadThreads` count for the destination mailbox.
-
-   There are slight added complexities if moving a message into or out of the Trash; refer to the spec for full details.
-
-2. **Message list**. Splice each selected message being moved from the current message list (from which it was selected by the user). You may also try to insert them at the correct position in the message list of the destination mailbox:
-
-   From the thread object, you know if there are any other messages in the thread already in the mailbox. As the message list in the thread object is sorted by date, as long as the mailbox list is also sorted by date, you can now work out if the message is a new exemplar in the message list or not. If it is, binary search the list by date to find where to insert it. If you don't have message headers for all the message list loaded, you may not be able to determine the correct spot. In th [...]
-
-3. **Thread**. No changes to make.
-
-4. **Message**. Update the `mailboxIds` property on the message object.
-
-When you next do resync, whether that's a second or several days later, apply the changes and fetch the delta update (as per section 4) in a single request, and when the response is received, undo the preemptive changes made above and apply the real changes. Hopefully the end result will be the same, and there will be no noticeable difference to the user.
-
-## Keeping a full copy of mail in sync
-
-JMAP can also be used to efficiently download and keep in sync the entire set of a user's mail. To do this, you would firstly get the full set of mailboxes, then page in the full list of message ids and download the actual messages. From this point on, you would only need to get the delta updates. Presuming you also want to optimise for fetching new mail first, you could do something like when you want to get the latest updates:
-
-    [
-        [ "getMailboxUpdates", {
-            sinceState: "m123456789",
-            fetchRecords: true,
-            fetchRecordProperties: null
-        }, "call1" ],
-        [ "getMessageUpdates", {
-            sinceState: "m815034"
-            maxChanges: 50,
-            fetchRecords: true,
-            fetchRecordProperties: [
-                "threadId",
-                "mailboxIds",
-                "isUnread",
-                "isFlagged",
-                "isAnswered",
-                "isDraft",
-                "hasAttachment",
-                "labels",
-                "from",
-                "to",
-                "subject",
-                "date",
-                "preview"
-            ]
-        }, "call3" ],
-        [ "getMessageList", {
-            filter: {
-                inMailboxes: [ "${inboxId}" ]
-            },
-            sort: [ "date desc", "id desc" ]
-            collapseThreads: false,
-            position: 0,
-            limit: 100
-        }, "call2" ]
-    ]
-
-The first two calls get the delta updates to mailboxes and messages (if the client has a copy of all messages locally, it has no need to use the server to get threads as it already has all the information). In the common case where there are fewer than 50 message changes since last time, this will bring the client fully up to date (barring downloading new message bodies, attachments and other details, which it can easily schedule at its leisure).
-
-However, if there have been a large number of changes since last time, the client is not yet fully up to date. It can continue to call getMessageUpdates to fetch more changes until it reaches the current state. Simultaneously, it can use the response to the getMessageList call in the first request to see if there are any new message ids at the top of the Inbox. These can be downloaded first so the user has immediate access to new messages (by the end of the second round trip) while the o [...]
diff --git a/server/protocols/jmap-draft/doc/specs/home/faq.mdwn b/server/protocols/jmap-draft/doc/specs/home/faq.mdwn
deleted file mode 100644
index a481f13447..0000000000
--- a/server/protocols/jmap-draft/doc/specs/home/faq.mdwn
+++ /dev/null
@@ -1,49 +0,0 @@
-# JMAP
-
-<p style="margin-left:-40px;"><iframe width="780" height="469" src="http://www.youtube.com/embed/8qCSK-aGSBA?version=3&amp;rel=0&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent" frameborder="0" allowfullscreen="true"></iframe></p>
-
-## What is JMAP?
-
-JMAP is a transport-agnostic, stateless JSON-based API for synchronising a mail client with a mail server. It is intended as a replacement for IMAP. The specification is based on the API currently used by [FastMail](https://www.fastmail.com)'s web app.  It aims to be compatible with the IMAP data model, so that it can be easily implemented on a server that currently supports IMAP, but also allows for reduced data usage and more efficient synchronisation, bundling of requests for latency  [...]
-
-## Why is it not REST based?
-
-JMAP is actually more REST-like than most "RESTful" APIs. It is stateless, highly cacheable, supports transparent intermediaries and provides a uniform interface for manipulating different resources. However, it doesn't use HTTP verbs to implement this.
-
-When you have a high latency connection (such as on a mobile phone, or even wired connections from the other side of the world), the extra round trips required for an HTTP REST-based protocol can make a huge impact on  performance. This is especially an issue when you have an order-dependency in your API calls and you need to make sure one has finished before the other can be run (for example when you mutate the state of a message then want to fetch the changes to a mailbox containing th [...]
-
-The JMAP protocol is transport agnostic and can be easily transported over a WebSocket, for example, as well as HTTP.
-
-## Why is it not a binary protocol?
-
-A binary protocol would be arguably more compact and faster to encode/parse. However, history has shown text-based protocols are much easier to debug, and by using an existing widely-used encoding format (JSON) we make it much easier for developers to use this protocol. No need to write new custom, error-prone parsers. The difference in speed is likely to be minimal, especially if you GZIP the exchange and use WebSockets instead of HTTP.
-
-## Why do labels apply to messages not threads?
-
-Mutable state has to be stored per-message, for example the `isUnread` status must apply on a per message basis, and it's very useful to be able to flag a particular useful message rather than just the whole thread. To be able to delete a particular message to the Trash out of a thread, you need to be able to change the mailbox of that message. Sent messages should belong to the sent mailbox, but not messages you receive.
-
-Meanwhile, it is simple to aggregate the information of the messages in the thread. So, for example, if any message in the thread is unread, then the thread can be considered unread. There is no need to store mutable state as a property of a thread therefore, and the less mutable state, the easier it is to manage. Finally, all known existing IMAP implementations, plus Gmail, store this state per-message, not per-thread, so it makes it easier for implementors to migrate to JMAP.
-
-## Why are there flags (e.g. isUnread) separate to mailboxes?
-
-In IMAP, you can only have one mailbox but you can have multiple flags on a single message. In other systems (where you have labels), these are really the same thing and you can have a single message in multiple mailboxes. JMAP aims to support both, so it has to be able to specify whether a mailbox can be used in combination with other mailboxes on a message, or must be the only one with the message (but does allow different flags). The clearest way of specifying what is allowed by the s [...]
-
-## Why isUnread instead of isRead?
-
-Although this may seem inconsistent at first, it actually makes more sense. The "special" status is when a message is unread (this is what clients are interested in), so like isDraft, isFlagged and isAnswered, we make the special status equal to `true`. It is also consistent with the need for unread counts in mailbox objects, not read counts, and makes the definition of sorting a message list the same for isFlagged and isUnread when conversations are collapsed.
-
-## I want to get involved with JMAP. What do I need to know?
-
-First of all, you should join the [JMAP mailing list](https://groups.google.com/forum/#!forum/jmap-discuss). Feedback is welcome: send your thoughts or comments on anything that is imprecise, incomplete, or could simply be done better in another way. Or if you're working on something JMAP related, this list is a good place to let other people know and to raise any issues you come across.
-
-The specification itself is [hosted on GitHub](https://github.com/jmapio/jmap). If you've found a typo or other minor change, feel free to just submit a pull request. Otherwise, discussion on the mailing list first is preferred.
-
-## I want to implement it. What do I need to know?
-
-That's great! There are lots of resources on this website to help you. Counter-intuitive though it may seem, I recommend starting with the [guide for client authors](client.html) to get a good feel for how the JMAP spec works. After that though, [the spec](spec.html) is your bible and the [advice for implementors](server.html) is your friend.
-
-If you're implementing the spec and suddenly find there's an externally visible behaviour that's not specified, please email the [mailing list](https://groups.google.com/forum/#!forum/jmap-discuss) so we can update the spec to nail down this corner.
-
-## I want to use it to build a client. What do I need to know?
-
-Have a read through the [client guide](client.html) to get an idea of how it works. Then you'll want to find a JMAP server to test against.
diff --git a/server/protocols/jmap-draft/doc/specs/server-guide/jmap-server-guide.mdwn b/server/protocols/jmap-draft/doc/specs/server-guide/jmap-server-guide.mdwn
deleted file mode 100644
index 7e8b056458..0000000000
--- a/server/protocols/jmap-draft/doc/specs/server-guide/jmap-server-guide.mdwn
+++ /dev/null
@@ -1,312 +0,0 @@
-# Advice for JMAP implementors
-
-This document describes a recommended set of data structures and algorithms for efficiently implementing JMAP. It is intended to serve as suggestions only; there may well be better ways to do it. The spec is the authoritative guide on what constitutes a conformant JMAP implementation.
-
-## Assigning Message Ids
- 
-A good way of assigning a message id is to sha1 the RFC2822 message and take the first 80 bits (this is sufficient for avoiding collisions in any reasonable sized instance, but the server may choose any length it likes). If this is already in use (i.e. another copy of the message already exists), sha1 the GUID. Repeat until there is no collision. The bytes can be represented in any reasonable encoding for transmission as a `String` within the API.
-
-## Modification sequences
-
-A modification sequence, or **modseq**, is a 63-bit monotonically incrementing counter. Each user has their own modseq counter (in IMAP it's originally per-mailbox, but per user is backwards compatible with this). Every time a change occurs to data within the user, the modseq is incremented by one and the new value is associated with the changes. This is used in a number of data structures and algorithms below to efficiently calculate changes.
-
-## Data structures
-
-As ever in programming, get your data structures right and the server will practically write itself.
-
-There are three types of data structures suggested in this guide (excluding the email indexing for search, which is more complicated than this guide is prepared to go into):
-
-1. A **Map** (associative array) of id to variable-length data blob:
-   - Insert should be O(1).
-   - Lookup should be O(1).
-   - Delete should be O(1).
-   - Not ordered, but we need to be able to iterate over all the values.
-2. An **append-only log** of variable length blobs:
-   - Insert is only at tail.
-   - Lookup needs to be able to binary search (based on modseq) to find start location, then read sequentially.
-   - Delete is only at head.
-3. An **Ordered list** of fixed-sized objects:
-   - Insert is mainly at or near the head, but can be in a random location.
-   - Want to be able to read sequentially from head (common case), or read whole structure into memory and sort.
-   - Delete is mainly near head, but can be in a random location.
-
-### 1. User
-
-This is a simple collection of important top-level values for the user (kept in a **Map**):
-
-- Highest ModSeq for the user (`63 bits` for IMAP compatibility)
-- Highest ModSeq of any Mailbox.
-- Low watermark ModSeq for Thread Log `63 bits` – whenever the thread log (see below) is truncated, the modseq of the new first item in the log is stored here. Any attempt to call *getThreadUpdates* with a modseq lower than this must be rejected with a `cannotCalculateUpdates` error.
-- Low watermark ModSeq for Message Log `63 bits` – the same, but for the message log.
-- Quota available in bytes (63 bits. -1 => Don't care)
-- Quota used in bytes `63 bits`
-- List of other users with mailboxes made available to this user (shared mailboxes) (var length).
- 
-### 2. Mailboxes
-
-A map of Mailbox Id to all of the mailbox object values (as defined in the spec, including the counts). For the purposes of calculating `getMailboxUpdates`, also include the following for each mailbox:
-
-- **Mailbox ModSeq** `63 bits` Updated when any of the mailbox properties (as defined in the spec) change – not updated when the mailbox message list changes.
-- **Mailbox Non-Counts ModSeq** `63 bits` Updated when any of the mailbox properties that are not counts change. When calculating `getMailboxUpdates`, if this is lower than the previous mod seq, but the Mailbox ModSeq is higher, then only counts have changed.
-- **Message list UID Next** `32 bits` The next UID (incrementing 32-bit counter) to assign to messages added to the mailbox message list.
-- **Message list highest ModSeq** `63 bits` The highest ModSeq of a message in the mailbox message list.
-- **Low watermark message list ModSeq** `63 bits` Whenever a message is undeleted via IMAP (that is the \Deleted flag is removed) or a deleted message is fully expunged from the mailbox message list (see message list data structure below), set this to the ModSeq of that message if higher than the previous value. Any attempt to call *getMessageListUpdates* with a modseq lower than this must be rejected with a `cannotCalculateUpdates` error.
-
-The suggested way to assign a Mailbox id is to use an incrementing counter. 16 bits should be sufficient, giving support for a maximum of 65536 mailboxes per user. Old ids are reusable without penalty while keeping with the JMAP semantics. Over the wire this would be represented as a prefix plus an encoding of the number, e.g. "m1", "m2" etc.
-
-### 3. Mailbox message list
-
-One of these should exist for each mailbox. It is an ordered list of fixed size objects. Each object is:
-
-- **UID** `32 bits` As per IMAP semantics, this increments each time you append a message to the mailbox. The next UID to use is stored in the Mailbox object.
-- **ModSeq** `63 bits` As per IMAP semantics, this is updated whenever any property of the message changes.
-- **Message Id** `80 bits` This is the ID always used within JMAP to refer to the message, and does not change as it moves between mailboxes.
-- **Thread Id** `64 bits`
-- **Deleted** `64 bits` Time stamp from epoch of when the message was removed the mailbox. `0` means not deleted. See below
-- **Message Date** `64 bits`
- 
-Given that most message list fetches are of the first section of a single mailbox in date descending order, if we keep it stored in this order on disk we can just read the first few bytes to return the desired information; no sorting required (we don't even have to look up anything in the message cache). The date is included in each record so we can insert a new one in the correct position without having to reference any other data.
-
-When a message is removed from the mailbox we don't remove it immediately from the message list. Instead we just set the Deleted field to the time stamp of when it was deleted. This allows the delta update algorithm to work to efficiently update the client to the new list state. At certain intervals (either based on how many deleted nodes there are or how long since they were deleted) this needs to be cleaned up and the deleted objects fully expunged from the message list. At this point  [...]
- 
-### 4. Message cache
-
-A map of Message Id to flags, mailboxes and common header information for that message (variable length). This lets the server optimise calls to `getMessages` that only fetch this information (common when fetching the required information for a mailbox listing). It also allows optimisation of `getMessageList` as most, even quite complex filters will only require checking this cache (which should be relatively fast) rather than looking up and parsing the whole message (which could be quit [...]
-
-For each message, store:
-
-- **isUnread** `1 bit` (mutable)
-- **isFlagged** `1 bit` (mutable)
-- **isAnswered** `1 bit` (mutable)
-- **isDraft** `1 bit` (mutable by IMAP)
-- Other flags + labels + annotations as needed for IMAP compatibility only. (mutable)
-- **Mailboxes** (list of mailbox ids this message belongs to) (mutable)
-- **From** header (either in the JSON used by JMAP, or whatever IMAP needs)
-- **To** header (either in the JSON used by JMAP, or whatever IMAP needs)
-- **Subject** header
-- **Date**
-- **Preview** (see spec)
-- **Attachments** (list of file names only; also used for hasAttachments)
-- **GUID** (sha1 of raw email)
- 
-### 5. Message index
-
-For searching messages at any reasonable speed, an index is required from textual content within the message to the message id. Describing how this should work is beyond the scope of this guide.
-
-### 6. Messages
-
-A map of GUID (sha1 of the message contents) to the raw RFC2822 message itself. This is the bulk of the data to be stored for each user. As this data is immutable and referenced by its sha1, there are many possibilities for how to store it. Each message could be stored as a separate file using its GUID as the name. Or on a separate networked object store etc. etc.
- 
-### 7. Message log
-
-An append only log of changes made to the message cache. Each entry consists of:
-
-- **ModSeq** of change `63 bits`
-- List of **Message ids** which were affected by the change (to save extra lookups when the client is fetching these changes, should probably include a bit to say whether the message was destroyed by the change or created/modified).
- 
-Periodically, truncate the log by chopping records off the beginning. At this point you need to update the low watermark ModSeq for the log in the User object (data structure 1).
- 
-### 8. Threads
-
-A map of thread id to an object containing information about the thread (variable length). The information stored for each thread is:
-
-- The **list of messages** belonging to the thread, sorted in date order. For each - message we need to store:
-  - **Message Id** `80 bits`
-  - **Mailboxes** The list of mailboxes the message belongs to. For sorting a message list by thread unread/thread flagged purposes only.
-  - **isUnread** `1 bit` For sorting a message list by thread unread/thread flagged purposes only.
-  - **isFlagged** `1 bit` For sorting a message list by thread unread/thread flagged purposes only.
-- **ModSeq of last change** to isRead/isFlagged for any message in the thread (for sorting a message list by thread unread/thread flagged purposes only).
-- **Sha1 of subject** after stripping Fwd/Re etc. (for checking whether we need to split a new conversation out later; see threading algorithm in data structure 10).
- 
-### 9. Thread log
-
-An append only log of changes made to the **membership** of threads (in data structure 7; changes to only the isRead/isFlagged/Mailboxes of a message in a thread do not need to go in the log). Each entry consists of:
-
-- **ModSeq** of change
-- **List of thread ids** which were affected by the change (to save extra lookups when the client is fetching these changes, should probably include a bit to say whether the thread was destroyed by the change or created/modified).
- 
-As with the message log, periodically truncate the log by chopping records off the beginning; at this point you need to update the low watermark ModSeq for the log in the user object.
- 
-### 10. Refs to ThreadId
-
-This is solely used to look up the conversation to assign to a message on creation/import/delivery. Maps the RFC2822 Message Id (eughh, so many different types of id!) to the thread id.
-
-The suggested rule for connecting messages into threads is this:
-
-If two messages share a common RFC2822 Message Id in the set of such ids within the `Message-Id`, `References` and `In-Reply-To` headers of each message, and the messages have the same `Subject` header (after stripping any preceding Re:/Fwd: and trimming white space from either end), then they should belong in the same thread. Otherwise they should belong in different threads.
-
-## Message List Algorithms
-
-The `state` property to return with getter calls to each type is:
-
-- Mailbox: Highest ModSeq of any Mailbox (stored in the User object)
-- MessageList: Message list UID Next + Message list highest ModSeq (as stored on the Mailbox object). For message lists that aren't just a mailbox, the state string should be the highest message ModSeq (as found at the tail of the Message Log).
-- Thread: The highest modseq found at the end of the Thread Log.
-- Message: The highest modseq found at the end of the Message Log.
-
-### getMailboxUpdates
-
-Simply iterate through the set of Mailboxes comparing their current mod seqs to the client mod seq. If higher, the mailbox has changed. If the non-counts is not higher, only counts have changed.
-
-### getMessageList
-
-First you need to get the complete list. In the common case of…
-
-    filter == { inMailboxes: [ 'inboxId' ], notInMailboxes: [ 'trashId' ] }
-
-…you are simply fetching the list of messages in a mailbox. This list is already pre-calculated for each mailbox and kept on disk (data structure 3). You can simply slurp this into memory and sort if needed (again, in the common case of sorting date-descending, it will be pre-sorted).
-
-If the filter is more complex, you will need to do more work to get the set of matching messages and sort it. If there is a `String` component to the filter, first use the message index (data structure 5) to get a set of matches. Then iterate through and lookup each match in the message cache (data structure 4) to apply any other components of the filter. Finally sort as specified.
-
-Once you have the complete message list, you can calculate the results to return to the client. Since a client is likely to fetch a different portion of the same message list soon after, it is beneficial if the server can keep the last list requested by the user in a cache for a short time.
-
-    let collapseThreads = args.collapseThreads
-    let position = args.position
-    let anchor = args.anchor
-    let anchorOffset = args.anchorOffset
-    let limit = args.limit
-    let total = 0
-    let messageIds = [] # NB Max size of array is limit
-    let threadIds = []  # NB Max size of array is limit
-
-    # If not collapsing threads, we can just jump to the required section
-    if !collapseThreads {
-      total = messageList.length
-      for i = position; i < total; i = i + 1 {
-        messageIds.push( msg.id )
-        threadIds.push( msg.threadId )
-      }
-    } else {
-      # Optimisation for the common case
-      let totalIsKnown = filter is just mailbox
-      let SeenThread = new Set()
-      let numFound = 0
-      foreach msg in sortedFilteredList {
-        if !SeenThread{ msg.threadId } {
-          SeenThread.add( msg.threadId )
-          total += 1
-          if position >= total && numFound < limit {
-            messageIds.push( msg.id )
-            threadIds.push( msg.threadId )
-            numFound += 1
-            if numFound == limit && totalIsKnown {
-              break;
-            }
-          }
-        }
-      }
-      if totalIsKnown {
-        total = getTotal( mailbox, collapseThreads )
-      }
-    }
-
-### getMessageListUpdates
-
-With the suggested data structures, we can do delta updates for any standard mailbox message list (the common case), but not for a search. The following algorithm correctly calculates the delta update. We're presuming we already have a `messageList` (directly read in from data structure 3 and sorted if required):
-
-    let index = -1
-    let added = []
-    let removed = []
-    let collapseThreads = args.collapseThreads
-    let uptoHasBeenFound = false
-
-    # A mutable sort is one which sorts by a mutable property, e.g.
-    # sort flagged messages/threads first.
-    let isMutable = sort.isMutable()
-
-    # An exemplar is the first message in each thread in the list, given the
-    # sort order that
-    # The old exemplar is the exemplar in the client's old state.
-    let SeenExemplar = collapseThreads ? new Set() : null
-    let SeenOldExemplar = collapseThreads ? new Set() : null
-
-    foreach msg in messageList {
-
-      let isNewExemplar = false
-      let isOldExemplar = false
-
-      let isNew = ( msg.uid >= mailbox.uidNext )
-      let isChanged = ( msg.modSeq > args.state )
-      let isDeleted = ( msg.deletedTimeStamp != 0 )
-      let wasDeleted = ( isDeleted && !isChanged )
-
-      # Is this message the current exemplar?
-      if !isDeleted && ( !collapseThreads || !SeenExemplar{ msg.threadId } ) {
-        isNewExemplar = true
-        index += 1
-        if collapseThreads {
-          SeenExemplar.set( msg.threadId )
-        }
-      }
-
-      # Was this message an old exemplar?
-      # 1. Must not have arrived after the client's state
-      # 2. Must have been deleted before the client's state
-      # 3. Must not have already found the old exemplar
-      if !isNew && !wasDeleted &&
-          ( !collapseThreads || !SeenOldExemplar{ msg.threadId } ) {
-        isOldExemplar = true
-        if collapseThreads {
-          SeenOldExemplar.set( msg.threadId )
-        }
-      }
-
-      if isOldExemplar && !isNewExemplar {
-        removed.push({
-          messageId: msg.messageId,
-          threadId: msg.threadId
-        })
-      }
-      else if !isOldExemplar && isNewExemplar {
-        added.push({
-          index: index,
-          messageId: msg.messageId,
-          threadId: msg.threadId
-        })
-      }
-      # Special case for mutable sorts (based on isFlagged/isUnread). If
-      # collapseThread == true, the sort is based on the *conversation*
-      # isFlagged/isUnread status.
-      if isMutable && isOldExemplar && isNewExemplar {
-        # Has the isUnread/isFlagged status of the message/thread
-        # (as appropriate) possibly changed since the client's state?
-        let modSeq = collapseThreads ?
-              msg.modSeq :
-              getThread( msg.threadId ).modSeq
-        # If so, we need to remove the exemplar from the client view and add 
-        # it back in at the correct position.
-        if modSeq > args.modSeq {
-          removed.push({
-            messageId: msg.messageId,
-            threadId: msg.threadId
-          })
-          added.push({
-            index: index,
-            messageId: msg.messageId,
-            threadId: msg.threadId
-          })
-        }
-      }
-      # If this is the last message the client cares about, we can stop here
-      # and just return what we've calculated so far. We already know the total
-      # count for this message list as we keep it pre calculated and cached in
-      # the Mailbox object.
-      #
-      # However, if the sort is mutable we can't break early, as messages may 
-      # have moved from the region we care about to lower down the list.
-      if !isMutable && msg.uid == args.upto {
-        break
-      }
-    } # End loop
-
-    total = getTotal( mailbox, collapseThreads )
-
-To implement this algorithm, the server must keep the metadata at least of deleted (expunged) messages for a little while (say 1-2 weeks). This is also very useful for restoring accidentally deleted messages as well. At cleanup time (when actually removing the messages), the server must keep track of the highest modseq of a message it has removed in that mailbox (the modseq would have been set at the original delete time); any requests for updates from a state before this must be rejecte [...]
-
-## getThreadUpdates
-
-If the client id is lower than the low watermark ModSeq for the Thread Log (as found in the User object), reject with a `cannotCalculateUpdates` error. Otherwise, binary search the Thread log looking for the client modseq, then read sequentially from there to get the changes.
-
-## getMessageUpdates
-
-If the client id is lower than the low watermark ModSeq for the Message Log (as found in the User object), reject with a `cannotCalculateUpdates` error. Otherwise, binary search the Message log looking for the client modseq, then read sequentially from there to get the changes.
diff --git a/server/protocols/jmap-draft/doc/specs/software/software.mdwn b/server/protocols/jmap-draft/doc/specs/software/software.mdwn
deleted file mode 100644
index 5570c410e3..0000000000
--- a/server/protocols/jmap-draft/doc/specs/software/software.mdwn
+++ /dev/null
@@ -1,19 +0,0 @@
-# JMAP software
-
-JMAP is still young but several implementations already exist, and more are on the way. If you're working on a project that uses JMAP, please email the [mailing list](https://groups.google.com/forum/#!forum/jmap-discuss) and we'll add it here.
-
-## Clients
-
-* **[JMAP Demo Webmail](https://github.com/jmapio/jmap-demo-webmail)** (JavaScript, MIT): a sophisticated demo webmail client to be used as a base for new projects. Default client for the [proxy](https://proxy.jmap.io).
-
-## Servers
-
-* **[JMAP Proxy](https://github.com/jmapio/jmap-perl)** (Perl, MIT): a complete JMAP server implementation that uses any IMAP, CalDAV and CardDAV store as a backend. Also available as a hosted service at [proxy.jmap.io](https://proxy.jmap.io).
-* **[Cyrus IMAP](https://docs.cyrus.foundation/imap/release-notes/3.0/x/3.0.0-beta1.html)** (C, BSD-style): A scalable enterprise-grade IMAP, CalDAV and CardDAV server. The 3.0 series is adding JMAP support.
-* **[salada](https://github.com/robn/salada)** (Rust, MIT): A small standalone JMAP server, suitable for development and experimentation.
-
-## Libraries
-
-* **[JMAP-JS](https://github.com/jmapio/jmap-js)** (JavaScript, MIT): a full implementation of the JMAP mail, calendar and contacts model in JavaScript. It supports asynchronous local changes and is tolerant of network failure – actions will update the UI instantly, then synchronise changes back to the server when it can. It also has multi-level undo/redo support. Used by the [demo webmail](https://github.com/jmapio/jmap-demo-webmail).
-* **[jmap-client](https://github.com/linagora/jmap-client)** (JavaScript ES6, MIT): a simple promise-based API to send requests to a JMAP server.
-* **[jmap-rs](https://github.com/robn/jmap-rs)** (Rust, MIT): JMAP parser, generator and data model library for Rust. Used by [salada](https://github.com/robn/salada).
diff --git a/server/protocols/jmap-draft/doc/specs/spec/account.mdwn b/server/protocols/jmap-draft/doc/specs/spec/account.mdwn
deleted file mode 100644
index c846d27712..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/account.mdwn
+++ /dev/null
@@ -1,119 +0,0 @@
-## Accounts
-<aside class="warning">
-Not implemented
-</aside>
-
-A single login may provide access to multiple accounts, for example if another user is sharing their mail with the logged in user.
-
-All data belongs to an account. With the exception of a few explicit operations to copy data between accounts, all methods take an *accountId* argument that specifies on which account the operations are to take place. This argument is always optional; if not specified, the primary account is used. All ids (other than Account ids of course) are only unique within their account.
-
-An **Account** object has the following properties:
-
-- **id**: `String`
-  The id of the account. This property is immutable.
-- **name**: `String`
-  A user-friendly string to show when presenting content from this account. e.g. the email address of the account.
-- **isPrimary**: `Boolean`
-  This MUST be true for exactly one of the accounts returned.
-- **capabilities**: `AccountCapabilities`
-  An object describing general capabilities of this server.
-- **mail**: `MailCapabilities|null`
-  If `null`, this account does not support mail, and any use of the mail-related methods with this account will result in an `accountNoMail` error. Otherwise, it will be an object describing certain capabilities of the mail system.
-- **contacts**: `ContactsCapabilities|null`
-  If `null`, this account does not support contacts, and any use of the contacts-related methods with this account will result in an `accountNoContacts` error. Otherwise, it will be an object describing certain capabilities of the contacts system.
-- **calendars**: `CalendarsCapabilities|null`
-  If `null`, this account does not support calendars, and any use of the calendar-related methods with this account will result in an `accountNoCalendars` error. Otherwise, it will be an object describing certain capabilities of the calendars system.
-
-An **AccountCapabilities** object has the following properties:
-
-- **maxSizeUpload**: `Number`
-  The maximum file size, in bytes, that the server will accept for a single file upload (for any purpose).
-
-A **MailCapabilities** object has the following properties:
-
-- **isReadOnly**: `Boolean`
-  True if the user has read-only access to the mail in this account. The user may not use the `set`-type mail methods with this account.
-- **maxSizeMessageAttachments**: `Number`
-  The maximum total size of attachments, in bytes, allowed for messages. A server MAY still reject messages with a lower attachment size total (for example, if the body includes several megabytes of text, causing the size of the encoded MIME structure to be over some server-defined limit).
-- **canDelaySend**: `Boolean`
-  Does the server support inserting a message into the outbox to be sent later at a user-specified time?
-- **messageListSortOptions**: `String[]`
-  A list of all the message properties the server supports for sorting by. This MAY include properties the client does not recognise (for example custom properties specified in the vendor extension). Clients MUST just ignore any unknown properties in the list.
-
-A **ContactsCapabilities** object has the following properties:
-
-- **isReadOnly**: `Boolean`
-  True if the user has read-only access to the contacts in this account. The user may not use the `set`-type contacts methods with this account.
-
-A **CalendarsCapabilities** object has the following properties:
-
-- **isReadOnly**: `Boolean`
-  True if the user has read-only access to the calendars in this account. The user may not use the `set`-type calendar methods with this account.
-
-The AccountCapabilities, MailCapabilities, ContactsCapabilities and CalendarsCapabilities objects MAY also contain one or more properties prefixed with "vnd-" + a name that uniquely identifies the vendor. For example `"vnd-com.fastmail"`. The value type for these properties is undefined. These properties allow vendors to be able to inform their own clients of custom capabilities. Unknown properties of this form MUST be ignored by clients.
-
-### getAccounts
-
-To fetch the complete list of accounts to which the user has access, make a call to `getAccounts`. It takes a sole, optional argument:
-
-- **sinceState**: `String|null`
-  This is the `state` string from a previous call to *getAccounts*.
-
-The response to *getAccounts* is called *accounts*. It has the following arguments:
-
-- **state**: `String`
-   A string representing the state on the server for **all** the data contained within the Account objects. If the data changes, this string will change.
-- **list**: `Account[]|null`
-  An array of all Account objects. If *sinceState* was supplied and it is identical to the current state, this property is `null`.
-
-The following errors may be returned instead of the `accounts` response:
-
-`invalidArguments`: Returned if the `sinceState` argument is included and has the wrong type.
-
-Example of a successful request:
-
-    ["getAccounts", {}, "#0"]
-
-and response:
-
-    [ "accounts", {
-      "state": "f6a7e214",
-      "list": [
-        {
-          "id": "6asf5",
-          "name": "user@example.com",
-          "isPrimary": true,
-          "capabilities": {
-            maxSizeUpload: 1000000000
-          },
-          "mail": {
-            "isReadOnly": false,
-            "maxSizeMessageAttachments": 50000000,
-            "canDelaySend": true,
-            "messageListSortOptions": [
-              "id", "date", "subject", "from", "to",
-              "isUnread", "isPinned", "threadUnread", "threadPinned"
-            ],
-          },
-          "contacts": {
-            "isReadOnly": false
-          },
-          "calendars": {
-            "isReadOnly": false
-          }
-        },
-        {
-          "id": "e12e1a",
-          "name": "shared.user@example.com",
-          "isPrimary": false,
-          "capabilities": {
-            maxSizeUpload: 0
-          },
-          "mail": null,
-          "contacts": null,
-          "calendars": {
-            "isReadOnly": true
-          }
-        }
-      ]
-    }, "#0" ]
diff --git a/server/protocols/jmap-draft/doc/specs/spec/apimodel.mdwn b/server/protocols/jmap-draft/doc/specs/spec/apimodel.mdwn
deleted file mode 100644
index 2498640cb1..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/apimodel.mdwn
+++ /dev/null
@@ -1,259 +0,0 @@
-# JMAP: The Spec
-
-<div id="last-update">Last updated 2016-01-15</div>
-
-This is a specification. It is meant to be readable but it also has to be comprehensive, so it can be dense in places. If you want to get a quick idea of how JMAP works, you should probably read the [guide for client developers](client.html) first. This has lots of example exchanges and should give you a good feel for what JMAP is all about. The spec is heavier going; it attempts to document exactly what each method should do, and what should happen in a myriad of edge cases.
-
-There are undoubtably edge cases that are not yet covered. If you find one, please email <ed...@jmap.io> or make a pull request on GitHub if you have a proposed fix.
-
-The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119](https://tools.ietf.org/html/rfc2119).
-
-## The JSON API model
-
-JSON is a text-based data interchange format as specified in [RFC7159](https://tools.ietf.org/html/rfc7159). The I-JSON format defined in [RFC7493](https://tools.ietf.org/html/rfc7493) is a strict subset of this, adding restrictions to avoid potentially confusing scenarios (for example, it mandates that an object MUST NOT have two properties with the same key). All data sent from the client to the server or from the server to the client MUST be valid I-JSON according to the RFC, encoded  [...]
-
-### The structure of an exchange
-
-The client initiates an API request by sending the server a JSON array. Each element in this array is another array representing a method invocation on the server. The server will process the method calls and return a response consisting of an array in the same format. Each method call always contains three elements:
-
-1. The **name** of the method to call, or the name of the response from the server. This is a `String`.
-2. An `Object` containing *named* **arguments** for that method or response.
-3. A **client id**: an arbitrary `String` to be echoed back with the responses emitted by that method call (as we'll see lower down, a method may return 1 or more responses, as some methods make implicit calls to other ones).
-
-Example query:
-
-    [
-      ["method1", {"arg1": "arg1data", "arg2": "arg2data"}, "#1"],
-      ["method2", {"arg1": "arg1data"}, "#2"],
-      ["method3", {}, "#3"]
-    ]
-
-The method calls MUST be processed sequentially, in order. Each API request
-(which, as shown, may contain multiple method calls) receives a JSON
-response in exactly the same format. The output of the methods MUST be added
-to the array in the same order as the methods are processed.
-
-Example response:
-
-    [
-      ["responseFromMethod1", {"arg1": 3, "arg2": "foo"}, "#1"],
-      ["responseFromMethod2", {"isBlah": true}, "#2"],
-      ["anotherResponseFromMethod2", {"data": 10, "yetmoredata": "Hello"}, "#2"],
-      ["aResponseFromMethod3", {}, "#3"]
-    ]
-
-### Errors
-
-If the data sent as an API request is not valid JSON or does not match the structure above, an error will be returned at the transport level. For example, when using JMAP over HTTP, a `400 Bad Request` error will be returned at the HTTP level.
-
-Possible errors for each method are specified in the method descriptions. If a method encounters an error, an `error` response must be inserted at the current point in the output array and, unless otherwise specified, no further processing must happen within that method.
-
-Any further method calls in the request MUST then be processed as normal.
-
-An `error` response looks like this:
-
-    ["error", {
-      type: "unknownMethod"
-    }, "client-id"]
-
-The response name is `error`, and it has a type property as specified in the method description. Other properties may be present with further information; these are detailed in the method descriptions where appropriate.
-
-If an unknown method is called, an `unknownMethod` error (this is the type shown in the example above) MUST be inserted and then the next method call MUST be processed as normal.
-
-If an unknown argument or invalid arguments (wrong type, or in violation of other specified constraints) are supplied to a method, an `invalidArguments` error MUST be inserted and then the next method call MUST be processed as normal.
-
-### Vendor-specific extensions
-
-Individual services will have custom features they wish to expose over JMAP. This may take the form of extra datatypes and/or methods not in the spec, or extra arguments to JMAP methods, or extra properties on existing data types (which may also appear in arguments to methods that take property names). To ensure compatibility with clients that don't know about a specific custom extension, and for compatibility with future versions of JMAP, the server MUST ONLY expose these extensions if  [...]
-
-Any vendor extensions supported by the server are advertised to the client in the capabilities property on the Account object. The client opt-in happens at the transport layer (see the next section).
-
-### JMAP over HTTPS
-
-To make an API request over HTTP (support for other protocols may be added in future extensions to the spec), the client makes an authenticated POST request to the API URL; see the Authentication section of the spec for how to discover this URL and how to authenticate requests.
-
-The request MUST have a content type of `application/json` and be encoded in utf-8.
-
-The request MAY include an `X-JMAP-Version` header, the value of which is a number for the spec version the client would like to use (the list of versions supported by each account can be discovered by the client by inspecting the capabilities property of the Account object). If omitted, the server MUST presume a value equal to the *lowest* supported version common to all accounts.
-
-The request MAY include an 'X-JMAP-Extensions' header, the value of which is a comma-separated list of 'vendor-extension-name:extension-version` the client would like to use. For example, "com.fastmail.message:1,com.fastmail.savedSearch:4". Any white-space should be ignored when evaluating this header.
-
-The server will respond with one of the following HTTP response codes:
-
-#### `200`: OK
-
-The API request was successful. The response will be of type `application/json` and consists of the response to the API calls, as described above.
-
-#### `400`: Bad Request
-
-The request was malformed. For example, it may have had the wrong content type, or have had a JSON object that did not conform to the API calling structure (see *The structure of an exchange* above). The client SHOULD NOT retry the same request.
-
-#### `401`: Unauthorized
-
-The `Authorization` header was missing or did not contain a valid token. Reauthenticate and then retry the request. There is no content in the response.
-
-#### `404`: Not Found
-
-The API endpoint has moved. See the Authentication section of the spec for how to rediscover the current URL to use. There is no content in the response.
-
-#### `412`: Precondition Failed
-
-This means either the JMAP version specified in an `X-JMAP-Version` header, or an extension/version specified in an `X-JMAP-Extensions` header is not supported by one of the accounts used in a method.
-
-After authentication, but before processing any methods, the server MUST scan the methods in the request and check the requested JMAP version and extensions are supported by all the accounts referenced by the methods (unknown account ids MUST just be skipped; these method calls will error out when processed). If there are any accounts that do not support the requested version and extensions, this HTTP error code is returned and the server MUST NOT process any of the methods.
-
-#### `500`: Internal Server Error
-
-Something has gone wrong internally, and the server is in a broken state. Don't automatically retry. There is no content in the response.
-
-#### `503`: Service Unavailable
-
-The server is currently down. Try again later with exponential backoff. There is no content in the response.
-
-### Security
-
-As always, the server must be strict about data received from the client. Arguments need to be checked for validity; a malicious user could attempt to find an exploit through the API. In case of invalid arguments (unknown/insufficient/wrong type for data etc.) the method should return an `invalidArguments` error and terminate.
-
-### Concurrency
-
-To ensure the client always sees a consistent view of the data, the state accessed by a method call MUST NOT change during the execution of the method, except due to actions by the method call itself. The state MAY change in-between method calls (even within a single API request).
-
-### The Number datatype
-
-The JSON datatypes are limited to those found in JavaScript. A `Number` in JavaScript is represented as a signed double (64-bit floating point). However, except where explicitly specified, all numbers used in this API are unsigned integers <= 2^53 (the maximum integer that may be reliably stored in a double). This implicitly limits the maximum length of message lists in queries and the like.
-
-### The Date datatypes
-
-Where the API specifies `Date` as a type, it means a string in [RFC3339](https://tools.ietf.org/html/rfc3339) *date-time* format, with the *time-offset* component always `Z` (i.e. the date-time MUST be in UTC time) and *time-secfrac* always omitted. The "T" and "Z" MUST always be upper-case. For example, `"2014-10-30T14:12:00Z"`.
-
-Where the API specifies `LocalDate` as a type, it means a string in the same format as `Date`, but with the `Z` omitted from the end. This only occurs in relation to calendar events. The interpretation in absolute time depends upon the time zone for the event, which MAY not be a fixed offset (for example when daylight saving time occurs).
-
-### Use of `null`
-
-Unless otherwise specified, a missing property in a request, response or object MUST be intepreted exactly the same as that property having the value `null`. If `null` is not a valid value for that property this would typically cause an error to occur. This rule does not apply to the [top-level datatypes](#data-model-overview), where a missing property usually indicates that the sender wants to leave the existing property value untouched (e.g. in a [*setFoos*](#setfoos) request or a [*ge [...]
-
-### CRUD methods
-
-JMAP defines various types of objects and provides a uniform interface for creating, retrieving, updating and deleting them. A **data type** is a collection of named, typed properties, just like the schema for a database table. Each row of the table is a **record**. For a `Foo` data type, records of that type would be fetched via a `getFoos` call and modified via a `setFoos` call. Delta updates may be fetched via a `getFooUpdates` call. These methods all follow a standard format as descr [...]
-
-### getFoos
-
-Objects of type **Foo** are fetched via a call to *getFoos*. Methods with a name starting with `get` MUST NOT alter state on the server.
-
-This method may take some or all of the following arguments. The getter for a particular data type may not implement all of the arguments (for example if the data type only has two properties, there is little point in being able to just return one of them etc.); see the docs of the type in question. However, if one of the following arguments is available, it will behave exactly as specified below.
-
-- **ids**: `String[]|null`
-  The ids of the Foo objects to return. If `null` then **all** records of the data type are returned.
-- **properties**: `String[]|null`
-  If supplied, only the properties listed in the array are returned for each Foo object. If `null`, all properties of the object are returned. The id of the object is **always** returned, even if not explicitly requested.
-- **sinceState**: `String|null`
-  The *state* argument from a *foos* response may be passed back to future *getFoos* calls as the *sinceState* argument. If the current state is the same, the server SHOULD skip fetching the records and return a result indicating there is no change (this is essentially like an ETag). Most types support the more sophisticated *getFooUpdates* call instead to allow for delta updates. However, for small collections of data that change infrequently, this might be used. If available, this argu [...]
-
-The response to `getFoos` is called `foos`. It has the following arguments:
-
-- **state**: `String`
-  A string representing the state on the server for **all** the data of this type. If the data changes, this string will change. It is used to get delta updates, if supported for the type.
-- **list**: `Foo[]|null`
-  An array of the Foo objects requested. This is the **empty array** if no objects were requested (and *ids* argument was passed with an empty array), or none were found (the user has no objects of this type, or none of the ids given were valid). If *sinceState* was supplied and it is identical to the current state, this property is `null` (the client already has up to date data so the server may skip returning it).
-- **notFound**: `String[]|null`
-  This array contains the ids passed to the method for records that do not exist, or `null` if all requested ids were found. It will always be `null` if the *ids* argument in the call was `null`.
-
-The following error may be returned instead of the `foos` response:
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### getFooUpdates
-
-When the state of the set of Foo records changes on the server (whether due to creation, updates or deletion), the *state* property of the *foos* response will change. The *getFooUpdates* call allows a client to efficiently update the state of any its Foo cache to match the new state on the server. It takes the following arguments:
-
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *foos* response. The server will return the changes made since this state.
-- **maxChanges**: `Number|null`
-  The maximum number of Foo ids to return in the response. The server MAY choose to clamp this value to a particular maximum or set a maximum if none is given by the client. If supplied by the client, the value MUST be a positive integer greater than 0. If a value outside of this range is given, the server MUST reject the call with an `invalidArguments` error.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting the *fooUpdates* response, the server will make an implicit call to *getFoos* with the *changed* property of the response as the *ids* argument. If `false` or `null`, no implicit call will be made.
-- **fetchRecordProperties**: `String[]|null`
-  If the *getFoos* method takes a *properties* argument, this argument is passed through on implicit calls (see the *fetchRecords* argument).
-
-The response to *getFooUpdates* is called *fooUpdates*. It has the following arguments:
-
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **hasMoreUpdates**: `Boolean`
-  If `true`, the client may call *getFooUpdates* again with the *newState* returned to get further updates. If `false`, *newState* is the current server state.
-- **changed**: `String[]`
-  An array of Foo ids for records which have been created or changed but not destroyed since the oldState.
-- **removed**: `String[]`
-  An array of Foo ids for records which have been destroyed since the old state.
-
-The *maxChanges* argument (and *hasMoreUpdates* response argument) is available for data types with potentially large amounts of data (i.e. those for which there is a *getFooList* method available for loading the data in pages).  If a *maxChanges* is supplied, or set automatically by the server, the server must try to limit the number of ids across *changed* and *removed* to the number given. If there are more changes than this between the client's state and the current server state, the [...]
-
-If a Foo record has been modified AND deleted since the oldState, the server should just return the id in the *removed* response, but MAY return it in the changed response as well. If a Foo record has been created AND deleted since the oldState, the server should remove the Foo id from the response entirely, but MAY include it in the *removed* response, and optionally the *changed* response as well.
-
-The following errors may be returned instead of the *fooUpdates* response:
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old, or the server being unable to produce an update to an intermediate state when there are too many updates. The client MUST invalidate its Foo cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setFoos
-
-Modifying the state of Foo objects on the server is done via the *setFoos* method. This encompasses creating, updating and destroying Foo records. This has two benefits:
-
-1. It allows the server to sort out ordering and dependencies that may exist if doing multiple operations at once (for example to ensure there is always a minimum number of a certain record type).
-2. Only a single call is required to make all changes to a particular type, so the *ifInState* requirement will not be invalidated by a previous method call in the same request.
-
-The *setFoos* method takes the following arguments:
-
-- **ifInState**: `String|null`
-  This is a state string as returned by the *getFoos* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned. If `null`, the change will be applied to the current state.
-- **create**: `String[Foo]|null`
-  A map of *creation id* (an arbitrary string set by the client) to Foo objects (containing all properties except the id, unless otherwise stated in the specific documentation of the data type). If `null`, no objects will be created.
-- **update**: `String[Foo]|null`
-  A map of id to a Foo object. The object may omit any property; only properties that have changed need be included. If `null`, no objects will be updated.
-- **destroy**: `String[]|null`
-  A list of ids for Foo objects to permanently delete. If `null`, no objects will be deleted.
-
-Each create, update or destroy is considered an atomic unit. It is permissible for the server to commit some of the changes but not others, however it is not permissible to only commit part of an update to a single record (e.g. update a *name* property but not a *count* property, if both are supplied in the update object).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-If an id given cannot be found, the update or destroy MUST be rejected with a `notFound` set error.
-
-Some record objects may hold references to others (foreign keys). When records are created or modified, they may reference other records being created *in the same API request* by using the creation id prefixed with a `#`. The order of the method calls in the request by the client MUST be such that the record being referenced is created in the same or an earlier call. The server thus never has to look ahead. Instead, while processing a request (a series of method calls), the server MUST  [...]
-
-The response to *setFoos* is called *foosSet*. It has the following arguments:
-
-- **oldState**: `String|null`
-  The state string that would have been returned by *getFoos* before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by *getFoos*.
-- **created**: `String[Foo]`
-  A map of the creation id to an object containing any **server-assigned** properties of the Foo object (including the id) for all successfully created records.
-- **updated**: `String[]`
-  A list of Foo ids for records that were successfully updated.
-- **destroyed**: `String[]`
-  A list of Foo ids for records that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each record that failed to be created. The possible errors are defined in the description of the method for specific data types.
-- **notUpdated**: `String[SetError]`
-  A map of Foo id to a SetError object for each record that failed to be updated. The possible errors are defined in the description of the method for specific data types.
-- **notDestroyed**: `String[SetError]`
-  A map of Foo id to a SetError object for each record that failed to be destroyed. The possible errors are defined in the description of the method for specific data types.
-
-A **SetError** object has the following properties:
-
-- **type**: `String`
-  The type of error.
-- **description**: `String|null`
-  A description of the error to display to the user.
-
-Other properties may also be present on the object, as described in the relevant methods.
-
-The following errors may be returned instead of the `foosSet` response:
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an `ifInState` argument was supplied and it does not match the current state.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/authentication.mdwn b/server/protocols/jmap-draft/doc/specs/spec/authentication.mdwn
deleted file mode 100644
index 25e2c64a3a..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/authentication.mdwn
+++ /dev/null
@@ -1,193 +0,0 @@
-## Authentication
-
-Before connecting to any JMAP service, the client must first gain an access token. It cannot just use a username/password directly. This allows the server to know (and show the user) which clients currently have access to the account, and to be able to revoke access individually.
-
-The server may support multiple different mechanisms for authenticating a user to gain the access token. It is expected that further types may be added in future extensions to the JMAP specification (for example [FIDO](https://fidoalliance.org/)).
-
-### Service autodiscovery
-<aside class="warning">
-Not implemented
-</aside>
-
-There are three common autodiscovery methods in use for internet protocols:
-
-- **DNS srv**
-  See [RFC6186](https://tools.ietf.org/html/rfc6186) and [RFC6764](https://tools.ietf.org/html/rfc6764)
-- **.well-known/`servicename`**
-  See [RFC5785](https://tools.ietf.org/html/rfc5785)
-- **autoconfig.example.com**/**autodiscover.example.com**
-  Used by [Thunderbird](https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo) and Outlook.
-
-A JMAP-supporting email host for the domain `example.com` SHOULD publish a SRV record `_jmaps._tcp.example.com` which gives a hostname and port (usually port `443`).
-
-The authentication URL is `https://hostname/.well-known/jmap` (following any redirects).
-
-Other autodiscovery options using `autoconfig.example.com` or `autodiscover.example.com` may be added to a future version of JMAP to support clients which can't use SRV lookup.
-
-### Getting an access token
-<aside class="notice">
-Partially supported
-</aside>
-
-Authorization always starts with the client making a POST request to the authentication URL (found either via service autodiscovery or manual entry). The request MUST be of type `application/json` and specify an `Accept: application/json` header. The body of the request MUST be a single JSON object, encoded in UTF-8, with the following properties:
-
-- **username**: `String`
-  The username the client wishes to authenticate. This is normally the primary email address of the user.
-- **clientName**: `String`
-  The name of the client software. e.g. `Mozilla Thunderbird`.
-- **clientVersion**: `String`
-  Information to identify the version of the client.  This MUST change for any changed client code (e.g. a version control tag or counter for development software) and SHOULD sort lexically later for newer versions.
-- **deviceName**: `String`
-  A human-friendly string to identify the device making the request, e.g. "Joe Blogg's iPhone".
-
-The server may use the client/device information to help identify the login to the user in a login log or other security reporting. Although hopefully unnecessary, they may also be helpful for working around client bugs in the future.
-
-The server will respond with one of the following HTTP status codes:
-
-#### `200`: Success, but more authorization required.
-
-The response body will be a single JSON object with the following properties.
-
-- **continuationToken**: `String`
-  A token from the server to allow it to connect the next request with previous requests in the login process. This SHOULD be of limited time validity (e.g. 15 minutes from previous call).
-- **methods**: `String[]`
-  A list of the supported authentication methods to continue with authentication. This will often have only have one item in it. Allowed values are `"password"`, `"external"` and `"oauth"`. More options may be added in future extensions to JMAP.
-<aside class="warning">
-Support only `"password"`
-The client can also use OAuth by providing a header in the request such as this:
-`Authorization: Bearer JWT_TOKEN`
-</aside>
-- **prompt**: `String|null`
-  A message to display in the client to the user.
-
-This is the standard response to an initial request. Note, a server may return this even if the username is not actually active, to prevent enumeration. The client should then pick one of the *methods* from the list in the response to continue with authentication (if no methods supported by the client are in the list, it will not be able to log in to this account):
-
-- `"password"`: the client should prompt the user for a password. If the `prompt` property is non-null, this message should be displayed to the user to explain what input is required. The prompt MUST be treated as plain text, but the client SHOULD automatically hyperlink any URLs it finds in the text if a system browser is available. If `prompt == null`, the client SHOULD just show a generic password prompt message.
-- `"external"`: the user must do something out-of-band to authorize the app. The server SHOULD return a prompt string to display to the user to tell them what they need to do. Again, the client MUST treat the prompt as plain text, but SHOULD automatically hyperlink any URLs it finds if a system browser is available. The client MUST also offer a continue button (or similar) for the user to indicate to the client when they have completed the out-of-band authentication.
-- `"oauth"`: OAuth based authentication. For OAuth integration, see the docs of the service in question, since every service implements it slightly differently and the client must register with the service beforehand to use it. If using this method, an access token is obtained entirely through the OAuth mechanism. See the "Refetching URL endpoints" section below for how to obtain the URL endpoints after successfully authenticating using OAuth.
-
-If using `"password"` or `"external"`, the user will at some point indicate to the client to continue authentication. At this point the client submits a POST request to the same URL as before, with the body being a single JSON object with the following properties:
-
-- **token**: `String`
-  The *continuationToken* the server sent from the previous request.
-- **method**: `String`
-  The method chosen to continue authentication.
-- **password**: `String` (optional)
-  The password entered by the user (if `method == password`). The client SHOULD NOT store the password the user entered beyond what is required to submit it to the server in this step.
-
-The server will then return one of the same set of responses as before, which should be handled the same (for example, if 2FA is required, a `200` response may be returned again and a second password prompted for, with a `prompt` text explaining to the user that a one-time password has been SMSed to them).
-
-#### `201`: Authentication is complete, access token created.
-
-The response body will be a single JSON object with the following properties.
-
-- **versions**: `Number[]`
-  The list of supported JMAP-spec versions. If the client does not opt in to a particular version, then the lowest/oldest version in the list will be used by the server.
-- **extensions**: `String[Number[]]`
-  As described in the API Model, specific vendors may need to add custom extensions to the JMAP protocol, including new datatypes, extra properties on existing datatypes and extra methods. To ensure compability, these extensions must be explicitly opted into by the client.
-
-  The *extensions* property is a map of a name that uniquely identifies the extension (including a unique string identifying the vendor) to a list of version numbers supported for that extension. e.g. `"com.fastmail.message": [ 1 ]`.
-
-  A client may opt in to an extension by sending `"extension-name:extension-version"` in the `X-JMAP-Extensions` header of the request (or as specified for any future non-HTTP transport). It is up to the vendor to document exactly what the extension provides.
-
-  It is expected that this mechanism is mainly used for custom clients by the vendor for their own server. Where features are added that are more universally useful, it is hoped they will quickly be standardised in a future version of this spec, to maintain open compatibility between vendors.
-- **accessToken**: `String`
-  The secret token to be used by the client to authenticate all future JMAP requests. The client should keep this secure, preferably in an OS keychain or the like. Since tokens should not be reused across devices or clients, the client SHOULD NOT reveal this token to the user.
-- **api**: `String`
-  The URL to use for JMAP API requests.
-- **eventSource**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The URL to connect to for push events (see the Push section of this spec).
-- **upload**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The URL endpoint to use when uploading files (see the Upload section of this spec).
-- **download**: `String`
-  <aside class="warning">
-  Download endpoint does not handle name, it's not secured by any access protection and any authenticated user can get any attachment without restriction.</aside>
-  The URL endpoint to use when downloading files, in [RFC6570 URI Template](https://tools.ietf.org/html/rfc6570) (level 1) format. The URL MUST contain a variable called `blobId`. The URL SHOULD contain a variable called `name`. The client may use this template in combination with a blobId to download any binary data (files) referenced by other objects. Since a blob is not associated with a particular name, the template SHOULD allow a name to be substituted in as well; the server will re [...]
-
-URLs are returned only after logging in. This allows different URLs to be used for users located in different geographic datacentres within the same service.
-
-Note, if authentication is done via IP or mobile subscriber ID or some similar mechanism, a `201` response MAY be returned in response to the initial request (with just the username and client info).
-
-#### `400`: Malformed request
-
-The request is of the wrong content type, or does not contain data in the expected format. The client MUST NOT retry the same request.
-
-#### `401`: Authentication step failed
-
-Returned in response to a continuation request which failed (e.g. the password entered was not correct, or the out-of-band step was not completed successfully). The response body will be a single JSON object with the same properties as the `200` response.
-
-#### `403`: Restart authentication
-
-This normally means the continuation token has expired, but it can be returned for any other reason. The client MUST restart authentication (go back to sending the username and client info to the server).
-
-#### `429`: Rate limited
-
-Returned if the server is temporarily blocking this IP/client from authenticating. This may be due to too many failed password attempts, or detected username enumeration attempts, or any other reason. (Legitimate) clients should wait a while then try again.
-
-### Refetching URL endpoints
-
-A server MAY (although SHOULD NOT) move end points for any services other than authentication at any time. If a request to the API/file upload/event source endpoint returns a `404`, the client MUST refetch the URL endpoints. To do this, it should make an authenticated GET request to the authentication URL (see below for how to authenticate requests).
-
-For OAuth logins, this is how the URLs may be fetched initially as well.
-
-The server MUST respond with one of the following status codes:
-
-#### `200`: OK
-
-The request was successful. The response will be of type `application/json` and consists of a single JSON object containing the following properties:
-
-- **versions**: `Number[]`
-  The list of JMAP-spec versions supported by the account.
-- **extensions**: `String[Number[]]`
-  Map of extension names to version number of that extension (see above).
-- **api**: `String`
-  The URL to use for JMAP API requests.
-- **eventSource**: `String`
-  The URL to connect to for push events (see the Push section of this spec).
-- **upload**: `String`
-  The URL endpoint to use when uploading files (see the Upload section of this spec).
-- **download**: `String`
-  The URL endpoint to use when downloading files (see above).
-
-#### `401`: Unauthorized
-
-The `Authorization` header was missing or did not contain a valid token. Reauthenticate and then retry the request. There is no content in the response.
-
-#### `404`: Not Found
-
-The JMAP server is no longer here. There is no content in the response.
-
-#### `500`: Internal Server Error
-
-Something has gone wrong internally, and the server is in a broken state. Don't automatically retry. There is no content in the response.
-
-#### `503`: Service Unavailable
-
-The server is currently down. Try again later with exponential backoff. There is no content in the response.
-
-### Revoking an access token
-<aside class="notice">
-Tokens only have an expiration time of 15 minutes.
-</aside>
-
-The validity of an access token is determined by the server. It may be valid for a limited time only, or expire after a certain time of inactivity, or be valid indefinitely etc. If an access token expires, it MUST NOT be resurrected. The client MUST restart the authentication process to get a new access token.
-
-A client may revoke an access token at any time by making a DELETE HTTP request to the authentication URL (used to get the token in the first place), with the correct `Authorization` header (see below). The response from the server will be one of the following:
-
-`204`: Success (the access token has now been revoked).
-
-`401`: Failed due to due to no `Authorization` header, or `Authorization` header is not a valid access token.
-
-No content is returned in either case.
-
-For OAuth, see the provider's documentation on revoking access tokens.
-
-### Authenticating HTTP requests
-
-All HTTP requests other than to the authentication URL must be authenticated. To do this, the client MUST add an `Authorization` header to each request with the value being the access token. This applies to OAuth tokens too, but see the provider's documentation for the details of what value to use for the header.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/calendar.mdwn b/server/protocols/jmap-draft/doc/specs/spec/calendar.mdwn
deleted file mode 100644
index 1e78fc9ec6..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/calendar.mdwn
+++ /dev/null
@@ -1,195 +0,0 @@
-## Calendars
-<aside class="warning">
-Not implemented
-</aside>
-
-A Calendar is a named collection of events. All events are associated with one, and only one, calendar.
-
-A **Calendar** object has the following properties:
-
-- **id**: `String`
-  The id of the calendar. This property is immutable.
-- **name**: `String`
-  The user-visible name of the calendar. This may be any UTF-8 string of at least 1 character in length and maximum 256 bytes in size.
-- **color**: `String`
-  Any valid CSS color value. The color to be used when displaying events associated with the calendar. The color SHOULD have sufficient contrast to be used as text on a white background.
-- **sortOrder**: `Number`
-  Defines the sort order of calendars when presented in the UI, so it is
-  consistent between devices. The number MUST be an integer in the range
-  0 <= sortOrder < 2^31.
-
-  A calendar with a lower order should be displayed before a calendar with
-  a higher order in any list of calendars in the client's UI. Calendars with
-  equal order should be sorted in alphabetical order by name. The sorting
-  should take into locale-specific character order convention.
-- **isVisible**: `Boolean`
-  Should the calendar's events be displayed to the user at the moment?
-- **mayReadFreeBusy**: `Boolean`
-  The user may read the free-busy information for this calendar. In JMAP
-  terms, this means the user may use this calendar as part of a filter in a
-  *getCalendarEventList* call, however unless `mayRead == true`, the events
-  returned for this calendar will only contain free-busy information, and be stripped of any other data.
-  This property MUST be `true` if *mayRead* is `true`.
-- **mayReadItems**: `Boolean`
-  The user may fetch the events in this calendar. In JMAP terms, this means
-  the user may use this calendar as part of a filter in a
-  *getCalendarEventList* call
-- **mayAddItems**: `Boolean`
-  The user may add events to this calendar. In JMAP terms, this means the
-  user may call *setCalendarEvents* to create new events in this calendar or
-  move existing events into this calendar from another calendar.
-  This property MUST be `false` if the account to which this calendar belongs
-  has the *isReadOnly* property set to `true`.
-- **mayModifyItems**: `Boolean`
-  The user may edit events in this calendar by calling *setCalendarEvents* with
-  the *update* argument referencing events in this collection.
-  This property MUST be `false` if the account to which this calendar belongs
-  has the *isReadOnly* property set to `true`.
-- **mayRemoveItems**: `Boolean`
-  The user may remove events from this calendar by calling *setCalendarEvents*
-  with the *destroy* argument referencing events in this collection, or by
-  updating their *calendarId* property to a different calendar.
-  This property MUST be `false` if the account to which this calendar belongs
-  has the *isReadOnly* property set to `true`.
-- **mayRename**: `Boolean`
-  The user may rename the calendar.
-  This property MUST be `false` if the account to which this calendar belongs
-  has the *isReadOnly* property set to `true`.
-- **mayDelete**: `Boolean`
-  The user may delete the calendar itself.
-  This property MUST be `false` if the account to which this calendar belongs
-  has the *isReadOnly* property set to `true`.
-
-
-### getCalendars
-
-Calendars can either be fetched explicitly by id, or all of them at once. To fetch calendars, make a call to `getCalendars`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The Account to fetch the calendars for. If `null`, the primary account is used.
-- **ids**: `String|null`
-  The ids of the calendars to fetch. If `null`, all calendars in the account are be fetched.
-
-The response to *getCalendars* is called *calendars*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **state**: `String`
-  A string representing the state on the server for **all** calendars. If a property of a calendar changes, or a new calendar is created, or a calendar is destroyed, this string will change. It is used to get delta updates.
-- **list**: `Calendar[]`
-  An array of the Calendar objects requested. This will be the **empty array** if the *ids* argument was the empty array, or contained only ids for calendars that could not be found.
-- **notFound**: `String[]|null`
-  This array contains the ids passed to the method for calendars that do not exist, or `null` if all requested ids were found. It will always be `null` if the *ids* argument in the call was `null`.
-
-The following errors may be returned instead of the *calendars* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### getCalendarUpdates
-
-The *getCalendarUpdates* call allows a client to efficiently update the state of its cached calendars to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *calendars* response. The server will return the changes made since this state.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting a *calendarUpdates* response, an implicit call will be made to *getCalendars* with the *changed* property of the response as the *ids* argument. If `false` or `null`, no implicit call will be made.
-
-The response to *getCalendarUpdates* is called *calendarUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **changed**: `String[]`
-  An array of Calendar ids where a property of the calendar has changed between the old state and the new state, or the calendar has been created, and the calendar has not been destroyed.
-- **removed**: `String[]`
-  An array of Calendar ids for calendars which have been destroyed since the old state.
-
-If a calendar has been modified AND deleted since the oldState, the server should just return the id in the *removed* array, but MAY return it in the *changed* array as well. If a calendar has been created AND deleted since the oldState, the server SHOULD remove the calendar id from the response entirely, but MAY include it in the *removed* array, and optionally the *changed* array as well.
-
-The following errors may be returned instead of the `calendarUpdates` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old. The client MUST invalidate its Calendar cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setCalendars
-
-Modifying the state of Calendar objects on the server is done via the *setCalendars* method. This encompasses creating, updating and destroying Calendar records.
-
-The *setCalendars* method takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **ifInState**: `String|null`
-  This is a state string as returned by the *getCalendars* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned.
-- **create**: `String[Calendar]|null`
-  A map of *creation id* (an arbitrary string set by the client) to Calendar objects (containing all properties except the id).
-- **update**: `String[Calendar]|null`
-  A map of id to a Calendar object. The object may omit any property; only properties that have changed need be included.
-- **destroy**: `String[]|null`
-  A list of ids for Calendar objects to permanently delete.
-
-Each create, update or destroy is considered an atomic unit. It is permissible for the server to commit some of the changes but not others, however it is not permissible to only commit part of an update to a single calendar (e.g. update the *name* property but not the *isVisible* property if both are supplied in the update object).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-If an id given cannot be found, the update or destroy MUST be rejected with a `notFound` set error.
-
-The *mayXXX* properties are optional when creating a calendar. All default to `true`. If present, they MUST all be set to `true`. These properties are *read-only* to the client and may not be modified in an update call. Restrictions may only be set by the server, or when sharing calendars with other accounts (setting up sharing is not yet defined in this spec).
-
-A calendar MAY be deleted that is currently associated with one or more events. In this case, the events belonging to this calendar MUST also be deleted. Conceptually, this MUST happen prior to the calendar itself being deleted, and MUST generate a **push** event that modifies the state of the *CalendarEvent* type for the account, and has a *clientId* of `null`, to indicate that a change has been made to the event data not explicitly requested by the client.
-
-The response to *setCalendars* is called *calendarsSet*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String|null`
-  The state string that would have been returned by *getCalendars* before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by *getCalendars*.
-- **created**: `String[Calendar]`
-  A map of the creation id to an object containing the **id** property for all successfully created calendars.
-- **updated**: `String[]`
-  A list of ids for groups that were successfully updated.
-- **destroyed**: `String[]`
-  A list of ids for calendars that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each calendar that failed to be created. The possible errors are defined in the description of the method for specific data types.
-- **notUpdated**: `String[SetError]`
-  A map of Calendar id to a SetError object for each calendar that failed to be updated. The possible errors are defined in the description of the method for specific data types.
-- **notDestroyed**: `String[SetError]`
-  A map of Calendar id to a SetError object for each calendar that failed to be destroyed. The possible errors are defined in the description of the method for specific data types.
-
-A **SetError** object has the following properties:
-
-- **type**: `String`
-  The type of error.
-- **description**: `String|null`
-  A description of the error to display to the user.
-
-If any of the properties in a create or update are invalid (immutable and different to the current server value, wrong type, invalid value for the property – like a zero-length *name*), the server MUST reject the create/update with a SetError of type `invalidProperties`. The SetError object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user- [...]
-
-The following errors may be returned instead of the *calendarEventsSet* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an *ifInState* argument was supplied and it does not match the current state.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/calendarevent.mdwn b/server/protocols/jmap-draft/doc/specs/spec/calendarevent.mdwn
deleted file mode 100644
index a099011df5..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/calendarevent.mdwn
+++ /dev/null
@@ -1,305 +0,0 @@
-## Calendar Events
-<aside class="warning">
-Not implemented
-</aside>
-
-A CalendarEvent contains information about an event, or recurring series of events, that takes place at a particular time. The object is designed to be easily convertible to/from iCalendar format ([RFC 5545](https://tools.ietf.org/html/rfc5545)) for compatibility with existing calendaring systems.
-
-A **CalendarEvent** object has the following properties:
-
-- **id**: `String`
-  The id of the event. This property is immutable.
-- **calendarId**: `String`
-  The id of the calendar this event belongs to.
-- **summary**: `String`
-  A short summary of the event. This maps to the SUMMARY property in iCalendar.
-- **description**: `String`
-  A longer form description of the event. This is plain text, not HTML, but
-  a client *should* attempt to mark up URLs. This maps to the DESCRIPTION property in iCalendar.
-- **location**: `String`
-  Where the event is to take place. This maps to the LOCATION property in iCalendar.
-- **showAsFree**: `Boolean`
-  If true, the even should be ignored when calculating free/busy data for the
-  user. This maps to the TRANSP property in iCalendar (`false <=> OPAQUE`, `true <=> TRANSPARENT`).
-- **isAllDay**: `Boolean`
-  Is the event an all day event, such as a birthday or public holiday? This corresponds to the type (DATE or DATE-TIME) of the DTSTART property in iCalendar.
-- **start**: `LocalDate`
-  The date/time the event would start in the event's time zone. This corresponds to the DTSTART property in iCalendar.
-- **end**: `LocalDate`
-  The date/time the event would end in the event's time zone. This corresponds to the DTSTART/DURATION or DTEND property in iCalendar.
-- **startTimeZone**: `String|null`
-  The [Olsen Time Zone Database](http://www.iana.org/time-zones) name for the timezone the start of the event is actually in, or `null` for floating time. This corresponds to the TZID part of the DTSTART property; if the underlying iCalendar file does not use an Olsen name, the server SHOULD try to guess the correct time zone based on the VTIMEZONE information, or fallback to floating time.
-- **endTimeZone**: `String|null`
-  The [Olsen Time Zone Database](http://www.iana.org/time-zones) name for the timezone the end of the event is actually in, or `null` for floating time. This corresponds to the TZID part of the DTEND property (or DTSTART if not present); if the underlying iCalendar file does not use an Olsen name, the server SHOULD try to guess the correct time zone based on the VTIMEZONE information, or fallback to floating time.
-- **recurrence**: `Recurrence|null`
-  The recurrence rule for the event, or `null` if it does not recur. This corresponds to the RRULE property in iCalendar.
-- **inclusions**: `LocalDate[]|null`
-  List of extra **local** start times to recur on. The list MUST be sorted in date order (oldest first). This corresponds to the RDATE property in iCalendar.
-- **exceptions**: `LocalDate[null|CalendarEvent]|null`
-  An object mapping an occurrence start time (in **local time**, not UTC) to either:
-  - `null`: The occurrence has been deleted. This corresponds to the EXDATE property in iCalendar.
-  - `CalendarEvent`: A partial CalendarEvent object. Any properties in the object override the property of the same name for this occurrence. This corresponds to extra VEVENTs with RECURRENCE-IDs in iCalendar. Allowed properties are:
-    - summary
-    - description
-    - location
-    - showAsFree
-    - start
-    - end
-    - startTimeZone
-    - endTimeZone
-    - alerts
-    - organizer
-    - attendees
-- **alerts**: `Alert[]|null`
-  A list of alerts to display or send the user for this event. This maps to the VALARM property in iCalendar.
-- **organizer**: `Participant|null`
-  The organizer of the event. This maps to the ORGANIZER property in iCalendar
-- **attendees**: `Participant[]|null`
-  A list of attendees at the event. This maps to the ATTENDEE property in iCalendar.
-- **attachments**: `File[]|null`
-  A list of file attachments to the event. This maps to the ATTACH property in iCalendar.
-
-Conditions:
-
-- The *end* date MUST be equal to or after the *start* date when both are converted to UTC time (the event MUST NOT have a negative duration).
-- if *isAllDay* is `true`, the *start*/*end* properties MUST have a time component of `T00:00:00` and *startTimeZone*/*endTimeZone* properties MUST be `null`.
-- if *recurrence* is `null`, *inclusions* and *exceptions* MUST also be `null`.
-- either both organizer and attendees are `null`, or neither are.
-- any `null`able array/object property MUST be `null` rather than an empty array or object.
-
-A **Recurrence** object is a JSON object mapping of a RECUR value type in iCalendar. To make it easier to check if two recurrence rules are identical, optional properties MUST NOT be included if the value is the default. A Recurrence object has the following properties:
-
-- **frequency**: `String`
-  This MUST be one of the following values:
-  - `"yearly"`
-  - `"monthly"`
-  - `"weekly"`
-  - `"daily"`
-  - `"hourly"`
-  - `"minutely"`
-  - `"secondly"`
-  To convert from iCal, simply lower-case the FREQ part.
-- **interval**: `Number` (optional)
-  The INTERVAL part from iCal. Defaults to `1` if not present. This MUST NOT be included if the interval == 1, to ensure a canonical representation. If included, it MUST be an integer `x > 1`.
-- **firstDayOfWeek**: `Number` (optional)
-  The WKST part from iCal. Defaults to `1` (Monday) if not present. This MUST NOT be included if == 1 (Monday), to ensure a canonical representation. It MUST be an integer in the range (0,6), where SU => 0, TU => 2, WE => 3 etc.
-- **byDay**: `Number[]` (optional)
-  The BYDAY part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order. To convert from the iCal string format (e.g. SU,+1MO):
-  1. Convert SU/MO/TU… <-> 0/1/2…
-  2. If it has a number attached (+1, -2 etc.), add on 7 * the attached number.
-  e.g. `+1MO => 1 + (7 * +1) => 8`, `-2TH => 4 + (7 * -2) => -10`
-- **byDate**: `Number[]` (optional)
-  The BYMONTHDAY part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **byMonth**: `Number[]` (optional)
-  The BYMONTH part from iCal, but with Jan == 0, Feb == 1 etc. (Jan == 1 in iCal). The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **byYearDay**: `Number[]` (optional)
-  The BYYEARDAY part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **byWeekNo**: `Number[]` (optional)
-  The BYWEEKNO part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **byHour**: `Number[]` (optional)
-  The BYHOUR part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **byMinute**: `Number[]` (optional)
-  The BYMINUTE part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **bySecond**: `Number[]` (optional)
-  The BYSECOND part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **bySetPosition**: `Number[]` (optional)
-  The BYSETPOS part from iCal. The array MUST have at least one entry if included and MUST be sorted in ascending order.
-- **count**: `Number` (optional)
-  The COUNT part from iCal. This MUST NOT be included if an *until* property is specified.
-- **until**: `LocalDate` (optional)
-  The UNTIL part from iCal. This MUST NOT be included if a *count* property is specified.
-
-An **Alert** Object has the following properties:
-
-- **minutesBefore**: `Number`
-  The number of minutes before the start time of the event to show the alert. The number MAY be negative for an alert after the event start. Note, if the event is in floating time (including all-day events), the server SHOULD use the user's default time zone when determining the start time.
-- **type**: `String`
-  The value MUST be one of the following:
-  - `"email"` – the server will send an email to the user at the specified time. The format of this email is service-specific.
-  - `"alert"` – a message should be shown to the user on any client connected to this account at the specified time.
-
-A **Participant** Object has the following properties:
-
-- **name**: `String`
-  The name of the participant.
-- **email**: `String`
-  The email address of the participant.
-- **isYou**: `Boolean`
-  This is `true` if the participant is the logged in user (determining this is not defined and is server dependent).
-- **rsvp**: `String`
-  The value MUST be one of:
-  - `""`: no RSVP made.
-  - `"yes"`: the participant is attending
-  - `"maybe"`: the participant may be attending
-  - `"no"`: the participant is not attending
-
-A **File** Object has the following properties:
-
-- **blobId**: `String`
-  The id of the binary data.
-- **type**: `String|null`
-  The content-type of the attachment, if known.
-- **name**: `String|null`
-  The full file name, if known. e.g. "myworddocument.doc"
-- **size**: `Number|null`
-  The size, in bytes, of the attachment when fully decoded (i.e. the number of bytes in the file the user would download), if known.
-
-### getCalendarEvents
-
-CalendarEvents can only be fetched explicitly by id. To fetch events, make a call to `getCalendarEvents`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **ids**: `String[]`
-  An array of ids for the events to fetch.
-- **properties**: `String[]|null`
-  A list of properties to fetch for each event. If `null`, all properties will be fetched.
-
-The `id` property is always returned, regardless of whether it is in the list of requested properties. The possible values for `properties` can be found above in the description of the CalendarEvent object.
-
-The response to *getCalendarEvents* is called *calendarEvents*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **state**: `String`
-  A string encoding the current state on the server. This string will change
-  if any events change (that is, an event is created, updated or deleted). It can be passed to *getCalendarEventUpdates* to efficiently get the list of changes from the previous state.
-- **list**: `CalendarEvent[]`
-  An array of CalendarEvent objects for the requested event ids. This may not be in the same order as the ids were in the request.
-- **notFound**: `String[]|null`
-  An array of calendar event ids requested which could not be found, or `null` if all ids were found.
-
-The following errors may be returned instead of the *events* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### getCalendarEventUpdates
-
-The *getCalendarEventUpdates* call allows a client to efficiently update the state of its cached calendar events to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *calendarEvents* response. The server will return the changes made since this state.
-- **maxChanges**: `Number|null`
-  The maximum number of CalendarEvent ids to return in the response. The server MAY choose to clamp this value to a particular maximum or set a maximum if none is given by the client. If supplied by the client, the value MUST be a positive integer greater than 0. If a value outside of this range is given, the server MUST reject the call with an `invalidArguments` error.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting a *calendarEventUpdates* response, an implicit call will be made to *getCalendarEvents* with the *changed* property of the response as the *ids* argument, and the *fetchRecordProperties* argument as the *properties* argument. If `false` or `null`, no implicit call will be made.
-- **fetchRecordProperties**: `String[]|null`
-  Passed through as the *properties* argument to any implicit *getCalendarEvents* call.
-
-The response to *getCalendarEventUpdates* is called *calendarEventUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **hasMoreUpdates**: `Boolean`
-  If `true`, the client may call *getCalendarEventUpdates* again with the *newState* returned to get further updates. If `false`, *newState* is the current server state.
-- **changed**: `String[]`
-  An array of CalendarEvent ids where a property of the event has changed between the old state and the new state, or the event has been created, and the event has not been destroyed.
-- **removed**: `String[]`
-  An array of CalendarEvent ids for events which have been destroyed since the old state.
-
-If a *maxChanges* is supplied, or set automatically by the server, the server must try to limit the number of ids across *changed* and *removed* to the number given. If there are more changes than this between the client's state and the current server state, the update returned MUST take the client to an intermediate state, from which the client can continue to call *getCalendarEventUpdates* until it is fully up to date. The server MAY return more ids than the *maxChanges* total if this  [...]
-
-If an event has been modified AND deleted since the oldState, the server should just return the id in the *removed* array, but MAY return it in the *changed* array as well. If an event has been created AND deleted since the oldState, the server SHOULD remove the event id from the response entirely, but MAY include it in the *removed* array, and optionally the *changed* array as well.
-
-The following errors may be returned instead of the `calendarEventUpdates` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old, or the server being unable to produce an update to an intermediate state when there are too many updates. The client MUST invalidate its CalendarEvent cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setCalendarEvents
-
-Modifying the state of CalendarEvent objects on the server is done via the *setCalendarEvents* method. This encompasses creating, updating and destroying CalendarEvent records.
-
-The *setCalendarEvents* method takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **ifInState**: `String|null`
-  This is a state string as returned by the *getCalendarEvents* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned. If `null`, the change will be applied to the current state.
-- **create**: `String[CalendarEvent]|null`
-  A map of *creation id* (an arbitrary string set by the client) to CalendarEvent objects (containing all properties except the id).
-- **update**: `String[CalendarEvent]|null`
-  A map of id to a CalendarEvent object. The object may omit any property; only properties that have changed need be included.
-- **destroy**: `String[]|null`
-  A list of ids for CalendarEvent objects to permanently delete.
-
-Each create, update or destroy is considered an atomic unit. It is permissible for the server to commit some of the changes but not others, however it is not permissible to only commit part of an update to a single event (e.g. update the *start* property but not the *startTimeZone* property if both are supplied in the update object).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-If an id given cannot be found, the update or destroy MUST be rejected with a `notFound` set error.
-
-CalendarEvents reference a Calendar object. When events are created or modified, they may reference a calendar being created *in the same API request* by using the creation id prefixed with a `#`. The order of the method calls in the request by the client MUST be such that the calendar being referenced is created in an earlier call. The server thus never has to look ahead. Instead, while processing a request (a series of method calls), the server MUST keep a simple map for the duration o [...]
-
-To add new attachments, the file must first be uploaded using the standard upload mechanism (see the File Uploads section of this spec). This will give the client a valid blobId/size/type to use.
-
-When an event is created, updated or destroyed, the server MUST also ensure the following:
-
-- Any alerts are scheduled/cancelled correctly..
-- If `organizer.isYou == true`:
-  - If an event is created with attendees, send a REQUEST iMIP email with the
-    event as an ICS attachment to all attendees with `isYou == false`.
-  - When an event is updated, email all attendees with `isYou == false` the
-    change with an appropriate iMIP email.
-  - When an event is destroyed, if it is in the future, then email all
-    attendees with `isYou == false` to inform them that the event has been cancelled. If it is in the past, the server SHOULD NOT send a message.
-- If `organizer.isYou != true` and one of the attendees of the event has `isYou == true`, then changing the RSVP status of this attendee MUST send the appropriate email to the organizer to inform them of the change in status, as per the iMIP standard.
-
-Note, for compatibility with CalDAV clients, when updating an attendee, the server SHOULD maintain any ROLE, CUTYPE, MEMBER, DELEGATED-TO, DELEGATED-FROM, SENT-BY etc. parameters currently in the iCalendar object for that attendee, even though this API does not currently care about it.
-
-The response to *setCalendarEvents* is called *calendarEventsSet*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String|null`
-  The state string that would have been returned by *getCalendarEvents* before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by *getCalendarEvents*.
-- **created**: `String[CalendarEvent]`
-  A map of the creation id to an object containing the **id** property for all successfully created events
-- **updated**: `String[]`
-  A list of ids for events that were successfully updated.
-- **destroyed**: `String[]`
-  A list of ids for events that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each event that failed to be created. The possible errors are defined in the description of the method for specific data types.
-- **notUpdated**: `String[SetError]`
-  A map of CalendarEvent id to a SetError object for each event that failed to be updated. The possible errors are defined in the description of the method for specific data types.
-- **notDestroyed**: `String[SetError]`
-  A map of CalendarEvent id to a SetError object for each event that failed to be destroyed. The possible errors are defined in the description of the method for specific data types.
-
-A **SetError** object has the following properties:
-
-- **type**: `String`
-  The type of error.
-- **description**: `String|null`
-  A description of the error to display to the user.
-
-If any of the properties in a create or update are invalid (immutable and different to the current server value, wrong type, invalid value for the property – like a *calendarId* for a non-existent calendar), the server MUST reject the create/update with a SetError of type `invalidProperties`. The SetError object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type [...]
-
-The following errors may be returned instead of the *calendarEventsSet* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an *ifInState* argument was supplied and it does not match the current state.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/calendareventlist.mdwn b/server/protocols/jmap-draft/doc/specs/spec/calendareventlist.mdwn
deleted file mode 100644
index 0ddf1d59c5..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/calendareventlist.mdwn
+++ /dev/null
@@ -1,97 +0,0 @@
-## CalendarEventLists
-<aside class="warning">
-Not implemented
-</aside>
-
-A **CalendarEventList** is a query on the set of events in a user's calendars. The client can optionally also fetch the events.
-
-### getCalendarEventList
-
-To fetch a calendar event list, make a call to *getCalendarEventList*. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **filter**: `FilterCondition|FilterOperator|null`
-  Determines the set of events returned in the results. See the "Filtering" section below for allowed values and semantics.
-- **position**: `Number|null`
-  The 0-based index of the first result in the list to return, presumed `0` if `null`. If a negative value is given, the call MUST be rejected with an `invalidArguments` error.
-- **limit**: `Number|null`
-  The maximum number of results to return. If `null`, no limit presumed. The server MAY choose to enforce a maximum `limit` argument. In this case, if a greater value is given (or if it is `null`), the limit should be clamped to the maximum; since the total number of results in the list is returned, the client can determine if it has received all the results. If a negative value is given, the call MUST be rejected with an `invalidArguments` error.
-- **fetchCalendarEvents**: `Boolean|null`
-  If `true` then after outputting a *calendarEventList* response, an implicit call will be made to *getCalendarEvents* with the `calendarEventIds` array in the response as the *ids* argument. If `false` or `null`, no implicit call will be made.
-
-#### Filtering
-
-A **FilterOperator** object has the following properties:
-
-- **operator**: `String`
-  This MUST be one of the following strings: "AND"/"OR"/"NOT":
-  - **AND**: all of the conditions must match for the filter to match.
-  - **OR**: at least one of the conditions must match for the filter to match.
-  - **NOT**: none of the conditions must match for the filter to match.
-- **conditions**: `(FilterCondition|FilterOperator)[]`
-  The conditions to evaluate against each event.
-
-A **FilterCondition** object has the following properties:
-
-- **inCalendars**: `String[]|null`
-  A list of calendar ids. An event must be in ANY of these calendars to match the condition.
-- **after**: `Date|null`
-  The end of the event, or any recurrence of the event, in UTC time must be after this date to match the condition.
-- **before**: `Date|null`
-  The start of the event, or any recurrence of the event, in UTC time must be before this date to match the condition.
-- **text**: `String|null`
-  Looks for the text in the *summary*, *description*, *location*, *organizer*, *attendees* properties of the event or any recurrence of the event (matching either name or email in the organizer/attendee case).
-- **summary**: `String|null`
-  Looks for the text in the *summary* property of the event, or the overridden *summary* property of a recurrence.
-- **description**: `String|null`
-  Looks for the text in the *description* property of the event, or the overridden *description* property of a recurrence.
-- **location**: `String|null`
-  Looks for the text in the *location* property of the event, or the overridden *location* property of a recurrence.
-- **organizer**: `String|null`
-  Looks for the text in the name or email fields of the *organizer* property of the event, or the overridden *organizer* property of a recurrence.
-- **attendee**: `String|null`
-  Looks for the text in the name or email of any item in the *attendees* property of the event, or the overridden *attendees* property of a recurrence.
-
-If zero properties are specified on the FilterCondition, the condition MUST always evaluate to `true`. If multiple properties are specified, ALL must apply for the condition to be `true` (it is equivalent to splitting the object into one-property conditions and making them all the child of an AND filter operator).
-
-The exact semantics for matching `String` fields is **deliberately not defined** to allow for flexibility in indexing implementation, subject to the following:
-
-- Text SHOULD be matched in a case-insensitive manner.
-- Text contained in either (but matched) single or double quotes SHOULD be treated as a **phrase search**, that is a match is required for that exact sequence of words, excluding the surrounding quotation marks. Use `\"`, `\'` and `\\` to match a literal `"`, `'` and `\` respectively in a phrase.
-- Outside of a phrase, white-space SHOULD be treated as dividing separate tokens that may be searched for separately in the event, but MUST all be present for the event to match the filter.
-- Tokens MAY be matched on a whole-word basis using stemming (so for example a text search for `bus` would match "buses" but not "business").
-
-#### Sorting
-
-Results MUST be sorted in a stable order so the client can load the full list in sections. The exact ordering to use is server dependent.
-
-#### Windowing
-
-To paginate the results the client MAY supply a *position* argument: this is the 0-based index of the first result to return in the list of events after filtering and sorting. If the index is greater than or equal to the total number of events in the list, then there are no results to return, but this DOES NOT generate an error. If `null`, this defaults to `0`.
-
-#### Response
-
-The response to a call to *getCalendarEventList* is called *calendarEventList*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **filter**: `FilterCondition|FilterOperator|null`
-  The filter of the event list. Echoed back from the call.
-- **state**: `String`
-  A string encoding the current state on the server. This string will change
-  if the results of the event list MAY have changed (for example, there has been a change to the state of the set of CalendarEvents; it does not guarantee that anything in the list has changed).
-- **position**: `Number`
-  The 0-based index of the first result in the `calendarEventIds` array within the complete list.
-- **total**: `Number`
-  The total number of events in the list (given the *filter*).
-- **calendarEventIds**: `String[]`
-  The list of CalendarEvent ids for each event in the list after filtering and sorting, starting at the index given by the *position* argument of this response, and continuing until it hits the end of the list or reaches the `limit` number of ids. Note, that recurrences are not returned separately in any way; the event only occurs once in the calendarEventIds array no matter how many times it recurs.
-
-The following errors may be returned instead of the `calendarEventList` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoCalendars`: Returned if the *accountId* given corresponds to a valid account, but does not contain any calendar data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/contact.mdwn b/server/protocols/jmap-draft/doc/specs/spec/contact.mdwn
deleted file mode 100644
index 914a1665e5..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/contact.mdwn
+++ /dev/null
@@ -1,246 +0,0 @@
-## Contacts
-<aside class="warning">
-Not implemented
-</aside>
-
-A **Contact** object stores information about a person or company. It has the following properties:
-
-- **id**: `String`
-  The id of the contact. This property is immutable.
-- **isFlagged**: `Boolean`
-  Is the contact flagged (marked as important in some way by the user)?
-- **avatar**: `File|null`
-  A file containing an image to be used to represent this contact.
-- **prefix**: `String`
-  The honorific title of the contact, e.g. "Mr", "Ms", "Dr", etc.
-- **firstName**: `String`
-  The first name(s) of a contact.
-- **lastName**: `String`
-  The last name of a contact.
-- **suffix**: `String`
-  The honorific suffix of the contact, e.g. "B.A.", "Esq." etc.
-- **nickname**: `String`
-  The nickname of the contact.
-- **birthday**: `String`
-  The person's birth date in the form `"YYYY-MM-DD"` (any part may be all `0`s for unknown).
-- **anniversary**: `String`
-  The person's anniversary date in the form `"YYYY-MM-DD"` (any part may be all `0`s for unknown).
-- **company**: `String`
-  The company for which the person works.
-- **department**: `String`
-  The department within the company for which the person works.
-- **jobTitle**: `String`
-  The job title of the person.
-- **emails**: `ContactInformation[]`
-  An array of ContactInformation objects where the values are email addresses. Types are:
-  - `"personal"` The address is for emailing the person in a personal context.
-  - `"work"` The address is for emailing the person in a professional context.
-  - `"other"` The address is for some other purpose. A *label* property MAY be included to display next to the address to help the user identify its purpose.
-- **phones**: `ContactInformation[]`
-  An array of ContactInformation objects where the values are phone numbers. Types are:
-  - `"home"` The number is for contacting the person at their residence.
-  - `"work"` The number is for contacting the person at their workplace.
-  - `"mobile"` The number is for contacting the person regardless of location.
-  - `"fax"` The number is for sending faxes to the contact.
-  - `"pager"` The number is for a pager or beeper associated with the contact.
-  - `"other"` The number is for some other purpose. A *label* property MAY be included to display next to the number to help the user identify its purpose.
-- **online**: `ContactInformation[]`
-  An array of ContactInformation objects where the values are URIs or usernames associated with the person for online services.
-  Types are:
-  - `"uri"` The value is a URI, e.g. a website link.
-  - `"username"` The value is a username associated with the person (e.g. for Twitter, or Facebook, or an IM client). A *label* property SHOULD be included to identify what service this is for. For compatibility between clients, this label SHOULD be the canonical service name, including capitalisation. e.g. `"Twitter"`, `"Facebook"`, `"Skype"`, `"GitHub"`, `"XMPP"`.
-  - `"other"` The value is something else not covered by the above categories. A *label* property MAY be included to display next to the number to help the user identify its purpose.
-- **addresses**: `Address[]`
-  An array of Address objects, containing physical locations associated with the person.
-  Types are:
-  - `"home"` An address of a residence associated with the person.
-  - `"work"` An address of a workplace associated with the person.
-  - `"billing"` An address to be used with billing associated with the person.
-  - `"postal"` An address to be used for delivering physical items to the person.
-  - `"other"` An address not covered by the above categories.
-- **notes**: `String`
-  Arbitrary notes about the contact.
-
-Note, none of these properties have a `null`able type. If the specific information is not known for a contact, the empty string or empty array should be used as appropriate, or in the case of birthday the string `"0000-00-00"`.
-
-A **ContactInformation** object has the following properties:
-
-- **type**: `String`
-  Specifies the context of the contact information. This MUST be taken from the set of values allowed depending on whether this is part of the *phones*, *emails* or *online* property (see above).
-- **label**: `String|null`
-  A label describing the value in more detail, especially if `type === "other"` (but MAY be included with any type).
-- **value**: `String`
-  The actual contact information, e.g. the email address or phone number.
-- **isDefault**: `Boolean`
-  Whether this contact is the default for its type (SHOULD only be one per type, but some backends will allow multiple defaults)
-
-An **Address** object has the following properties:
-
-- **type**: `String`
-  Specifies the context of the contact information. This MUST be taken from the set of values allowed depending on whether this is part of the *phones*, *emails* or *online* property (see above).
-- **label**: `String|null`
-  A label describing the value in more detail, especially if `type === "other"` (but MAY be included with any type).
-- **street**: `String`
-  The street address. This MAY be multiple lines; newlines MUST be preserved.
-- **locality**: `String`
-  The city, town, village, post town, or other locality within which the street address may be found.
-- **region**: `String`
-  The province, such as a state, county, or canton within which the locality may be found.
-- **postcode**: `String`
-  The postal code, post code, ZIP code or other short code associated with the address by the relevant country's postal system.
-- **country**: `String`
-  The country name.
-- **isDefault**: `Boolean`
-  Whether this contact is the default for its type (SHOULD only be one per type, but some backends will allow multiple defaults)
-
-A **File** Object has the following properties:
-
-- **blobId**: `String`
-  The id of the binary data.
-- **type**: `String|null`
-  The content-type of the file, if known.
-- **name**: `String|null`
-  The full file name, if known. e.g. "myface.png"
-- **size**: `Number|null`
-  The size, in bytes, of the file when fully decoded (i.e. the number of bytes in the file the user would download), if known.
-
-### getContacts
-
-Contacts can either be fetched explicitly by id, or all of them at once. To fetch contacts, make a call to `getContacts`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The Account to fetch the contacts for. If `null`, the primary account is used.
-- **ids**: `String|null`
-  The ids of the contacts to fetch. If `null`, all contacts in the account are be fetched.
-- **properties**: `String[]|null`
-  If supplied, only the properties listed in the array will be returned for each contact. If `null`, all properties are returned. The id of the contact will **always** be returned, even if not explicitly requested.
-
-The response to *getContacts* is called *contacts*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **state**: `String`
-  A string representing the state on the server for **all** contacts. If the state of a contact changes, or a new contact is created, or a contact is destroyed, this string will change. It is used to get delta updates.
-- **list**: `Contact[]`
-  An array of the Contact objects requested. This will be the **empty array** if the *ids* argument was the empty array, or contained only ids for contacts that could not be found.
-- **notFound**: `String[]|null`
-  This array contains the ids passed to the method for contacts that do not exist, or `null` if all requested ids were found. It will always be `null` if the *ids* argument in the call was `null`.
-
-The following errors may be returned instead of the *contacts* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoContacts`: Returned if the *accountId* given corresponds to a valid account, but does not contain any contact data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### getContactUpdates
-
-The *getContactUpdates* call allows a client to efficiently update the state of its cached contacts to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *contacts* response. The server will return the changes made since this state.
-- **maxChanges**: `Number|null`
-  The maximum number of Contact ids to return in the response. The server MAY choose to clamp this value to a particular maximum or set a maximum if none is given by the client. If supplied by the client, the value MUST be a positive integer greater than 0. If a value outside of this range is given, the server MUST reject the call with an `invalidArguments` error.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting a *contactUpdates* response, an implicit call will be made to *getContacts* with the *changed* property of the response as the *ids* argument, and the *fetchRecordProperties* argument as the *properties* argument. If `false` or `null`, no implicit call is made.
-- **fetchRecordProperties**: `String[]|null`
-  Passed through as the *properties* argument to any implicit *getContacts* call.
-
-The response to *getContactUpdates* is called *contactUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **hasMoreUpdates**: `Boolean`
-  If `true`, the client may call *getContactUpdates* again with the *newState* returned to get further updates. If `false`, *newState* is the current server state.
-- **changed**: `String[]`
-  An array of Contact ids where a property of the contact has changed between the old state and the new state, or the contact has been created, and the contact has not been destroyed.
-- **removed**: `String[]`
-  An array of Contact ids for contacts which have been destroyed since the old state.
-
-If a *maxChanges* is supplied, or set automatically by the server, the server must try to limit the number of ids across *changed* and *removed* to the number given. If there are more changes than this between the client's state and the current server state, the update returned MUST take the client to an intermediate state, from which the client can continue to call *getContactUpdates* until it is fully up to date. The server MAY return more ids than the *maxChanges* total if this is req [...]
-
-If a contact has been modified AND deleted since the oldState, the server should just return the id in the *removed* array, but MAY return it in the *changed* array as well. If a contact has been created AND deleted since the oldState, the server SHOULD remove the contact id from the response entirely, but MAY include it in the *removed* array, and optionally the *changed* array as well.
-
-The following errors may be returned instead of the `contactUpdates` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoContacts`: Returned if the *accountId* given corresponds to a valid account, but does not contain any contacts data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old, or the server being unable to produce an update to an intermediate state when there are too many updates. The client MUST invalidate its Contact cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setContacts
-
-Modifying the state of Contact objects on the server is done via the *setContacts* method. This encompasses creating, updating and destroying Contact records.
-
-The *setContacts* method takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **ifInState**: `String|null`
-  This is a state string as returned by the *getContacts* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned. If `null`, the change will be applied to the current state.
-- **create**: `String[Contact]|null`
-  A map of *creation id* (an arbitrary string set by the client) to Contact objects (containing all properties except the id).
-- **update**: `String[Contact]|null`
-  A map of id to a Contact object. The object may omit any property; only properties that have changed need be included.
-- **destroy**: `String[]|null`
-  A list of ids for Contact objects to permanently delete.
-
-Each create, update or destroy is considered an atomic unit. It is permissible for the server to commit some of the changes but not others, however it is not permissible to only commit part of an update to a single contact (e.g. update the *firstName* property but not the *lastName* property if both are supplied in the update object).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-If an id given cannot be found, the update or destroy MUST be rejected with a `notFound` set error.
-
-To set a new avatar, the file must first be uploaded using the standard upload mechanism (see the File Uploads section of this spec). This will give the client a valid blobId/size/type to use. The server SHOULD reject attempts to set a file that is not a recognised image type as the avatar for a contact.
-
-The response to *setContacts* is called *contactsSet*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String|null`
-  The state string that would have been returned by *getContacts* before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by *getContacts*.
-- **created**: `String[Contact]`
-  A map of the creation id to an object containing the **id** property for all successfully created contacts.
-- **updated**: `String[]`
-  A list of ids for contacts that were successfully updated.
-- **destroyed**: `String[]`
-  A list of ids for contacts that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each contact that failed to be created. The possible errors are defined in the description of the method for specific data types.
-- **notUpdated**: `String[SetError]`
-  A map of Contact id to a SetError object for each contact that failed to be updated. The possible errors are defined in the description of the method for specific data types.
-- **notDestroyed**: `String[SetError]`
-  A map of Contact id to a SetError object for each contact that failed to be destroyed. The possible errors are defined in the description of the method for specific data types.
-
-A **SetError** object has the following properties:
-
-- **type**: `String`
-  The type of error.
-- **description**: `String|null`
-  A description of the error to display to the user.
-
-Other properties may also be present on the object, as described in the relevant methods.
-
-The following errors may be returned instead of the *contactsSet* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoContacts`: Returned if the *accountId* given corresponds to a valid account, but does not contain any contacts data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an *ifInState* argument was supplied and it does not match the current state.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/contactgroup.mdwn b/server/protocols/jmap-draft/doc/specs/spec/contactgroup.mdwn
deleted file mode 100644
index 2e0c13a5c8..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/contactgroup.mdwn
+++ /dev/null
@@ -1,138 +0,0 @@
-## Contact Groups
-<aside class="warning">
-Not implemented
-</aside>
-
-A **Contact Group** represents a named set of contacts. It has the following properties:
-
-- **id**: `String`
-  The id of the group. This property is immutable.
-- **name**: `String`
-  The user-visible name for the group, e.g. "Friends". This may be any UTF-8 string of at least 1 character in length and maximum 256 bytes in size. The same name may be used by two different groups.
-- **contactIds**: `String[]`
-  The ids of the contacts in the group. This must be returned in the same order given by the client when the property is set.
-
-### getContactGroups
-
-Contact Groups can either be fetched explicitly by id, or all of them at once. To fetch contact groups, make a call to `getContactGroups`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The Account to fetch the groups for. If `null`, the primary account is used.
-- **ids**: `String[]|null`
-  The ids of the groups to fetch. If `null`, all contact groups in the account are be fetched.
-
-The response to *getContactGroups* is called *contactGroups*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **state**: `String`
-  A string representing the state on the server for **all** contact groups. If the name of a group changes, or a new group is created, or a group is destroyed, this string will change. It is used to get delta updates.
-- **list**: `ContactGroup[]`
-  An array of the ContactGroup objects requested. This will be the **empty array** if the *ids* argument was the empty array, or contained only ids for contact groups that could not be found.
-- **notFound**: `String[]|null`
-  This array contains the ids passed to the method for groups that do not exist, or `null` if all requested ids were found. It will always be `null` if the *ids* argument in the call was `null`.
-
-The following errors may be returned instead of the *contactGroups* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoContacts`: Returned if the *accountId* given corresponds to a valid account, but does not contain any contact data.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### getContactGroupUpdates
-
-The *getContactGroupUpdates* call allows a client to efficiently update the state of its cached contacts to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *contactGroups* response. The server will return the changes made since this state.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting a *contactGroupUpdates* response, an implicit call will be made to *getContactGroups* with the *changed* property of the response as the *ids* argument. If `false` or `null`, no implicit call will be made.
-
-The response to *getContactGroupUpdates* is called *contactGroupUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **changed**: `String[]`
-  An array of ContactGroup ids where a property of the group has changed between the old state and the new state, or the group has been created, and the group has not been destroyed.
-- **removed**: `String[]`
-  An array of ContactGroup ids for groups which have been destroyed since the old state.
-
-If a group has been modified AND deleted since the oldState, the server should just return the id in the *removed* array, but MAY return it in the *changed* array as well. If a group has been created AND deleted since the oldState, the server SHOULD remove the group id from the response entirely, but MAY include it in the *removed* array, and optionally the *changed* array as well.
-
-The following errors may be returned instead of the `contactGroupUpdates` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoContacts`: Returned if the *accountId* given corresponds to a valid account, but does not contain any contacts data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old. The client MUST invalidate its ContactGroup cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setContactGroups
-
-Modifying the state of ContactGroup objects on the server is done via the *setContactGroups* method. This encompasses creating, updating and destroying ContactGroup records.
-
-The *setContactGroups* method takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **ifInState**: `String|null`
-  This is a state string as returned by the *getContactGroups* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned. If `null`, the change will be applied to the current state.
-- **create**: `String[ContactGroup]|null`
-  A map of *creation id* (an arbitrary string set by the client) to ContactGroup objects (containing all properties except the id).
-- **update**: `String[ContactGroup]|null`
-  A map of id to a ContactGroup object. The object may omit any property; only properties that have changed need be included.
-- **destroy**: `String[]|null`
-  A list of ids for ContactGroup objects to permanently delete.
-
-Each create, update or destroy is considered an atomic unit. It is permissible for the server to commit some of the changes but not others, however it is not permissible to only commit part of an update to a single group (e.g. update the *name* property but not the *contactIds* property if both are supplied in the update object).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-If an id given cannot be found, the update or destroy MUST be rejected with a `notFound` set error.
-
-If any of the properties in a create or update are invalid (immutable and different to the current server value, wrong type, non-existent contactId value in contactsIds list), the server MUST reject the create/update with a SetError of type `invalidProperties`. The SetError object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user-friendly d [...]
-
-Contacts Groups reference Contacts. When groups are created or modified, they may reference contacts being created *in the same API request* by using the creation id prefixed with a `#`. The order of the method calls in the request by the client MUST be such that the contact being referenced is created in an earlier call. The server thus never has to look ahead. Instead, while processing a request (a series of method calls), the server MUST keep a simple map for the duration of the reque [...]
-
-The response to *setContactGroups* is called *contactGroupsSet*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String|null`
-  The state string that would have been returned by *getContactGroups* before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by *getContactGroups*.
-- **created**: `String[Contact]`
-  A map of the creation id to an object containing the **id** property for all successfully created groups.
-- **updated**: `String[]`
-  A list of ids for groups that were successfully updated.
-- **destroyed**: `String[]`
-  A list of ids for groups that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each group that failed to be created. The possible errors are defined in the description of the method for specific data types.
-- **notUpdated**: `String[SetError]`
-  A map of ContactGroup id to a SetError object for each group that failed to be updated. The possible errors are defined in the description of the method for specific data types.
-- **notDestroyed**: `String[SetError]`
-  A map of ContactGroup id to a SetError object for each group that failed to be destroyed. The possible errors are defined in the description of the method for specific data types.
-
-A **SetError** object has the following properties:
-
-- **type**: `String`
-  The type of error.
-- **description**: `String|null`
-  A description of the error to display to the user.
-
-The following errors may be returned instead of the *contactGroupsSet* response:
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an `ifInState` argument was supplied and it does not match the current state.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/contactlist.mdwn b/server/protocols/jmap-draft/doc/specs/spec/contactlist.mdwn
deleted file mode 100644
index 13504fc126..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/contactlist.mdwn
+++ /dev/null
@@ -1,114 +0,0 @@
-## ContactLists
-<aside class="warning">
-Not implemented
-</aside>
-
-A **ContactList** is a query on the set of contacts in a user's contacts. The client can optionally also fetch the contacts.
-
-### getContactList
-
-To fetch a contact list, make a call to *getContactList*. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **filter**: `FilterCondition|FilterOperator|null`
-  Determines the set of contacts returned in the results. See the "Filtering" section below for allowed values and semantics.
-- **position**: `Number|null`
-  The 0-based index of the first result in the list to return, presumed `0` if `null`. If a negative value is given, the call MUST be rejected with an `invalidArguments` error.
-- **limit**: `Number|null`
-  The maximum number of results to return. If `null`, no limit presumed. The server MAY choose to enforce a maximum `limit` argument. In this case, if a greater value is given (or if it is `null`), the limit should be clamped to the maximum; since the total number of results in the list is returned, the client can determine if it has received all the results. If a negative value is given, the call MUST be rejected with an `invalidArguments` error.
-- **fetchContacts**: `Boolean|null`
-  If `true` then after outputting a *contactList* response, an implicit call will be made to *getContacts* with the `contactIds` array in the response as the *ids* argument. If `false` or `null`, no implicit call will be made.
-
-#### Filtering
-
-A **FilterOperator** object has the following properties:
-
-- **operator**: `String`
-  This MUST be one of the following strings: "AND"/"OR"/"NOT":
-  - **AND**: all of the conditions must match for the filter to match.
-  - **OR**: at least one of the conditions must match for the filter to match.
-  - **NOT**: none of the conditions must match for the filter to match.
-- **conditions**: `(FilterCondition|FilterOperator)[]`
-  The conditions to evaluate against each contact.
-
-A **FilterCondition** object has the following properties:
-
-- **inContactGroup**: `String[]|null`
-  A list of contact group ids. A contact must be in ANY of these groups to match the condition.
-- **isFlagged**: `Boolean|null`
-  The `isFlagged` property of the contact must be identical to the value given to match the condition.
-- **text**: `String|null`
-  Equivalent to ORing together a FilterCondition for each of the `String` typed conditions (prefix, firstName, etc.).
-- **prefix**: `String`
-  Looks for the text in the *prefix* property of the contact.
-- **firstName**: `String`
-  Looks for the text in the *firstName* property of the contact.
-- **lastName**: `String`
-  Looks for the text in the *lastName* property of the contact.
-- **suffix**: `String`
-  Looks for the text in the *suffix* property of the contact.
-- **nickname**: `String`
-  Looks for the text in the *nickname* property of the contact.
-- **company**: `String`
-  Looks for the text in the *company* property of the contact.
-- **department**: `String`
-  Looks for the text in the *department* property of the contact.
-- **jobTitle**: `String`
-  Looks for the text in the *jobTitle* property of the contact.
-- **email**: `String`
-  Looks for the text in the *value* property of any object in the *emails*
-  property of the contact.
-- **phone**: `String`
-  Looks for the text in the *value* property of any object in the *phones*
-  property of the contact.
-- **online**: `String`
-  Looks for the text in the *value* property of any object in the *online*
-  property of the contact.
-- **address**: `String`
-  Looks for the text in the *street*, *locality*, *region*, *postcode* or *country* property of any object in the *addresses* property of the contact.
-- **notes**: `String`
-  Looks for the text in the *notes* property of the contact.
-
-If zero properties are specified on the FilterCondition, the condition MUST always evaluate to `true`. If multiple properties are specified, ALL must apply for the condition to be `true` (it is equivalent to splitting the object into one-property conditions and making them all the child of an AND filter operator).
-
-The exact semantics for matching `String` fields is **deliberately not defined** to allow for flexibility in indexing implementation, subject to the following:
-
-- Text SHOULD be matched in a case-insensitive manner.
-- Text contained in either (but matched) single or double quotes SHOULD be treated as a **phrase search**, that is a match is required for that exact sequence of words, excluding the surrounding quotation marks. Use `\"`, `\'` and `\\` to match a literal `"`, `'` and `\` respectively in a phrase.
-- Outside of a phrase, white-space SHOULD be treated as dividing separate tokens that may be searched for separately in the contact, but MUST all be present for the contact to match the filter.
-- Tokens MAY be matched on a whole-word basis using stemming (so for example a text search for `bus` would match "buses" but not "business").
-
-#### Sorting
-
-Results MUST be sorted in a stable order so the client can load the full list in sections. The exact ordering to use is server dependent.
-
-#### Windowing
-
-To paginate the results the client MAY supply a *position* argument: this is the 0-based index of the first result to return in the list of contacts after filtering and sorting. If the index is greater than or equal to the total number of contacts in the list, then there are no results to return, but this DOES NOT generate an error. If `null`, this defaults to `0`.
-
-#### Response
-
-The response to a call to *getContactList* is called *contactList*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **filter**: `FilterCondition|FilterOperator|null`
-  The filter of the contact list. Echoed back from the call.
-- **state**: `String`
-  A string encoding the current state on the server. This string will change
-  if the results of the contact list MAY have changed (for example, there has been a change to the state of the set of Contacts; it does not guarantee that anything in the list has changed).
-- **position**: `Number`
-  The 0-based index of the first result in the `contactIds` array within the complete list.
-- **total**: `Number`
-  The total number of contacts in the list (given the *filter*).
-- **contactIds**: `String[]`
-  The list of Contact ids for each contact in the list after filtering and sorting, starting at the index given by the *position* argument of this response, and continuing until it hits the end of the list or reaches the `limit` number of ids.
-
-The following errors may be returned instead of the `contactList` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoContacts`: Returned if the *accountId* given corresponds to a valid account, but does not support storing contact data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/datamodel.mdwn b/server/protocols/jmap-draft/doc/specs/spec/datamodel.mdwn
deleted file mode 100644
index 7ce1826c99..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/datamodel.mdwn
+++ /dev/null
@@ -1,39 +0,0 @@
-## Data model overview
-
-### Accounts
-<aside class="warning">
-Not implemented
-</aside>
-
-All data belongs to an account. An account may provide access to mail, contacts and/or calendars. Most operations are isolated to a single account; there are a few explicit operations to copy data between them. A single login may provide access to multiple accounts, for example if another user is sharing data with the user.
-
-### Ids
-<aside class="notice">
-Work in progress. Unique message id is generated by concatenate the username, the mailboxId and the uid.
-</aside>
-
-All ids for messages, contacts, etc. are assigned by the server and are immutable. They MUST be unique among all records of the **same type** within the **same account**. Ids may clash across accounts, or for two records of different types within the same account.
-
-### Mail
-
-As for all data types, each message has a unique, immutable id. This id does not change if the message changes mailboxes. A mailbox is a named, arbitrary set of emails. For compatibility with IMAP, a message MUST always belong to at least one mailbox at any time.
-
-Each message has 4 mutable boolean "flags" stored with it, each with a direct
-equivalent in IMAP. In JMAP these flags are called:
-
-* **isUnread**: Has the email not yet been read?
-* **isFlagged**: Has the email been flagged (starred, or pinned)?
-* **isDraft**: Is the email a draft?
-* **isAnswered**: Has the email been answered (replied to)?
-
-Messages are **immutable** other than these 4 flags and the set of mailboxes to which it belongs. To change anything else, the message must be deleted and a new one created (which will get a different id).
-
-Related messages are grouped into threads. When getting a message list you can collapse threads, which means the thread is only returned **once**, at the position of the first message in the thread in the non-collapsed list (given the sort order).
-
-### Contacts
-
-The contacts API is designed to be compatible with existing CardDAV systems. Each contact must have a unique, immutable id. A contact can be assigned to contact groups in a many-to-many relationship. A group is simply a named set of contacts. Contacts are completely mutable.
-
-### Calendars
-
-The calendars API is designed to be compatible with existing CalDAV systems. Each event must have a unique, immutable id. An event must belong to a single calendar. Events are completely mutable.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/mailbox.mdwn b/server/protocols/jmap-draft/doc/specs/spec/mailbox.mdwn
deleted file mode 100644
index 253a0a97c2..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/mailbox.mdwn
+++ /dev/null
@@ -1,342 +0,0 @@
-## Mailboxes
-
-A mailbox represents a named set of emails. This is the primary mechanism for organising messages within an account. It is analogous to a folder in IMAP or a label in other systems. A mailbox may perform a certain role in the system.
-
-A **Mailbox** object has the following properties:
-
-- **id**: `String`
-  The id of the mailbox. This property is immutable.
-- **name**: `String`
-  User-visible name for the mailbox, e.g. "Inbox". This may be any UTF-8 string of at least 1 character in length and maximum 256 bytes in size. Mailboxes MAY have the same name as a sibling Mailbox.
-- **parentId**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The mailbox id for the parent of this mailbox, or `null` if this mailbox is at the top level. Mailboxes form acyclic graphs (forests) directed by the child-to-parent relationship. There MUST NOT be a loop.
-- **role**: `String|null`
-  <aside class="notice">
-  The role of a mailbox depends actually on the mailbox name.
-  We should implement RFC 6154 in James in order to fully support this feature.
-  </aside>
-  Identifies system mailboxes. This property is immutable.
-
-  The following values SHOULD be used for the relevant mailboxes:
-
-  - `inbox` – the mailbox to which new mail is delivered by default, unless diverted by a rule or spam filter etc.
-  - `archive` – messages the user does not need right now, but does not wish to delete.
-  - `drafts` – messages the user is currently writing and are not yet sent.
-  - `outbox` – messages the user has finished writing and wishes to send (see the `setMessages` method description for more information). A mailbox with this role MUST be present if the user is allowed to send mail through an account. If not present, the user MAY NOT send mail with that account.
-  - `sent` – messages the user has sent.
-  - `trash` – messages the user has deleted.
-  - `spam` – messages considered spam by the server.
-  - `templates` – drafts which should be used as templates (i.e. used as the basis for creating new drafts).
-
-  No two mailboxes may have the same role. Mailboxes without a known purpose MUST have a role of `null`.
-
-  An account is not required to have mailboxes with any of the above roles. A client MAY create new mailboxes with a role property to help them keep track of a use-case not covered by the above list. To avoid potential conflict with any special behaviour a server might apply to mailboxes with certain roles in the future, any roles not in the above list created by the client must begin with `"x-"`. The client MAY attempt to create mailboxes with the standard roles if not already present,  [...]
-- **sortOrder**: `Number`
-  Defines the sort order of mailboxes when presented in the UI, so it is
-  consistent between devices. The number MUST be an integer in the range
-  0 <= sortOrder < 2^31.
-
-  A mailbox with a lower order should be displayed before a mailbox with
-  a higher order (but the same parent) in any mailbox listing in the
-  client's UI. Mailboxes with equal order should be sorted in
-  alphabetical order by name. The sorting should take into locale-specific
-  character order convention.
-- **mustBeOnlyMailbox**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  If true, messages in this mailbox may not also be in any other mailbox.
-- **mayReadItems**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  If true, may use this mailbox as part of a filter in a *getMessageList* call.
-  If a submailbox is shared but not the parent mailbox, this may be `false`.
-- **mayAddItems**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The user may add messages to this mailbox (by either creating a new message or modifying an existing one).
-- **mayRemoveItems**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The user may remove messages from this mailbox (by either changing the mailboxes of a message or deleting it).
-- **mayCreateChild**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The user may create a mailbox with this mailbox as its parent.
-- **mayRename**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The user may rename the mailbox or make it a child of another mailbox.
-- **mayDelete**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The user may delete the mailbox itself.
-- **totalMessages**: `Number`
-  The number of messages in this mailbox.
-- **unreadMessages**: `Number`
-  The number of messages in this mailbox where the *isUnread* property of the message is `true` and the *isDraft* property is `false`.
-- **totalThreads**: `Number`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The number of threads where at least one message in the thread is in this mailbox (but see below for special case handling of Trash).
-- **unreadThreads**: `Number`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The number of threads where at least one message in the thread has `isUnread == true` and `isDraft == false` AND at least one message in the thread is in this mailbox (but see below for special case handling of Trash). Note, the unread message does not need to be the one in this mailbox.
-
-The Trash mailbox (that is a mailbox with `role == "trash"`) MUST be treated specially:
-<aside class="warning">
-Not implemented
-</aside>
-
-* Messages in the Trash are ignored when calculating the `unreadThreads` and `totalThreads` count of other mailboxes.
-* Messages not in the Trash are ignored when calculating the `unreadThreads` and `totalThreads` count for the Trash folder.
-
-The result of this is that messages in the Trash are treated as though they are in a separate thread for the purposes of mailbox counts. It is expected that clients will hide messages in the Trash when viewing a thread in another mailbox and vice versa. This allows you to delete a single message to the Trash out of a thread.
-
-For example, suppose you have an account where the entire contents is a single conversation with 2 messages: an unread message in the Trash and a read message in the Inbox. The `unreadThreads` count would be `1` for the Trash and `0` for the Inbox.
-
-### getMailboxes
-
-Mailboxes can either be fetched explicitly by id, or all of them at once. To fetch mailboxes, make a call to `getMailboxes`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The Account to fetch the mailboxes for. If `null`, the primary account is used.
-- **ids**: `String[]|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The ids of the mailboxes to fetch. If `null`, all mailboxes in the account are returned.
-- **properties**: `String[]|null`
-  The properties of each mailbox to fetch. If `null`, all properties are returned. The id of the mailbox will **always** be returned, even if not explicitly requested.
-
-The response to *getMailboxes* is called *mailboxes*. It has the following arguments:
-
-- **accountId**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the account used for the call.
-- **state**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  A string representing the state on the server for **all** mailboxes. If the state of a mailbox changes, or a new mailbox is created, or a mailbox is destroyed, this string will change. It is used to get delta updates.
-- **list**: `Mailbox[]`
-  An array of the Mailbox objects requested. This will be the **empty array** if the *ids* argument was the empty array, or contained only ids for mailboxes that could not be found.
-- **notFound**: `String[]|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  This array contains the ids passed to the method for mailboxes that do not exist, or `null` if all requested ids were found. It will always be `null` if the *ids* argument in the call was `null`.
-
-The following errors may be returned instead of the *mailboxes* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### getMailboxUpdates
-<aside class="warning">
-Not implemented
-</aside>
-
-The *getMailboxUpdates* call allows a client to efficiently update the state of its cached mailboxes to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *mailboxes* response. The server will return the changes made since this state.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting a *mailboxUpdates* response, an implicit call will be made to *getMailboxes* with the *changed* property of the response as the *ids* argument, and the *fetchRecordProperties* argument as the *properties* argument. If `false` or `null`, no implicit call will be made.
-- **fetchRecordProperties**: `String[]|null`
-  If `null`, all Mailbox properties will be fetched unless *onlyCountsChanged* in the *mailboxUpdates* response is `true`, in which case only the 4 counts properties will be returned (*totalMessages*, *unreadMessages*, *totalThreads* and *unreadThreads*). If not `null`, this value will be passed through to the *getMailboxes* call regardless of the *onlyCountsChanged* value in the *mailboxUpdates* response.
-
-The response to *getMailboxUpdates* is called *mailboxUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **changed**: `String[]`
-  An array of Mailbox ids where a property of the mailbox has changed between the old state and the new state, or the mailbox has been created, and the mailbox has not been destroyed.
-- **removed**: `String[]`
-  An array of Mailbox ids for mailboxes which have been destroyed since the old state.
-- **onlyCountsChanged**: `Boolean`
-  Indicates that only the folder counts (unread/total messages/threads) have changed since the old state. The client can then use this to optimise its data transfer and only fetch the counts. If the server is unable to tell if only counts have changed, it should just always return `false`.
-
-If a mailbox has been modified AND deleted since the oldState, the server should just return the id in the *removed* array, but MAY return it in the *changed* array as well. If a mailbox has been created AND deleted since the oldState, the server SHOULD remove the mailbox id from the response entirely, but MAY include it in the *removed* array, and optionally the *changed* array as well.
-
-The following errors may be returned instead of the `mailboxUpdates` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old. The client MUST invalidate its Mailbox cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setMailboxes
-<aside class="notice">
-The mailbox name property should not contain the special '.' (dot) character. 
-</aside>
-
-Mailboxes can be created, updated and destroyed using the *setMailboxes* method. The method takes the following arguments:
-
-- **accountId**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the account to use for this call. If `null`, defaults to the primary account.
-- **ifInState**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  This is a state string as returned by the *getMailboxes* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned.
-- **create**: `String[Mailbox]|null`
-  A map of *creation id* (an arbitrary string set by the client) to Mailbox objects. If `null`, no objects will be created.
-- **update**: `String[Mailbox]|null`
-  A map of id to a an object containing the properties to update for that Mailbox. If `null`, no objects will be updated.
-- **destroy**: `String[]|null`
-  A list of ids for Mailboxes to permanently delete. If `null`, no objects will be deleted.
-
-Each create, update or destroy is considered an atomic unit. The server MAY commit some of the changes but not others, however MAY NOT only commit part of an update to a single record (e.g. update the *name* field but not the *parentId* field, if both are supplied in the update object).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-####  Creating mailboxes
-<aside class="notice">
-Only Name, Role & ParentId properties are supported.
-</aside>
-
-The properties of the Mailbox object submitted for creation MUST conform to the following conditions:
-
-- The *id* property MUST NOT be present.
-- The *parentId* property MUST be either `null` or be a valid id for a mailbox for which the `mayCreateChild` property is `true`.
-- The *role* property MUST be either `null`, a valid role as listed in the Mailbox object specification, or prefixed by `"x-"`.
-- The *mustBeOnlyMailbox* property MUST NOT be present. This is server dependent and will be set by the server.
-- The *mayXXX* properties MUST NOT be present. Restrictions may only be set by the server for system mailboxes, or when sharing mailboxes with other users (setting sharing is not defined yet in this spec).
-- The *totalMessages*, *unreadMessages*, *totalThreads* and *unreadThreads* properties MUST NOT be present.
-
-If any of the properties are invalid, the server MUST reject the create with an `invalidProperties` error. The Error object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user-friendly description of the problems.
-
-There may be a maximum number of mailboxes allowed on the server. If this is reached, any attempt at creation will be rejected with a `maxQuotaReached` error.
-
-####  Updating mailboxes
-<aside class="notice">
-Due to cycle detection, mailboxes with child cannot be updated. 
-</aside>
-
-If the *id* given does not correspond to a Mailbox in the given account, the update MUST be rejected with a `notFound` error.
-
-All properties being updated must be of the correct type, not immutable or server-set-only, and the new value must obey all conditions of the property. In particular, note the following conditions:
-
-- The *name* property MUST be valid UTF-8, between 1 and 256 bytes in size.
-- The *parentId* property MUST be either `null` or be a valid id for *another* mailbox that is **not a descendant** of this mailbox, and for which the `mayCreateChild` property is `true`.
-  <aside class="notice">
-  Only Name, Role & ParentId properties are supported.
-  </aside>
-- These properties are immutable or may only be set by the server:
-  - id
-  - role
-  - mustBeOnlyMailbox
-  - mayReadMessageList
-  - mayAddMessages
-  - mayRemoveMessages
-  - mayCreateChild
-  - mayRenameMailbox
-  - mayDeleteMailbox
-  - totalMessages
-  - unreadMessages
-  - totalThreads
-  - unreadThreads
-
-If any of the properties are invalid, the server MUST reject the update with an `invalidProperties` error. The Error object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user-friendly description of the problems.
-
-#### Destroying mailboxes
-
-If the *id* given does not correspond to a Mailbox in the given account, the destruction MUST be rejected with a `notFound` error.
-
-If the mailbox has `mayDeleteMailbox == false`, the destruction MUST be rejected with a `forbidden` error.
-
-A mailbox MAY NOT be destroyed if it still has any child mailboxes. Attempting to do so will result in the destruction being rejected with a `mailboxHasChild` error.
-
-Destroying a mailbox MUST NOT delete any messages still contained within it. It only removes them from the mailbox. Since messages MUST always be in at least one mailbox, if the last mailbox they are in is deleted the messages must be added to the mailbox with `role == "inbox"`. If no Inbox exists, the messages must be moved to any other mailbox; this is server dependent.
-
-There MUST always be **at least one** mailbox. It is expected that the server will enforce this by setting `mayDeleteMailbox == false` on at least the Inbox, if not all system mailboxes. However, if this is not the case, an attempt to destroy the last mailbox MUST still be rejected with a `mailboxRequired` error.
-
-#### Ordering of changes
-
-Each individual create, update or destroy MUST take the server from one valid state to another valid state, so the changes can be processed linearly without need to undo or backtrack. However the order of the changes may affect the validity of the change. The server MUST process the changes in a manner which is indistinguishable from an order following these rules:
-
-1. Creates comes before any other changes.
-2. Creates with a parentId that is not a *creation id* reference come before those that reference another newly created mailbox.
-3. Creation of a mailbox X comes before creation of a mailbox Y if Y will be a descendent of X.
-4. Updates come before destroying mailboxes.
-5. Update/Destroy X comes before update/destroy Y if X is a descendent of Y.
-
-#### Response
-
-The response to *setMailboxes* is called *mailboxesSet*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String|null`
-  The state string that would have been returned by `getMailboxes` before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by `getMailboxes`.
-- **created**: `String[Mailbox]`
-  A map of the creation id to an object containing the **id** and **mustBeOnlyMailbox** properties for each successfully created Mailbox.
-- **updated**: `String[]`
-  A list of ids for Mailboxes that were successfully updated.
-- **destroyed**: `String[]`
-  A list of ids for Mailboxes that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each Mailbox that failed to be created. The possible errors are defined above.
-- **notUpdated**: `String[SetError]`
-  A map of Mailbox id to a SetError object for each Mailbox that failed to be updated. The possible errors are defined above.
-- **notDestroyed**: `String[SetError]`
-  A map of Mailbox id to a SetError object for each Mailbox that failed to be destroyed. The possible errors are defined above.
-
-The following errors may be returned instead of the *mailboxesSet* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an `ifInState` argument was supplied and it does not match the current state.
-
-Example request:
-
-    [ "setMailboxes", {
-      "ifInState": "ms4123",
-      "update": {
-        "f3": {
-          "name": "The new name"
-        }
-      },
-      "destroy": [ "f5" ]
-    }, "#0" ]
diff --git a/server/protocols/jmap-draft/doc/specs/spec/message.mdwn b/server/protocols/jmap-draft/doc/specs/spec/message.mdwn
deleted file mode 100644
index debcd8ae7f..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/message.mdwn
+++ /dev/null
@@ -1,533 +0,0 @@
-## Messages
-
-Just like in IMAP, a message is **immutable** except for the boolean `isXXX` status properties and the set of mailboxes it is in. This allows for more efficient caching of messages, and gives easier backwards compatibility for servers implementing an IMAP interface to the same data.
-
-JMAP completely hides the complexities of MIME. All special encodings of either headers or the body, such as [base64](https://tools.ietf.org/html/rfc4648), or [RFC2047](http://tools.ietf.org/html/rfc2047) encoding of non-ASCII characters, MUST be fully decoded into standard UTF-8.
-
-A **Message** object has the following properties:
-
-- **id**: `String`
-  <aside class="notice">
-  Work in progress. Unique message id is generated by concatenate the username, the mailboxId and the uid.
-  </aside>
-  The id of the message.
-- **blobId**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id representing the raw RFC2822 message. This may be used to download
-  the original message or to attach it directly to another message etc.
-- **threadId**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the thread to which this message belongs.
-- **mailboxIds**: `String[]` (Mutable)
-  The ids of the mailboxes the message is in. A message MUST belong to one or more mailboxes at all times (until it is deleted).
-- **inReplyToMessageId**: `String|null`
-  The id of the Message this message is a reply to. This is primarily for drafts, but the server MAY support this for received messages as well by looking up the RFC2822 Message-Id referenced in the `In-Reply-To` header and searching for this message in the user's mail.
-- **isUnread**: `Boolean` (Mutable)
-  Has the message not yet been read? This corresponds to the **opposite** of the `\Seen` system flag in IMAP.
-- **isFlagged**: `Boolean` (Mutable)
-  Is the message flagged? This corresponds to the `\Flagged` system flag in IMAP.
-- **isAnswered**: `Boolean` (Mutable)
-  Has the message been replied to? This corresponds to the `\Answered` system flag in IMAP.
-- **isDraft**: `Boolean` (Mutable by the server only)
-  Is the message a draft? This corresponds to the `\Draft` system flag in IMAP.
-- **hasAttachment**: `Boolean`
-  Does the message have any attachments?
-- **headers**: `String[String]`
-  A map of header name to (decoded) header value for all headers in the message. For headers that occur multiple times (e.g. `Received`), the values are concatenated with a single new line (`\n`) character in between each one.
-- **from**: `Emailer|null`
-  An Emailer object (see below) containing the name/email from the parsed `From` header of the email. If the email doesn't have a `From` header, this is `null`.
-- **to**:  `Emailer[]|null`
-  An array of name/email objects (see below) representing the parsed `To` header of the email, in the same order as they appear in the header. If the email doesn't have a `To` header, this is `null`. If the header exists but does not have any content, the response is an array of zero length.
-- **cc**:  `Emailer[]|null`
-  An array of name/email objects (see below) representing the parsed `Cc` header of the email, in the same order as they appear in the header. If the email doesn't have a `Cc` header, this is `null`. If the header exists but does not have any content, the response is an array of zero length.
-- **bcc**:  `Emailer[]|null`
-  An array of name/email objects (see below) representing the parsed `Bcc` header of the email. If the email doesn't have a `Bcc` header (which will be true for most emails outside of the Sent mailbox), this is `null`. If the header exists but does not have any content, the response is an array of zero length.
-- **replyTo**: `Emailer|null`
-  An Emailer object (see below) containing the name/email from the parsed `Reply-To` header of the email. If the email doesn't have a `Reply-To` header, this is `null`.
-- **subject**: `String`
-  The subject of the message.
-- **date**: `Date`
-  The date the message was sent (or saved, if the message is a draft).
-- **size**: `Number`
-  The size in bytes of the whole message as counted by the server towards the user's quota.
-- **preview**: `String`
-  Up to 256 characters of the beginning of a plain text version of the message body. This is intended to be shown as a preview line on a mailbox listing, and the server may choose to skip quoted sections or salutations to return a more useful preview.
-- **textBody**: `String|null`
-  The plain text body part for the message. If there is only an HTML version of the body, a plain text version will be generated from this.
-- **htmlBody**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The HTML body part for the message if present. If there is only a plain text version of the body, an HTML version will be generated from this. Any scripting content, or references to external plugins, MUST be stripped from the HTML by the server.
-- **attachments**: `Attachment[]|null`
-  An array of attachment objects (see below) detailing all the attachments to the message.
-- **attachedMessages**: `String[Message]|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  An object mapping attachment id (as found in the `attachments` property) to a **Message** object with the following properties, for each RFC2822 message attached to this one:
-  - headers
-  - from
-  - to
-  - cc
-  - bcc
-  - replyTo
-  - subject
-  - date
-  - textBody
-  - htmlBody
-  - attachments
-  - attachedMessages
-
-An **Emailer** object has the following properties:
-
-- **name**: `String`
-  The name of the sender/recipient. If a name cannot be extracted for an email, this property should be the empty string.
-- **email**: `String`
-  The email address of the sender/recipient. This MUST be of the form `"<mailbox>@<host>"` If a `host` or even `mailbox` cannot be extracted for an email, the empty string should be used for this part (so the result will always still contain an `"@"`).
-
-Example Emailer object:
-
-    [
-        {name:"Joe Bloggs", email:"joeb@example.com"},
-        {name:"", email:"john@example.com"},
-        {name:"John Smith", email: "john@"}
-    ]
-
-An **Attachment** object has the following properties:
-
-- **blobId**: `String`
-  The id of the binary data.
-- **type**: `String`
-  The content-type of the attachment.
-- **name**: `String`
-  The full file name, e.g. "myworddocument.doc"
-- **size**: `Number`
-  The size, in bytes, of the attachment when fully decoded (i.e. the number of bytes in the file the user would download).
-- **cid**: `String|null`
-  The id used within the message body to reference this attachment. This is only unique when paired with the message id, and has no meaning without reference to that.
-- **isInline**: `Boolean`
-  True if the attachment is referenced by a `cid:` link from within the HTML body of the message.
-- **width**: `Number|null`
-  The width (in px) of the image, if the attachment is an image.
-- **height**: `Number|null`
-  The height (in px) of the image, if the attachment is an image.
-
-### getMessages
-
-Messages can only be fetched explicitly by id. To fetch messages, make a call to `getMessages`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **ids**: `String[]`
-  An array of ids for the messages to fetch.
-- **properties**: `String[]|null`
-  A list of properties to fetch for each message. If `null`, all properties will be fetched.
-
-The `id` property is always returned, regardless of whether it is in the list of requested properties. The possible values for `properties` can be found above in the description of the Message object. In addition to this, the client may request the following special values:
-
-- **body**: If `"body"` is included in the list of requested properties, it will be interpreted by the server as a request for `"htmlBody"` if the message has an HTML part, or `"textBody"` otherwise.
-- **headers.property**: Instead of requesting all the headers (by requesting the `"headers"` property, the client may specify the particular headers it wants using the `headers.property-name` syntax, e.g. `"headers.X-Spam-Score", "headers.X-Spam-Hits"`). The server will return a *headers* property but with just the requested headers in the object rather than all headers. If `"headers"` is requested, the server MUST ignore the individual header requests and just return all headers. If a r [...]
-
-The response to *getMessages* is called *messages*. It has the following arguments:
-
-- **accountId**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the account used for the call.
-- **state**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  A string encoding the current state on the server. This string will change
-  if any messages change (that is, a new message arrives, a change is made to one of the mutable properties, or a message is deleted). It can be passed to *getMessageUpdates* to efficiently get the list of changes from the previous state.
-- **list**: `Message[]`
-  An array of Message objects for the requested message ids. This may not be in the same order as the ids were in the request.
-- **notFound**: `String[]|null`
-  An array of message ids requested which could not be found, or `null` if all
-  ids were found.
-
-The following errors may be returned instead of the *messages* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-Example request:
-
-    ["getMessages", {
-      "ids": [ "f123u456", "f123u457" ],
-      "properties": [ "threadId", "mailboxIds", "from", "subject", "date" ]
-    }, "#1"]
-
-and response:
-
-    ["messages", {
-      "state": "41234123231",
-      "list": [
-        {
-          messageId: "f123u457",
-          threadId: "ef1314a",
-          mailboxIds: [ "f123" ],
-          from: [{name: "Joe Bloggs", email: "joe@bloggs.com"}],
-          subject: "Dinner on Thursday?",
-          date: "2013-10-13T14:12:00Z"
-        }
-      ],
-      notFound: [ "f123u456" ]
-    }, "#1"]
-
-
-### getMessageUpdates
-<aside class="warning">
-Not implemented
-</aside>
-
-If a call to *getMessages* returns with a different *state* string in the response to a previous call, the state of the messages has changed on the server. For example, a new message may have been delivered, or an existing message may have changed mailboxes.
-
-The *getMessageUpdates* call allows a client to efficiently update the state of any cached messages to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *messages* response. The server will return the changes made since this state.
-- **maxChanges**: `Number|null`
-  The maximum number of changed messages to return in the response. The server MAY choose to clamp this value to a particular maximum or set a maximum if none is given by the client. If supplied by the client, the value MUST be a positive integer greater than 0. If a value outside of this range is given, the server MUST reject the call with an `invalidArguments` error.
-- **fetchRecords**: `Boolean|null`
-  If true, after outputting a *messageUpdates* response, an implicit call will be made to *getMessages* with a list of all message ids in the *changed* argument of the response as the *ids* argument, and the *fetchRecordProperties* argument as the *properties* argument.
-- **fetchRecordProperties**: `String[]|null`
-  The list of properties to fetch on any fetched messages. See *getMessages* for a full description.
-
-The response to *getMessageUpdates* is called *messageUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **hasMoreUpdates**: `Boolean`
-  If `true`, the client may call *getMessageUpdates* again with the *newState* returned to get further updates. If `false`, *newState* is the current server state.
-- **changed**: `String[]`
-  An array of message ids for messages that have either been created or had their state change, and are not currently deleted.
-- **removed**: `String[]`
-  An array of message ids for messages that have been deleted since the oldState.
-
-If a *maxChanges* is supplied, or set automatically by the server, the server must try to limit the number of ids across *changed* and *removed* to the number given. If there are more changes than this between the client's state and the current server state, the update returned MUST take the client to an intermediate state, from which the client can continue to call *getMessageUpdates* until it is fully up to date. The server MAY return more ids than the *maxChanges* total if this is req [...]
-
-If a message has been modified AND deleted since the oldState, the server should just return the id in the *removed* response, but MAY return it in the changed response as well. If a message has been created AND deleted since the oldState, the server should remove the message id from the response entirely, but MAY include it in the *removed* response, and (if in the *removed* response) MAY included it in the *changed* response as well.
-
-The following errors may be returned instead of the *messageUpdates* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old, or the server being unable to produce an update to an intermediate state when there are too many updates. The client MUST invalidate its Message cache. The error object MUST also include a `newState: String` property with the current state for the type.
-
-### setMessages
-
-The *setMessages* method encompasses:
-
-- Creating a draft message
-<aside class="warning">Not implemented</aside>
-- Sending a message
-- Changing the flags of a message (unread/flagged status)
-
-- Adding/removing a message to/from mailboxes (moving a message)
-- Deleting messages
-
-It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **ifInState**: `String|null`
-  This is a state string as returned by the *getMessages* method. If supplied, the string must match the current state, otherwise the method will be aborted and a `stateMismatch` error returned.
-- **create**: `String[Message]|null`
-  A map of *creation id* (an arbitrary string set by the client) to Message objects (see below for a detailed description).
-- **update**: `String[Message]|null`
-  A map of id to a an object containing the properties to update for that Message.
-- **destroy**: `String[]|null`
-  A list of ids for Message objects to permanently delete.
-
-Each create, update or destroy is considered an atomic unit. It is permissible for the server to commit some of the changes but not others, however it is not permissible to only commit part of an update to a single record (e.g. update the *isFlagged* field but not the *mailboxIds* field, if both are supplied in the update object for a message).
-
-If a create, update or destroy is rejected, the appropriate error should be added to the notCreated/notUpdated/notDestroyed property of the response and the server MUST continue to the next create/update/destroy. It does not terminate the method.
-
-If an id given cannot be found, the update or destroy MUST be rejected with a `notFound` set error.
-
-#### Saving a draft
-
-Creating messages via the *setMessages* method is only for creating draft messages and sending them. For delivering/importing a complete RFC2822 message, use the `importMessages` method.
-
-The properties of the Message object submitted for creation MUST conform to the following conditions:
-
-- **id**: This property MUST NOT be included. It is set by the server upon creation.
-- **blobId**: This property MUST NOT be included. It is set by the server upon creation.
-- **threadId**: This property MUST NOT be included. It is set by the server upon creation.
-- **mailboxIds**: This property MUST be included. The value MUST include the id of either the mailbox with `role == "drafts"` (to save a draft) or the mailbox with `role == "outbox"` (to send the message). If this mailbox does not have `mustBeOnlyMailbox == true`, others may be included too.
-- **inReplyToMessageId**: Optional. If included, the server will look up this message and if found set appropriate `References` and `In-Reply-To` headers. These will override any such headers supplied in the *headers* property. If not found, the creation MUST be rejected with an `inReplyToNotFound` error.
-- **isUnread**: Optional, defaults to `false`. If included this MUST be `false`.
-- **isFlagged**: Optional, defaults to `false`.
-- **isAnswered**: Optional, defaults to `false`. If included this MUST be `false`.
-- **isDraft**: Optional, defaults to `true`. If included this MUST be `true`.
-- **hasAttachment**: This property MUST NOT be included. It is set by the server upon creation based on the attachments property.
-- **headers**: Optional. The keys MUST only contain the characters A-Z, a-z, 0-9 and hyphens.
-- **from**: Optional. Overrides a "From" in the *headers*.
-- **to**: Optional. Overrides a "To" in the *headers*.
-- **cc**: Optional. Overrides a "Cc" in the *headers*.
-- **bcc**:  Optional. Overrides a "Bcc" in the *headers*.
-- **replyTo**: Optional. Overrides a "Reply-To" in the *headers*.
-- **subject**: Optional. Defaults to the empty string (`""`).
-- **date**: Optional. If included, the server SHOULD wait until this time to send the message (once moved to the outbox folder). Until it is sent, the send may be cancelled by moving the message back out of the outbox folder. If the date is in the past, the message must be sent immediately. A client may find out if the server supports delayed sending by querying the capabilities property of the Account object.
-- **size**: This MUST NOT be included. It is set by the server upon creation.
-- **preview**: This MUST NOT be included. It is set by the server upon creation.
-- **textBody**: Optional. If not supplied and an htmlBody is, the server SHOULD generate a text version for the message from this.
-- **htmlBody**: Optional. If this contains internal links (cid:) the cid value should be the attachment id.
-- **attachments**: Optional. An array of Attachment objects detailing all the attachments to the message. To add an attachment, the file must first be uploaded using the standard upload mechanism; this will give the client a URL that may be used to identify the file. The `id` property may be assigned by the client, and is solely used for matching up with `cid:<id>` links inside the `htmlBody`. The server MAY (and probably will) change the ids upon sending.
-
-  If one of the attachments is not found, the creation MUST be rejected with an `invalidProperties` error. An extra property SHOULD be included in the error object called `attachmentsNotFound`, of type `String[]`, which should be an array of the ids of any attachments that could not be found on the server.
-- **attachedMessages**: This MUST NOT be included.
-
-All optional properties default to `null` unless otherwise stated. Where included, properties MUST conform to the type given in the Message object definition.
-
-If any of the properties are invalid, the server MUST reject the create with an `invalidProperties` error. The Error object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user-friendly description of the problems.
-
-Other than making sure it conforms to the correct type, the server MUST NOT attempt to validate from/to/cc/bcc when saved as a draft. This is to ensure messages can be saved at any point. Validation occurs when the user tries to send a message.
-
-If a draft cannot be saved due to the user reaching their maximum mail storage quota, the creation MUST be rejected with a `maxQuotaReached` error.
-
-#### Updating messages
-
-Messages are mainly immutable, so to update a draft the client must create a new message and delete the old one. This ensures that if the draft is also being edited elsewhere, the two will split into two different drafts to avoid data loss.
-
-Only the following properties may be modified:
-
-- **mailboxIds**: The server MUST reject any attempt to add a message with `isDraft == false` to the outbox. The server MAY reject attempts to add a draft message to a mailbox that does not have a role of `drafts`, `outbox` or `templates`.
-- **isFlagged**
-- **isUnread**
-- **isAnswered**
-
-Note, a mailbox id may be a *creation id* (see `setFoos` for a description of how this works).
-
-If any of the properties in the update are invalid (immutable and different to the current server value, wrong type, invalid value for the property – like a mailbox id for non-existent mailbox), the server MUST reject the update with an `invalidProperties` error. The Error object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user-friendly de [...]
-
-If the *id* given does not correspond to a Message in the given account, reject the update with a `notFound` error.
-
-To **delete a message** to trash, simply change the `mailboxIds` property so it is now in the mailbox with `role == "trash"`. If the mailbox has the property `mustBeOnlyMailbox == true`, it must be removed from all other mailboxes. Otherwise, leave it in those mailboxes so that it will be restored to its previous state if undeleted.
-<aside class="warning">Not implemented</aside>
-
-#### Sending messages
-
-To send a message, either create a new message directly into the mailbox with `role == "outbox"` or move an existing draft into this mailbox. At this point the server will check that it has everything it needs for a valid message. In particular, that it has a valid "From" address, it has at least one address to send to, and all addresses in To/Cc/Bcc are valid email addresses. If it cannot send, it will reject the creation/update with an `invalidProperties` error. The Error object SHOULD [...]
-
-If the message is accepted, the server should **asynchronously** schedule the message to be sent **after** this method call is complete (note, this MAY occur before the next method in the same API request or after the whole API request is complete). This means that the `newState` string in the response represents a state where the message is still in the outbox. When the message is sent, the server MUST delete the message from the **outbox** and SHOULD create a **new** copy of the sent m [...]
-
-#### Cancelling a send
-
-A message may be moved out of the **outbox** and back to the **drafts** mailbox using the standard update message mechanism, if it has not yet been sent at the time the method is called. This MUST cancel the queued send. If the message has already been sent then it will have been deleted from the outbox, so the update will fail with a standard `notFound` error.
-
-#### Destroying messages
-
-If the *id* given does not correspond to a Message in the given account, the server MUST reject the destruction with a `notFound` error.
-
-Destroying a message removes it from all mailboxes to which it belonged.
-
-#### Response
-
-The response to *setMessages* is called *messagesSet*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String|null`
-  The state string that would have been returned by *getMessages* before making the requested changes, or `null` if the server doesn't know what the previous state string was.
-- **newState**: `String`
-  The state string that will now be returned by *getMessages*.
-- **created**: `String[Message]`
-  A map of the creation id to an object containing the *id*, *blobId*, *threadId*, and *size* properties for each successfully created Message.
-- **updated**: `String[]`
-  A list of Message ids for Messages that were successfully updated.
-- **destroyed**: `String[]`
-  A list of Message ids for Messages that were successfully destroyed.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each Message that failed to be created. The possible errors are defined above.
-- **notUpdated**: `String[SetError]`
-  A map of Message id to a SetError object for each Message that failed to be updated. The possible errors are defined above.
-- **notDestroyed**: `String[SetError]`
-  A map of Message id to a SetError object for each Message that failed to be destroyed. The possible errors are defined above.
-
-The following errors may be returned instead of the *messagesSet* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`stateMismatch`: Returned if an *ifInState* argument was supplied and it does not match the current state.
-
-### importMessages
-<aside class="warning">
-Not implemented
-</aside>
-
-The *importMessages* method adds RFC2822 messages to a user's set of messages. The messages must first be uploaded as a file using the standard upload mechanism. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, defaults to the primary account.
-- **messages**: `String[MessageImport]`
-  A map of creation id (client specified) to MessageImport objects
-
-An **ImportMessage** object has the following properties:
-
-- **file**: `String`
-  The URL of the uploaded file (see the file upload section).
-- **mailboxIds** `String[]`
-  The ids of the mailbox(es) to assign this message to.
-- **isUnread**: `Boolean`
-- **isFlagged**: `Boolean`
-- **isAnswered**: `Boolean`
-- **isDraft**: `Boolean`
-
-If `isDraft == true`, the mailboxes MUST include the drafts or outbox mailbox. Adding to the outbox will send the message, as described in the *setMessages* section (it will NOT automatically mark any other message as *isAnswered*).
-
-The response to *importMessages* is called *messagesImported*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for this call.
-- **created**: `String[Message]`
-  A map of the creation id to an object containing the *id*, *blobId*, *threadId* and *size* properties for each successfully imported Message.
-- **notCreated**: `String[SetError]`
-  A map of creation id to a SetError object for each Message that failed to be created. The possible errors are defined above.
-
-The following errors may be returned instead of the *messageImported* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`notFound`: Returned if the URL given in the `file` argument does not correspond to an internal file.
-
-`invalidMailboxes`: Returned if one of the mailbox ids cannot be found, or an invalid combination of mailbox ids is specified.
-
-`maxQuotaReached`: Returned if the user has reached their mail quota so the message cannot be imported.
-
-### copyMessages
-<aside class="warning">
-Not implemented
-</aside>
-
-The only way to move messages **between** two different accounts is to copy them using the *copyMessages* method, then once the copy has succeeded, delete the original. It takes the following arguments:
-
-- **fromAccountId**: `String|null`
-  The id of the account to copy messages from. If `null`, defaults to the primary account.
-- **toAccountId**: `String|null`
-  The id of the account to copy messages to. If `null`, defaults to the primary account.
-- **messages**: `String[MessageCopy]`
-  A map of *creation id* to a MessageCopy object.
-
-A **MessageCopy** object has the following properties:
-
-- **messageId**: `String`
-  The id of the message to be copied in the "from" account.
-- **mailboxIds**: `String[]`
-  The ids of the mailboxes (in the "to" account) to add the copied message to.
-- **isUnread**: `Boolean`
-  The *isUnread* property for the copy.
-- **isFlagged**: `Boolean`
-  The *isFlagged* property for the copy.
-- **isAnswered**: `Boolean`
-  The *isAnswered* property for the copy.
-- **isDraft**: `Boolean`
-  The *isDraft* property for the copy.
-
-The "from" account may be the same as the "to" account to copy messages within an account.
-
-The response to *copyMessages* is called *messagesCopied*. It has the following arguments:
-
-- **fromAccountId**: `String`
-  The id of the account messages were copied from.
-- **toAccountId**: `String`
-  The id of the account messages were copied to.
-- **created**: `String[Message]|null`
-  A map of the creation id to an object containing the *id*, *blobId*, *threadId* and *size* properties for each successfully copied Message.
-- **notCreated**: `String[SetError]|null`
-  A map of creation id to a SetError object for each Message that failed to be copied, `null` if none.
-
-The **SetError** may be one of the following types:
-
-`notFound`: Returned if the messageId given can't be found.
-
-`invalidMailboxes`: Returned if one of the mailbox ids cannot be found, or an invalid combination of mailbox ids is specified.
-
-`maxQuotaReached`: Returned if the user has reached their mail quota so the message cannot be copied.
-
-The following errors may be returned instead of the *messagesCopied* response:
-
-`fromAccountNotFound`: Returned if a *fromAccountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`toAccountNotFound`: Returned if a *toAccountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`fromAccountNoMail`: Returned if the *fromAccountId* given corresponds to a valid account, but does not contain any mail data.
-
-`toAccountNoMail`: Returned if the *toAccountId* given corresponds to a valid account, but does not contain any mail data.
-
-`accountReadOnly`: Returned if the "to" account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-### reportMessages
-<aside class="warning">
-Not implemented
-</aside>
-
-Messages can be reported as spam or non-spam to help train the user's spam filter. This MUST NOT affect the state of the Message objects (it DOES NOT move a message into or out of the Spam mailbox).
-
-To report messages, make a call to *reportMessages*. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **messageIds**: `String[]`
-  The list of ids of messages to report.
-- **asSpam**: `Boolean`
-  If `true`, learn these messages as spam. If `false`, learn as non-spam.
-
-
-The response to *reportMessages* is called *messagesReported*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for this call.
-- **asSpam**: `Boolean`
-  Echoed back from the call
-- **reported**: `String[]`
-  The ids of each message successfully reported.
-- **notFound**: `String`
-  The ids of each message not found.
-
-The following errors may be returned instead of the *messagesReported* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`accountReadOnly`: Returned if the account has `isReadOnly == true`.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/messagelist.mdwn b/server/protocols/jmap-draft/doc/specs/spec/messagelist.mdwn
deleted file mode 100644
index dc224e9b03..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/messagelist.mdwn
+++ /dev/null
@@ -1,341 +0,0 @@
-## MessageLists
-
-A **MessageList** is a sorted query on the set of messages in a user's account. Since it can be very long, the client must specify what section of the list to return. The client can optionally also fetch the threads and/or messages for this part of the list.
-
-The same message may appear in multiple messages lists. For example, it may belong to multiple mailboxes, and of course it can appear in searches. Since messages have an immutable id, a client can easily tell if it already has a message cached and only fetch the ones it needs.
-
-When the state changes on the server, a delta update can be requested to efficiently update the client's cache of this list to the new state. If the server doesn't support this, the client still only needs to fetch the message list again, not the messages themselves.
-
-### getMessageList
-
-To fetch a message list, make a call to *getMessageList*. It takes the following arguments:
-
-- **accountId**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **filter**: `FilterCondition|FilterOperator|null`
-  <aside class="notice">
-  Only filtering on a list of mailboxIds is supported
-  </aside>
-  Determines the set of messages returned in the results. See the "Filtering" section below for allowed values and semantics.
-- **sort**: `String[]|null`
-  A list of Message property names to sort by. See the "Sorting" section below for allowed values and semantics.
-- **collapseThreads**: `Boolean|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  If true, each thread will only be returned once in the resulting list, at the position of the first message in the list (given the filter and sort order) belonging to the thread. If `false` or `null`, threads may be returned multiple times.
-- **position**: `Number|null`
-  The 0-based index of the first result in the list to return. If a negative value is given, the call MUST be rejected with an `invalidArguments` error. If `null`, 0 is used.
-- **anchor**: `String|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  A Message id. The index of this message id will be used in combination with the `anchorOffset` argument to determine the index of the first result to return (see the "Windowing" section below for more details).
-- **anchorOffset**: `Number|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The index of the anchor message relative to the index of the first result to return. This MAY be negative. For example, `-1` means the first message after the anchor message should be the first result in the results returned (see the "Windowing" section below for more details).
-- **limit**: `Number|null`
-  The maximum number of results to return. If `null`, no limit is presumed. The server MAY choose to enforce a maximum `limit` argument. In this case, if a greater value is given, the limit should be clamped to the maximum; since the total number of results in the list is returned, the client should not be relying on how many results are returned to determine if it has reached the end of the list. If a negative value is given, the call MUST be rejected with an `invalidArguments` error.
-- **fetchThreads**: `Boolean|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  If `true`, after outputting a *messageList* response, an implicit call will be made to *getThreads* with the *threadIds* array in the response as the *ids* argument, and the *fetchMessages* and *fetchMessageProperties* arguments passed straight through from the call to *getMessageList*. If `false` or `null`, no implicit call will be made.
-- **fetchMessages**: `Boolean|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  If `true` and `fetchThreads == false`, then after outputting a *messageList* response, an implicit call will be made to *getMessages* with the `messageIds` array in the response as the *ids* argument, and the *fetchMessageProperties* argument as the *properties* argument. If `false` or `null`, no implicit call will be made.
-- **fetchMessageProperties**: `String[]|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The list of properties to fetch on any fetched messages. See *getMessages* for a full description.
-- **fetchSearchSnippets**: `Boolean|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  If `true`, then after outputting a *messageList* and making any other implicit calls, an implicit call will be made to *getSearchSnippets*. The *messageIds* array from the response will be used as the *messageIds* argument, and the *filter* argument will be passed straight through. If `false` or `null`, no implicit call will be made.
-
-#### Filtering
-<aside class="notice">
-Only filtering on a list of mailboxIds is supported
-</aside>
-
-A **FilterOperator** object has the following properties:
-
-- **operator**: `String`
-  This MUST be one of the following strings: "AND"/"OR"/"NOT":
-  - **AND**: all of the conditions must match for the filter to match.
-  - **OR**: at least one of the conditions must match for the filter to match.
-  - **NOT**: none of the conditions must match for the filter to match.
-- **conditions**: `(FilterCondition|FilterOperator)[]`
-  The conditions to evaluate against each message.
-
-A **FilterCondition** object has the following properties:
-
-- **inMailboxes**: `String[]|null`
-  A list of mailbox ids. A message must be in ALL of these mailboxes to match the condition.
-- **notInMailboxes**: `String[]|null`
-  A list of mailbox ids. A message must NOT be in ANY of these mailboxes to match the condition.
-- **before**: `Date|null`
-  The date of the message (as returned on the Message object) must be before this date to match the condition.
-- **after**: `Date|null`
-  The date of the message (as returned on the Message object) must be on or after this date to match the condition.
-- **minSize**: `Number|null`
-  The size of the message in bytes (as returned on the Message object) must be equal to or greater than this number to match the condition.
-- **maxSize**: `Number|null`
-  The size of the message in bytes (as returned on the Message object) must be less than this number to match the condition.
-- **threadIsFlagged**: `Boolean|null`
-  If `true`, the condition is matched if the `isFlagged` property of *any* message in the same thread as the message being examined is `true`. If `false`, the `isFlagged` property of *every* message in the same thread as the message being examined must be `false` to match the condition.
-- **threadIsUnread**: `Boolean|null`
-  If `true`, the condition is matched if the `isUnread` property of *any* message in the same thread as the message being examined is `true`. If `false`, the `isUnread` property of *every* message in the same thread as the message being examined must be `false` to match the condition.
-- **isFlagged**: `Boolean|null`
-  The `isFlagged` property of the message must be identical to the value given to match the condition.
-- **isUnread**: `Boolean|null`
-  The `isUnread` property of the message must be identical to the value given to match the condition.
-- **isAnswered**: `Boolean|null`
-  The `isAnswered` property of the message must be identical to the value given to match the condition.
-- **isDraft**: `Boolean|null`
-  The `isDraft` property of the message must be identical to the value given to match the condition.
-- **hasAttachment**: `Boolean|null`
-  The `hasAttachment` property of the message must be identical to the value given to match the condition.
-- **text**: `String|null`
-  Looks for the text in the *from*, *to*, *cc*, *bcc*, *subject*, *textBody* or *htmlBody* properties of the message.
-- **from**: `String|null`
-  Looks for the text in the *from* property of the message.
-- **to**: `String|null`
-  Looks for the text in the *to* property of the message.
-- **cc**: `String|null`
-  Looks for the text in the *cc* property of the message.
-- **bcc**: `String|null`
-  Looks for the text in the *bcc* property of the message.
-- **subject**: `String|null`
-  Looks for the text in the *subject* property of the message.
-- **body**: `String|null`
-  Looks for the text in the *textBody* or *htmlBody* property of the message.
-- **header**: `String[]|null`
-  The array MUST contain either one or two elements. The first element is the name of the header to match against. The second (optional) element is the text to look for in the header. If not supplied, the message matches simply if it *has* a header of the given name.
-
-If zero properties are specified on the FilterCondition, the condition MUST always evaluate to `true`. If multiple properties are specified, ALL must apply for the condition to be `true` (it is equivalent to splitting the object into one-property conditions and making them all the child of an AND filter operator).
-
-The exact semantics for matching `String` fields is **deliberately not defined** to allow for flexibility in indexing implementation, subject to the following:
-
-- Text SHOULD be matched in a case-insensitive manner.
-- Text contained in either (but matched) single or double quotes SHOULD be treated as a **phrase search**, that is a match is required for that exact sequence of words, excluding the surrounding quotation marks. Use `\"`, `\'` and `\\` to match a literal `"`, `'` and `\` respectively in a phrase.
-- Outside of a phrase, white-space SHOULD be treated as dividing separate tokens that may be searched for separately in the message, but MUST all be present for the message to match the filter.
-- Tokens MAY be matched on a whole-word basis using stemming (so for example a text search for `bus` would match "buses" but not "business").
-- When searching inside the *htmlBody* property, HTML tags and attributes SHOULD be ignored.
-
-#### Sorting
-<aside class="notice">
-Only sorting on id and/or date is supported
-</aside>
-
-The `sort` argument lists the properties to compare between two messages to determine which comes first in the sort. If two messages have an identical value for the first property, the next property will be considered and so on. If all properties are the same (this includes the case where an empty array or `null` is given as the argument), the sort order is server-dependent, but MUST be stable between calls to `getMessageList`.
-
-Optionally, following the property name there can be a space and then either the string `asc` or `desc` to specify ascending or descending sort for that property. If not specified, it MUST default to **descending**.
-
-The following properties MUST be supported for sorting:
-
-- **id** - The id as returned in the Message object.
-- **date** - The date as returned in the Message object.
-
-The following properties SHOULD be supported for sorting:
-
-- **size** - The size as returned in the Message object.
-- **from** – This is taken to be either the "name" part of the Emailer object, or if none then the "email" part of the Emailer object (see the definition of the from property in the Message object). If still none, consider the value to be the empty string.
-- **to** - This is taken to be either the "name" part of the **first** Emailer object, or if none then the "email" part of the **first** Emailer object (see the definition of the to property in the Message object). If still none, consider the value to be the empty string.
-- **subject** - This is taken to be the subject of the Message with any ignoring any leading "Fwd:"s or "Re:"s (case-insensitive match).
-- **threadIsFlagged** - This value MUST be considered `true` for the message if **any** of the messages in the same thread (regardless of mailbox) have `isFlagged: true`.
-- **threadIsUnread** - This value MUST be considered `true` for the message if **any** of the messages in the same thread (regardless of mailbox) have `isUnread: true`.
-- **isFlagged** - The `isFlagged` state of the message (only).
-- **isUnread** - The `isUnread` state of the message (only).
-
-The server MAY support sorting based on other properties as well. A client can discover which properties are supported by inspecting the *capabilities* property on the Account object.
-
-The method of comparison depends on the type of the property:
-
-- `String`: Comparison function is server-dependent. It SHOULD be case-insensitive and SHOULD take into account locale-specific conventions if known for the user. However, the server MAY choose to just sort based on unicode code point, after best-effort translation to lower-case.
-- `Date`: If sorting in ascending order, the earlier date MUST come first.
-- `Boolean`: If sorting in ascending order, a `false` value MUST come before a `true` value.
-
-#### Thread collapsing
-<aside class="warning">
-Not implemented
-</aside>
-
-When `collapseThreads == true`, then after filtering and sorting the message list, the list is further winnowed by removing any messages for a thread id that has already been seen (when passing through the list sequentially). A thread will therefore only appear **once** in the `threadIds` list of the result, at the position of the first message in the list that belongs to the thread.
-
-#### Windowing
-<aside class="warning">
-Not implemented
-</aside>
-
-If a *position* offset is supplied, then this is the 0-based index of the first result to return in the list of messages after filtering, sorting and collapsing threads. If the index is greater than or equal to the total number of messages in the list, then there are no results to return, but this DOES NOT generate an error. If *position* is `null` (or, equivalently, omitted) this MUST be interpreted as `position: 0`.
-
-Alternatively, a message id, called the **anchor** may be given. In this case, after filtering, sorting and collapsing threads, the anchor is searched for in the message list. If found, the **anchor offset** is then subtracted from this index. If the resulting index is now negative, it is clamped to 0. This index is now used exactly as though it were supplied as the `position` argument. If the anchor is not found, the call is rejected with an `anchorNotFound` error.
-
-If an *anchor* is specified, any position argument supplied by the client MUST be ignored. If *anchorOffset* is `null`, it defaults to `0`. If no *anchor* is supplied, any anchor offset argument MUST be ignored.
-
-#### Response
-
-The response to a call to *getMessageList* is called *messageList*. It has the following arguments:
-
-- **accountId**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The id of the account used for the call.
-- **filter**: `FilterCondition|FilterOperator|null`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The filter of the message list. Echoed back from the call.
-- **sort**: `String[]`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  A list of Message property names used to sort by. Echoed back from the call.
-- **collapseThreads**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  Echoed back from the call.
-- **state**: `String`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  A string encoding the current state on the server. This string will change if the results of the message list MAY have changed (for example, there has been a change to the state of the set of Messages; it does not guarantee that anything in the list has changed). It may be passed to *getMessageListUpdates* to efficiently get the set of changes from the previous state.
-
-  Should a client receive back a response with a different state string to a previous call, it MUST either throw away the currently cached list and fetch it again (note, this does not require fetching the messages again, just the list of ids) or, if the server supports it, call *getMessageListUpdates* to get the delta difference.
-- **canCalculateUpdates**: `Boolean`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  This is `true` if the server supports calling `getMessageListUpdates` with these `filter`/`sort`/`collapseThreads` parameters. Note, this does not guarantee that the getMessageListUpdates call will succeed, as it may only be possible for a limited time afterwards due to server internal implementation details.
-- **position**: `Number`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The 0-based index of the first result in the `threadIds` array within the complete list.
-- **total**: `Number`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The total number of messages in the message list (given the *filter* and *collapseThreads* arguments).
-- **threadIds**: `String[]`
-  <aside class="warning">
-  Not implemented
-  </aside>
-  The list of Thread ids for each message in the list after filtering, sorting and collapsing threads, starting at the index given by the *position* argument of this response, and continuing until it hits the end of the list or reaches the `limit` number of ids.
-- **messageIds**: `String[]`
-  The list of Message ids for each message in the list after filtering, sorting and collapsing threads, starting at the index given by the *position* argument of this response, and continuing until it hits the end of the list or reaches the `limit` number of ids.
-
-The following errors may be returned instead of the `messageList` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`unsupportedSort`: Returned if the *sort* includes a property the server does not support sorting on.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`anchorNotFound`: Returned if an anchor argument was supplied, but it cannot be found in the message list.
-
-### getMessageListUpdates
-<aside class="warning">
-Not implemented
-</aside>
-
-The `getMessageListUpdates` call allows a client to efficiently update the state of any cached message list to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, the primary account will be used.
-- **filter**: `FilterCondition|FilterOperator|null`
-  The filter argument that was used with *getMessageList*.
-- **sort**: `String[]|null`
-  The sort argument that was used with *getMessageList*.
-- **collapseThreads**: `Boolean|null`
-  The *collapseThreads* argument that was used with *getMessageList*.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *messageList* response. The server will return the changes made since this state.
-- **uptoMessageId**: `String|null`
-  The message id of the last message in the list that the client knows about. In the common case of the client only having the first X ids cached, this allows the server to ignore changes further down the list the client doesn't care about.
-- **maxChanges**: `Number|null`
-  The maximum number of changes to return in the response. See below for a more detailed description.
-
-The response to *getMessageListUpdates* is called *messageListUpdates* It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **filter**: `FilterCondition|FilterOperator|null`
-  The filter of the message list. Echoed back from the call.
-- **sort**: `String[]|null`
-  A list of Message property names used to sort by. Echoed back from the call.
-- **collapseThreads**: `Boolean`
-  Echoed back from the call.
-- **oldState**: `String`
-  This is the `sinceState` argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **uptoMessageId**: `String|null`
-  Echoed back from the call.
-- **total**: `Number`
-  The total number of messages in the message list (given the filter and collapseThreads arguments).
-- **removed**: `RemovedItem[]`
-  The *messageId* and *threadId* for every message that was in the list in the old state and is not in the list in the new state. If the server cannot calculate this exactly, the server MAY return extra messages in addition that MAY have been in the old list but are not in the new list.
-
-  If an *uptoMessageId* was given AND this id was found in the list, only messages positioned before this message that were removed need be returned.
-
-  In addition, if the sort includes the property *isUnread* or *isFlagged*, the server MUST include all messages in the current list for which this property MAY have changed. If `collapseThreads == true`, then the server MUST include all messages in the current list for which this property MAY have changed **on any of the messages in the thread**.
-
-- **added**: `AddedItem[]`
-  The messageId and threadId and index in the list (in the new state) for every message that has been added to the list since the old state AND every message in the current list that was included in the *removed* array (due to a filter or sort based upon a mutable property). The array MUST be sorted in order of index, lowest index first.
-
-  If an *uptoMessageId* was given AND this id was found in the list, only messages positioned before this message that have been added need be returned.
-
-A **RemovedItem** object has the following properties:
-
-- **messageId**: `String`
-- **threadId**: `String`
-
-An **AddedItem** object has the following properties:
-
-- **messageId**: `String`
-- **threadId**: `String`
-- **index**: `Number`
-
-The result of this should be that if the client has a cached sparse array of message ids in the list in the old state:
-
-    messageIds = [ "id1", "id2", null, null, "id3", "id4", null, null, null ]
-
-then if it **splices out** all messages in the removed array:
-
-    removed = [{ messageId: "id2", … }];
-    messageIds => [ "id1", null, null, "id3", "id4", null, null, null ]
-
-and **splices in** (in order) all of the messages in the added array:
-
-    added = [{ messageId: "id5", index: 0, … }];
-    messageIds => [ "id5", "id1", null, null, "id3", "id4", null, null, null ]
-
-then the message list will now be in the new state.
-
-The following errors may be returned instead of the `messageListUpdates` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`tooManyChanges`: Returned if there are more changes the the client's *maxChanges* argument. Each item in the removed or added array is considered as one change. The client may retry with a higher max changes or invalidate its cache of the message list.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old. The client MUST invalidate its cache of the message list.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/push.mdwn b/server/protocols/jmap-draft/doc/specs/spec/push.mdwn
deleted file mode 100644
index d607c2284c..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/push.mdwn
+++ /dev/null
@@ -1,65 +0,0 @@
-## Push
-<aside class="warning">
-Not implemented
-</aside>
-
-Any modern email client should be able to update instantly whenever the data on the server is changed by another client or message delivery. Push notifications in JMAP occur out-of-band (i.e. not over the same connection as API exchanges) so that they can make use of efficient native push mechanisms on different platforms.
-
-The general model for push is simple and does not send any sensitive data over the push channel, making it suitable for use with less trusted 3rd party intermediaries. The format allows multiple changes to be coalesced into a single push update, and the frequency of pushes to be rate limited by the server. It doesn't matter if some push events are dropped before they reach the client; it will still get all changes next time it syncs.
-
-When something changes on the server, the server pushes a small JSON object to the client with the following property:
-
-- **changed**: `String[ChangedStates]`
-  A map of *account id* to an object encoding the state of data types which have changed for that account since the last push event, for each of the accounts to which the user has access and for which something has changed.
-
-A **ChangedStates** object is a map of the type name (e.g. "Mailbox" or "Message") to the current state token for that type (i.e. the "state" property that would currently be returned by a call to "getMailboxes" or "getMessages", as appropriate). The types in JMAP are "Mailbox", "Thread", "Message", "ContactGroup", "Contact", "Calendar", "CalendarEvent".
-
-Upon receiving this data, the client can compare the new state strings with its current values to see whether it has the current data for these types. The actual changes can then be efficiently fetched in a single standard API request (using the *getFooUpdates* type methods).
-
-### Event Source
-
-There are two mechanisms by which the client can receive the push events. The first is directly via a `text/event-stream` resource, as described in
-<http://www.w3.org/TR/eventsource/>. This is essentially a long running HTTP request down which the server can push data. When a change occurs, the server MUST push an event called **state** to any connected clients.
-
-The server MAY also set a new `Last-Event-Id` that encodes the entire server state visible to the user. When a new connection is made to the event-source endpoint, the server can then work out whether the client has missed some changes which it should send immediately.
-
-The server MUST also send an event called **ping** with an empty object as the data if a maximum of 5 minutes has elapsed since the previous event. This MUST NOT set a new `Last-Event-Id`. A client may detect the absence of these to determine that the HTTP connection has been dropped somewhere along the route and so it needs to re-establish the connection.
-
-Refer to the Authentication section of this spec for details on how to get the URL for the event-source endpoint. The request must be authenticated using an `Authorization` header like any HTTP request.
-
-A client MAY hold open multiple connections to the event-source, although it SHOULD try to use a single connection for efficiency.
-
-### setPushCallback
-
-The second push mechanism is to register a callback URL to which the JMAP server will make an HTTPS POST request whenever the event occurs. The request MUST have a content type of `application/json` and contain the same UTF-8 JSON encoded object as described above as the body.
-
-The JMAP server MUST also set the following headers in the POST request:
-- `X-JMAP-EventType: state`
-- `X-JMAP-User: ${username}` where `${username}` is the username of the authenticated user for which the push event occurred.
-
-The JMAP server MUST follow any redirects. If the final response code from the server is `2xx`, the callback is considered a success. If the response code is `503` (Service Unavailable), the JMAP server MAY try again later (but may also just drop the event). If the response code is `429` (Too Many Requests) the JMAP server SHOULD attempt to reduce the frequency of pushes to that URL. Any other response code SHOULD be considered a **permanent failure** and the callback should be deregiste [...]
-
-The URL set by the client MUST use the HTTPS protocol and SHOULD encode within it a unique token that can be verified by the server to know that the request comes from the JMAP server the authenticated client connected to.
-
-The callback is tied to the access token used to create it. Should the access token expire or be revoked, the callback MUST be removed by the JMAP server. The client MUST re-register the callback after reauthenticating to resume callbacks.
-
-Each session may only have a single callback URL registered. To set it, make a call to *setPushCallback*. It takes the following argument:
-
-- **callback**: `String|null`
-  The (HTTPS) URL the JMAP server should POST events to. This will replace any previously set URL. Set to `null` to just remove any previously set callback URL.
-
-The response to *setPushCallback* is called *pushCallbackSet*. It has the following argument:
-
-- **callback**: `String|null`
-  Echoed back from the call.
-
-The following error may be returned instead of the *mailboxesSet* response:
-
-`invalidUrl`: Returned if the URL does not begin with `https://`, or is otherwise syntactically invalid or does not resolve.
-
-### getPushCallback
-
-To check the currently set callback URL (if any), make a call to *getPushCallback*. It does not take any arguments. The response to *getPushCallback* is called `pushCallback`. It has a single argument:
-
-- **callback**: `String|null`
-  The URL the JMAP server is currently posting push events to, or `null` if none.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/searchsnippet.mdwn b/server/protocols/jmap-draft/doc/specs/spec/searchsnippet.mdwn
deleted file mode 100644
index d870ee4d92..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/searchsnippet.mdwn
+++ /dev/null
@@ -1,44 +0,0 @@
-## SearchSnippets
-<aside class="warning">
-Not implemented
-</aside>
-
-When doing a search on a `String` property, the client may wish to show the relevant section of the body that matches the search as a preview instead of the beginning of the message, and to highlight any matching terms in both this and the subject of the message. Search snippets represent this data.
-
-A **SearchSnippet** object has the following properties:
-
-- **messageId**: `String`
-  The message id the snippet applies to.
-- **subject**: `String|null`
-  If text from the filter matches the subject, this is the subject of the message HTML-escaped, with matching words/phrases wrapped in `<mark></mark>` tags. If it does not match, this is `null`.
-- **preview**: `String|null`
-  If text from the filter matches the plain-text or HTML body, this is the relevant section of the body (converted to plain text if originally HTML), HTML-escaped, with matching words/phrases wrapped in `<mark></mark>` tags, up to 256 characters long. If it does not match, this is `null`.
-
-It is server-defined what is a relevant section of the body for preview. If the server is unable to determine search snippets, it MUST just return `null` for both the *subject* and *preview* properties.
-
-Note, unlike most data types, a SearchSnippet DOES NOT have a property called `id`.
-
-### getSearchSnippets
-
-To fetch search snippets, make a call to `getSearchSnippets`. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If `null`, defaults to the primary account.
-- **messageIds**: `String[]`
-  The list of ids of messages to fetch the snippets for.
-- **filter**: `FilterCondition|FilterOperator|null`
-  The same filter as passed to getMessageList; see the description of this method for details.
-
-The response to `getSearchSnippets` is called `searchSnippets`. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **filter**: `FilterOperator`
-  Echoed back from the call.
-- **list**: `SearchSnippet[]`
-  An array of SearchSnippets objects for the requested message ids. This may not be in the same order as the ids that were in the request.
-- **notFound**: `String[]|null`
-  An array of message ids requested which could not be found, or `null` if all
-  ids were found.
-
-Since snippets are only based on immutable properties, there is no state string or update mechanism needed.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/thread.mdwn b/server/protocols/jmap-draft/doc/specs/spec/thread.mdwn
deleted file mode 100644
index 10d6ad9c82..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/thread.mdwn
+++ /dev/null
@@ -1,123 +0,0 @@
-## Threads
-<aside class="warning">
-Not implemented
-</aside>
-
-Replies are grouped together with the original message to form a thread. In JMAP, a thread is simply a flat list of messages, ordered by date. Every message MUST belong to a thread, even if it is the only message in the thread.
-
-The JMAP spec does not require the server to use any particular algorithm for determining whether two messages belong to the same thread, however there is a recommended algorithm in the [implementation guide](server.html).
-
-If messages are delivered out of order for some reason, a user may receive two messages in the same thread but without headers that associate them with each other. The arrival of a third message in the thread may provide the missing references to join them all together into a single thread. Since the `threadId` of a message is immutable, if the server wishes to merge the threads, it MUST handle this by deleting and reinserting (with a new message id) the messages that change threadId.
-
-A **Thread** object has the following properties:
-
-- **id**: `String`
-  The id of the thread. This property is immutable.
-- **messageIds**: `String[]`
-  The ids of the messages in the thread, sorted such that:
-  - Any message with `isDraft == true` and an *inReplyToMessageId* property that corresponds to another message in the thread comes immediately after that message in the sort order.
-  - Other than that, everything is sorted in date order (the same as the *date* property on the Message object), oldest first.
-
-### getThreads
-
-Threads can only be fetched explicitly by id. To fetch threads, make a call to *getThreads*. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **ids**: `String[]`
-  An array of ids for the threads to fetch.
-- **fetchMessages**: `Boolean|null`
-  If true, after outputting a *threads* response, an implicit call will be made to *getMessages* with a list of all message ids in the returned threads as the *ids* argument, and the *fetchMessageProperties* argument as the *properties* argument. If `false` or `null`, no implicit call will be made.
-- **fetchMessageProperties**: `String[]|null`
-  The list of properties to fetch on any fetched messages. See *getMessages* for a full description.
-
-The response to *getThreads* is called *threads*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **state**: `String`
-  A string encoding the current state on the server. This string will change
-  if any threads change (that is, new messages arrive, or messages are deleted, as these are the only two events that change thread membership). It can be passed to *getThreadUpdates* to efficiently get the list of changes from the previous state.
-- **list**: `Thread[]`
-  An array of Thread objects for the requested thread ids. This may not be in the same order as the ids were in the request.
-- **notFound**: `String[]|null`
-  An array of thread ids requested which could not be found, or `null` if all ids were found.
-
-The following errors may be returned instead of the `threads` response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-Example of a successful request:
-
-    [ "getThreads", {
-      "ids": ["f123u4", "f41u44"],
-      "fetchMessages": false,
-      "fetchMessageProperties": null
-    }, "#1" ]
-
-and response:
-
-    [ "threads", {
-      "state": "f6a7e214",
-      "list": [
-        {
-          "id": "f123u4",
-          "messageIds": [ "eaa623", "f782cbb"]
-        },
-        {
-          "id": "f41u44",
-          "messageIds": [ "82cf7bb" ]
-        }
-      ],
-      "notFound": null
-    }, "#1" ]
-
-
-### getThreadUpdates
-
-When messages are created or deleted, new threads may be created, or the set of messages belonging to an existing thread may change. If a call to *getThreads* returns with a different *state* string in the response to a previous call, the state of the threads has changed on the server and the client needs to work out which part of its cache is now invalid.
-
-The *getThreadUpdates* call allows a client to efficiently update the state of any cached threads to match the new state on the server. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The id of the account to use for this call. If not given, defaults to the primary account.
-- **sinceState**: `String`
-  The current state of the client. This is the string that was returned as the *state* argument in the *threads* response. The server will return the changes made since this state.
-- **maxChanges**: `Number|null`
-  The maximum number of Thread ids to return in the response. The server MAY choose to clamp this value to a particular maximum or set a maximum if none is given by the client. If supplied by the client, the value MUST be a positive integer greater than 0. If a value outside of this range is given, the server MUST reject the call with an `invalidArguments` error.
-- **fetchRecords**: `Boolean|null`
-  If `true`, after outputting a *threadUpdates* response, an implicit call will be made to *getThreads* with the *changed* property of the response as the *ids* argument, and *fetchMessages* equal to `false`.
-
-The response to *getThreadUpdates* is called *threadUpdates*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **oldState**: `String`
-  This is the *sinceState* argument echoed back; the state from which the server is returning changes.
-- **newState**: `String`
-  This is the state the client will be in after applying the set of changes to the old state.
-- **hasMoreUpdates**: `Boolean`
-  If `true`, the client may call *getThreadUpdates* again with the *newState* returned to get further updates. If `false`, *newState* is the current server state.
-- **changed**: `String[]`
-  An array of thread ids where the list of messages within the thread has
-  changed between the old state and the new state, and the thread currently has at least one message in it.
-- **removed**: `String[]`
-  An array of thread ids where the list of messages within the thread has changed since the old state, and there are now no messages in the thread.
-
-If a *maxChanges* is supplied, or set automatically by the server, the server must try to limit the number of ids across *changed* and *removed* to the number given. If there are more changes than this between the client's state and the current server state, the update returned MUST take the client to an intermediate state, from which the client can continue to call *getThreadUpdates* until it is fully up to date. The server MAY return more ids than the *maxChanges* total if this is requ [...]
-
-If a thread has been modified AND deleted since the oldState, the server SHOULD just return the id in the *removed* response, but MAY return it in the changed response as well. If a thread has been created AND deleted since the oldState, the server should remove the thread id from the response entirely, but MAY include it in the *removed* response, and optionally the *changed* response as well.
-
-The following errors may be returned instead of the *threadUpdates* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if the request does not include one of the required arguments, or one of the arguments is of the wrong type, or otherwise invalid. A *description* property MAY be present on the response object to help debug with an explanation of what the problem was.
-
-`cannotCalculateChanges`: Returned if the server cannot calculate the changes from the state string given by the client. Usually due to the client's state being too old, or the server being unable to produce an update to an intermediate state when there are too many updates. The client MUST invalidate its Thread cache. The error object MUST also include a `newState: String` property with the current state for the type.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/upload.mdwn b/server/protocols/jmap-draft/doc/specs/spec/upload.mdwn
deleted file mode 100644
index 15a54b2292..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/upload.mdwn
+++ /dev/null
@@ -1,53 +0,0 @@
-## File Uploads
-<aside class="warning">
-Not implemented
-</aside>
-
-There is a single endpoint which handles all file uploads, regardless of what they are to be used for. To upload a file, submit a POST request to the file upload endpoint (see the authentication section for information on how to obtain this URL). The Content-Type MUST be correctly set for the type of the file being uploaded. The request MUST be authenticated as per any HTTP request. The request MAY include an "X-JMAP-AccountId" header, with the value being the account to use for the requ [...]
-
-The server will respond with one of the following HTTP response codes:
-
-#### `201`: File uploaded successfully
-
-The content of the response is a single JSON object with the following properties:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **blobId**: `String`,
-  The id representing the binary data uploaded. The data for this id is immutable. The id *only* refers to the binary data, not any metadata.
-- **type**: `String`
-  The content type of the file.
-- **size**: `Number`
-  The size of the file in bytes.
-- **expires**: `Date`
-  The date the file will be deleted from temp storage if not referenced by another object, e.g. used in a draft.
-
-Once the file has been used, for example attached to a draft message, the file will no longer expire, and is instead guaranteed to exist while at least one other object references it. Once no other object references it, the server MAY immediately delete the file at any time. It MUST NOT delete the file during the method call which removed the last reference, so that if there is a create and a delete within the same call which both reference the file, this always works.
-
-If uploading a file would take the user over quota, the server SHOULD delete previously uploaded (but unused) files before their expiry time. This means a client does not have to explicitly delete unused temporary files (indeed, there is no way for it to do so).
-
-If identical binary content is uploaded, the same *blobId* SHOULD be returned.
-
-#### `400`: Bad request
-
-The request was malformed (this includes the case where an `X-JMAP-AccountId` header is sent with a value that does not exist). The client SHOULD NOT retry the same request.
-
-#### `401`: Unauthorized
-
-The `Authorization` header was missing or did not contain a valid token. Reauthenticate and then retry the request. There is no content in the response.
-
-#### `404`: Not Found
-
-The upload endpoint has moved. See the Authentication section of the spec for how to rediscover the current URL to use. There is no content in the response.
-
-#### `413`:  Request Entity Too Large
-
-The file is larger than the maximum size the server is willing to accept for a single file. The client SHOULD NOT retry uploading the same file. There is no content in the response. The client may discover the maximum size the server is prepared to accept by inspecting the capabilities property of the Account object.
-
-#### `415`: Unsupported Media Type
-
-The server MAY choose to not allow certain content types to be uploaded, such as executable files. This error response is returned if an unacceptable type is uploaded. The client SHOULD NOT retry uploading the same file. There is no content in the response.
-
-#### `503`: Service Unavailable
-
-The server is currently down. The client should try again later with exponential backoff. There is no content in the response.
diff --git a/server/protocols/jmap-draft/doc/specs/spec/vacationresponse.mdwn b/server/protocols/jmap-draft/doc/specs/spec/vacationresponse.mdwn
deleted file mode 100644
index 255c9f6308..0000000000
--- a/server/protocols/jmap-draft/doc/specs/spec/vacationresponse.mdwn
+++ /dev/null
@@ -1,71 +0,0 @@
-## Vacation Response
-
-The **VacationResponse** object represents the state of vacation-response
-related settings for an account. It has the following properties:
-
-- **id**: `String`
-  The id of the object. This property is immutable. There is only ever one
-  vacation response object, and its id is `"singleton"`.
-- **isEnabled** `Boolean`
-  Is the vacation response enabled?
-- **fromDate**: `Date|null`
-  If *isEnabled* is `true`, the date/time after which messages that arrive should receive the user's vacation response, in UTC. If `null`, the vacation response is effective immediately.
-- **toDate**: `Date|null`
-  If *isEnabled* is `true`, the date/time after which messages that arrive should no longer receive the user's vacation response, in UTC. If `null`, the vacation response is effective indefinitely.
-- **textBody**: `String`
-  The plain text message to send in response to messages when the vacation response is enabled.
-
-### getVacationResponse
-
-There MUST only be exactly one VacationResponse object in an account. It MUST have the id `"singleton"`.
-
-To fetch the vacation response object, make a call to `getVacationResponse`. It takes the following argument:
-
-- **accountId**: `String|null`
-  The Account to get the vacation response for. If `null`, the primary account is used.
-
-The response to *getVacationResponse* is called *vacationResponse*. It has the following arguments:
-
-- **accountId**: `String`
-  The id of the account used for the call.
-- **list**: `VacationResponse[]`
-  An array containing the single VacationResponse object.
-
-The following errors may be returned instead of the *vacationResponse* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-### setVacationResponse
-
-Sets properties on the vacation response object. It takes the following arguments:
-
-- **accountId**: `String|null`
-  The Account to set the vacation response for. If `null`, the primary account is used.
-- **update**: `String[VacationResponse]|null`
-  A map of id ("singleton") to the VacationResponse object with new values for the properties you wish to change. The object may omit any property; only properties that have changed need be included.
-
-If any of the properties in the update are invalid (immutable and different to the current server value, wrong type), the server MUST reject the update with a SetError of type `invalidProperties`. The SetError object SHOULD contain a property called *properties* of type `String[]` that lists **all** the properties that were invalid. The object MAY also contain a *description* property of type `String` with a user-friendly description of the problems.
-
-The response is called *vacationResponseSet*. It has the following arguments:
-
-- **updated**: `String[]`
-  Contains the single id ("singleton") if the vacation response was successfully updated.
-- **notUpdated**: `String[SetError]`
-  A map of id ("singleton") to a SetError object if the update failed.
-
-A **SetError** object has the following properties:
-
-- **type**: `String`
-  The type of error.
-- **description**: `String|null`
-  A description of the error to display to the user.
-
-The following errors may be returned instead of the *vacationResponseSet* response:
-
-`accountNotFound`: Returned if an *accountId* was explicitly included with the request, but it does not correspond to a valid account.
-
-`accountNoMail`: Returned if the *accountId* given corresponds to a valid account, but does not contain any mail data.
-
-`invalidArguments`: Returned if one of the arguments is of the wrong type, or otherwise invalid (including using an id other than `"singleton"`). A `description` property MAY be present on the response object to help debug with an explanation of what the problem was.
diff --git a/server/protocols/jmap-draft/pom.xml b/server/protocols/jmap-draft/pom.xml
deleted file mode 100644
index db324ddf0e..0000000000
--- a/server/protocols/jmap-draft/pom.xml
+++ /dev/null
@@ -1,328 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>james-server</artifactId>
-        <version>3.9.0-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>james-server-jmap-draft</artifactId>
-    <packaging>jar</packaging>
-
-    <name>Apache James :: Server :: JMAP (Draft)</name>
-
-    <properties>
-        <zalando.version>1.13.0</zalando.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-mailbox-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-mailbox-api</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-mailbox-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-mailbox-memory</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-mailet-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>blob-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>blob-storage-strategy</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>event-bus-api</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>event-sourcing-event-store-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-mdn</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-data-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-data-jmap</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-data-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-dnsservice-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-filesystem-api</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-rfc-8621</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jmap-rfc-8621</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jwt</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-lifecycle-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-queue-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-queue-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-testing</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-util</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>metrics-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>metrics-logger</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>metrics-tests</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>testing-base</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.datatype</groupId>
-            <artifactId>jackson-datatype-guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.datatype</groupId>
-            <artifactId>jackson-datatype-jdk8</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.datatype</groupId>
-            <artifactId>jackson-datatype-jsr310</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.github.dpaukov</groupId>
-            <artifactId>combinatoricslib3</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.github.fge</groupId>
-            <artifactId>throwing-lambdas</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.jayway.jsonpath</groupId>
-            <artifactId>json-path</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.github.hakky54</groupId>
-            <artifactId>sslcontext-kickstart-for-pem</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.jsonwebtoken</groupId>
-            <artifactId>jjwt-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.jsonwebtoken</groupId>
-            <artifactId>jjwt-impl</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.jsonwebtoken</groupId>
-            <artifactId>jjwt-jackson</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.projectreactor</groupId>
-            <artifactId>reactor-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.projectreactor.netty</groupId>
-            <artifactId>reactor-netty</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.rest-assured</groupId>
-            <artifactId>rest-assured</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.vavr</groupId>
-            <artifactId>vavr</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>jakarta.inject</groupId>
-            <artifactId>jakarta.inject-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>net.javacrumbs.json-unit</groupId>
-            <artifactId>json-unit-assertj</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-mime4j-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-mime4j-dom</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.jgrapht</groupId>
-            <artifactId>jgrapht-core</artifactId>
-            <version>1.5.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jsoup</groupId>
-            <artifactId>jsoup</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.junit.platform</groupId>
-            <artifactId>junit-platform-engine</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>${james.groupId}</groupId>
-                <artifactId>mailetdocs-maven-plugin</artifactId>
-                <version>${project.version}</version>
-                <configuration>
-                    <outputDirectory>target/mailetdocs</outputDirectory>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>mailetdocs</goal>
-                        </goals>
-                        <phase>package</phase>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <reuseForks>true</reuseForks>
-                    <forkCount>1C</forkCount>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/JMAPDraftConfiguration.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/JMAPDraftConfiguration.java
deleted file mode 100644
index 1635b6b5ff..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/JMAPDraftConfiguration.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Optional;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-
-public class JMAPDraftConfiguration {
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    public static class Builder {
-        private Optional<String> keystore = Optional.empty();
-        private Optional<String> keystoreType = Optional.empty();
-        private Optional<String> privateKey = Optional.empty();
-        private Optional<String> certificates = Optional.empty();
-        private Optional<String> secret = Optional.empty();
-        private Optional<Boolean> enabled = Optional.empty();
-        private ImmutableList.Builder<String> jwtPublicKeyPem = ImmutableList.builder();
-        private Optional<List<String>> authenticationStrategies = Optional.empty();
-
-        private Builder() {
-
-        }
-
-        public Builder keystore(String keystore) {
-            this.keystore = Optional.ofNullable(keystore)
-                .filter(s -> !s.isEmpty());
-            return this;
-        }
-
-        public Builder privateKey(String privateKey) {
-            this.privateKey = Optional.ofNullable(privateKey);
-            return this;
-        }
-
-        public Builder certificates(String certificates) {
-            this.certificates = Optional.ofNullable(certificates);
-            return this;
-        }
-
-        public Builder keystoreType(String keystoreType) {
-            this.keystoreType = Optional.ofNullable(keystoreType);
-            return this;
-        }
-
-        public Builder enabled(boolean enabled) {
-            this.enabled = Optional.of(enabled);
-            return this;
-        }
-
-        public Builder enable() {
-            return enabled(true);
-        }
-
-        public Builder disable() {
-            return enabled(false);
-        }
-
-        public Builder secret(String secret) {
-            this.secret = Optional.ofNullable(secret)
-                .filter(s -> !s.isEmpty());
-            return this;
-        }
-
-        public Builder jwtPublicKeyPem(Collection<String> jwtPublicKeyPem) {
-            Preconditions.checkNotNull(jwtPublicKeyPem);
-            this.jwtPublicKeyPem.addAll(jwtPublicKeyPem);
-            return this;
-        }
-
-        public Builder authenticationStrategies(Optional<List<String>> authenticationStrategies) {
-            this.authenticationStrategies = authenticationStrategies;
-            return this;
-        }
-
-        public JMAPDraftConfiguration build() {
-            Preconditions.checkState(enabled.isPresent(), "You should specify if JMAP server should be started");
-
-            Preconditions.checkState(!enabled.get() || cryptoParametersAreSpecified(),
-                "('keystore' && 'secret') or (privateKey && certificates) is mandatory");
-            return new JMAPDraftConfiguration(enabled.get(), keystore, privateKey, certificates, keystoreType.orElse("JKS"),
-                secret, jwtPublicKeyPem.build(), authenticationStrategies);
-        }
-
-        private boolean cryptoParametersAreSpecified() {
-            return (keystore.isPresent() && secret.isPresent())
-                || (privateKey.isPresent() && certificates.isPresent());
-        }
-    }
-
-    private final boolean enabled;
-    private final Optional<String> keystore;
-    private final Optional<String> privateKey;
-    private final Optional<String> certificates;
-    private final String keystoreType;
-    private final Optional<String> secret;
-    private final List<String> jwtPublicKeyPem;
-    private final Optional<List<String>> authenticationStrategies;
-
-    @VisibleForTesting
-    JMAPDraftConfiguration(boolean enabled, Optional<String> keystore, Optional<String> privateKey, Optional<String> certificates, String keystoreType,
-                           Optional<String> secret, List<String> jwtPublicKeyPem, Optional<List<String>> authenticationStrategies) {
-        this.enabled = enabled;
-        this.keystore = keystore;
-        this.privateKey = privateKey;
-        this.certificates = certificates;
-        this.keystoreType = keystoreType;
-        this.secret = secret;
-        this.jwtPublicKeyPem = jwtPublicKeyPem;
-        this.authenticationStrategies = authenticationStrategies;
-    }
-
-    public boolean isEnabled() {
-        return enabled;
-    }
-
-    public Optional<String> getKeystore() {
-        return keystore;
-    }
-
-    public String getKeystoreType() {
-        return keystoreType;
-    }
-
-    public Optional<String> getPrivateKey() {
-        return privateKey;
-    }
-
-    public Optional<String> getCertificates() {
-        return certificates;
-    }
-
-    public Optional<String> getSecret() {
-        return secret;
-    }
-
-    public List<String> getJwtPublicKeyPem() {
-        return jwtPublicKeyPem;
-    }
-
-    public Optional<List<String>> getAuthenticationStrategies() {
-        return authenticationStrategies;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/AccessTokenManager.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/AccessTokenManager.java
deleted file mode 100644
index f42b2f3a1c..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/AccessTokenManager.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.api;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.AccessToken;
-import org.apache.james.jmap.api.access.exceptions.InvalidAccessToken;
-import org.reactivestreams.Publisher;
-
-public interface AccessTokenManager {
-
-    Publisher<AccessToken> grantAccessToken(Username username);
-
-    Publisher<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken;
-
-    Publisher<Boolean> isValid(AccessToken token);
-
-    Publisher<Void> revoke(AccessToken token);
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenFactory.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenFactory.java
deleted file mode 100644
index b852b8454e..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.api;
-
-import org.apache.james.jmap.draft.model.AttachmentAccessToken;
-import org.apache.james.jmap.draft.model.ContinuationToken;
-
-public interface SimpleTokenFactory {
-    ContinuationToken generateContinuationToken(String username);
-
-    AttachmentAccessToken generateAttachmentAccessToken(String username, String blobId);
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenManager.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenManager.java
deleted file mode 100644
index 0dbfb219e8..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/api/SimpleTokenManager.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.api;
-
-import org.apache.james.jmap.draft.model.SignedExpiringToken;
-
-public interface SimpleTokenManager {
-    enum TokenStatus {
-        OK,
-        INVALID,
-        EXPIRED
-    }
-
-    TokenStatus getValidity(SignedExpiringToken token);
-
-    boolean isValid(SignedExpiringToken token);
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AccessTokenManagerImpl.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AccessTokenManagerImpl.java
deleted file mode 100644
index ab0f7bf5c3..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AccessTokenManagerImpl.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.AccessToken;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.api.access.exceptions.InvalidAccessToken;
-import org.apache.james.jmap.draft.api.AccessTokenManager;
-
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Mono;
-
-public class AccessTokenManagerImpl implements AccessTokenManager {
-
-    private final AccessTokenRepository accessTokenRepository;
-
-    @Inject
-    AccessTokenManagerImpl(AccessTokenRepository accessTokenRepository) {
-        this.accessTokenRepository = accessTokenRepository;
-    }
-
-    @Override
-    public Mono<AccessToken> grantAccessToken(Username username) {
-        Preconditions.checkNotNull(username);
-        AccessToken accessToken = AccessToken.generate();
-
-        return accessTokenRepository.addToken(username, accessToken)
-            .thenReturn(accessToken);
-    }
-
-    @Override
-    public Mono<Username> getUsernameFromToken(AccessToken token) throws InvalidAccessToken {
-        return accessTokenRepository.getUsernameFromToken(token);
-    }
-    
-    @Override
-    public Mono<Boolean> isValid(AccessToken token) throws InvalidAccessToken {
-        try {
-            return getUsernameFromToken(token)
-                .thenReturn(true);
-        } catch (InvalidAccessToken e) {
-            return Mono.just(false);
-        }
-    }
-
-    @Override
-    public Mono<Void> revoke(AccessToken token) {
-        return accessTokenRepository.removeToken(token);
-    }
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AsymmetricKeys.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AsymmetricKeys.java
deleted file mode 100644
index fbf082c1a9..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/AsymmetricKeys.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-import java.security.PrivateKey;
-import java.security.PublicKey;
-
-class AsymmetricKeys {
-
-    private final PrivateKey privateKey;
-    private final PublicKey publicKey;
-
-    AsymmetricKeys(PrivateKey privateKey, PublicKey publicKey) {
-        this.privateKey = privateKey;
-        this.publicKey = publicKey;
-    }
-
-    PrivateKey getPrivateKey() {
-        return privateKey;
-    }
-
-    PublicKey getPublicKey() {
-        return publicKey;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/JamesSignatureHandler.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/JamesSignatureHandler.java
deleted file mode 100644
index 5368f21692..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/JamesSignatureHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.util.Base64;
-
-import jakarta.inject.Inject;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-
-public class JamesSignatureHandler implements SignatureHandler {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(JamesSignatureHandler.class);
-
-    public static final String ALGORITHM = "SHA1withRSA";
-
-    private final SecurityKeyLoader keyLoader;
-
-    private AsymmetricKeys securityKeys;
-
-
-    @Inject
-    @VisibleForTesting JamesSignatureHandler(SecurityKeyLoader keyLoader) {
-        this.keyLoader = keyLoader;
-    }
-
-    @Override
-    public void init() throws Exception {
-        securityKeys = keyLoader.load();
-    }
-
-    @Override
-    public String sign(String source) {
-        Preconditions.checkNotNull(source);
-        try {
-            Signature javaSignature = Signature.getInstance(ALGORITHM);
-            javaSignature.initSign(securityKeys.getPrivateKey());
-            javaSignature.update(source.getBytes());
-            return Base64.getEncoder().encodeToString(javaSignature.sign());
-        } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public boolean verify(String source, String signature) {
-        Preconditions.checkNotNull(source);
-        Preconditions.checkNotNull(signature);
-        try {
-            Signature javaSignature = Signature.getInstance(ALGORITHM);
-            javaSignature.initVerify(securityKeys.getPublicKey());
-            javaSignature.update(source.getBytes());
-            return javaSignature.verify(Base64.getDecoder().decode(signature));
-        } catch (NoSuchAlgorithmException | InvalidKeyException e) {
-            throw new RuntimeException(e);
-        } catch (SignatureException e) {
-            LOGGER.warn("Attempt to use a malformed signature '{}' for source '{}'", signature, source, e);
-            return false;
-        }
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java
deleted file mode 100644
index 9e6c004115..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SecurityKeyLoader.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.security.Key;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.util.Optional;
-
-import jakarta.inject.Inject;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.james.filesystem.api.FileSystem;
-import org.apache.james.jmap.draft.JMAPDraftConfiguration;
-import org.apache.james.jwt.PublicKeyReader;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-
-import nl.altindag.ssl.pem.exception.PemParseException;
-import nl.altindag.ssl.pem.util.PemUtils;
-import nl.altindag.ssl.util.KeyStoreUtils;
-
-public class SecurityKeyLoader {
-    private static final String ALIAS = "james";
-
-    private final FileSystem fileSystem;
-    private final JMAPDraftConfiguration jmapDraftConfiguration;
-
-    @VisibleForTesting
-    @Inject
-    SecurityKeyLoader(FileSystem fileSystem, JMAPDraftConfiguration jmapDraftConfiguration) {
-        this.fileSystem = fileSystem;
-        this.jmapDraftConfiguration = jmapDraftConfiguration;
-    }
-
-    public AsymmetricKeys load() throws Exception {
-        Preconditions.checkState(jmapDraftConfiguration.isEnabled(), "JMAP is not enabled");
-
-        if (jmapDraftConfiguration.getKeystore().isPresent()) {
-            return loadFromKeystore();
-        }
-        return loadFromPEM();
-    }
-
-    private AsymmetricKeys loadFromKeystore() throws Exception {
-        Preconditions.checkState(jmapDraftConfiguration.getKeystore().isPresent());
-        Preconditions.checkState(jmapDraftConfiguration.getSecret().isPresent());
-
-        char[] secret = jmapDraftConfiguration.getSecret().get().toCharArray();
-        KeyStore keystore = KeyStoreUtils.loadKeyStore(fileSystem.getResource(jmapDraftConfiguration.getKeystore().get()), secret);
-
-        Certificate aliasCertificate = Optional
-            .ofNullable(keystore.getCertificate(ALIAS))
-            .orElseThrow(() -> new KeyStoreException("Alias '" + ALIAS + "' keystore can't be found"));
-
-        PublicKey publicKey = aliasCertificate.getPublicKey();
-        Key key = keystore.getKey(ALIAS, secret);
-        if (! (key instanceof PrivateKey)) {
-            throw new KeyStoreException("Provided key is not a PrivateKey");
-        }
-        return new AsymmetricKeys((PrivateKey) key, publicKey);
-    }
-
-    private AsymmetricKeys loadFromPEM() throws Exception {
-        Preconditions.checkState(jmapDraftConfiguration.getCertificates().isPresent());
-        Preconditions.checkState(jmapDraftConfiguration.getPrivateKey().isPresent());
-
-        PrivateKey privateKey = PemUtils.loadPrivateKey(
-            fileSystem.getResource(jmapDraftConfiguration.getPrivateKey().get()),
-            jmapDraftConfiguration.getSecret()
-                .map(String::toCharArray)
-                .orElse(null));
-
-        return new AsymmetricKeys(privateKey, loadPublicKey());
-    }
-
-    private PublicKey loadPublicKey() throws IOException {
-        try {
-            X509Certificate certificate = PemUtils.loadCertificate(
-                fileSystem.getResource(jmapDraftConfiguration.getCertificates().get()))
-                .get(0);
-            return certificate.getPublicKey();
-        } catch (PemParseException e) {
-            String publicKeyAsString = IOUtils.toString(fileSystem.getResource(jmapDraftConfiguration.getCertificates().get()), StandardCharsets.US_ASCII);
-            return new PublicKeyReader()
-                .fromPEM(publicKeyAsString)
-                .orElseThrow(() -> new IllegalArgumentException("Key must either be a valid certificate or a public key"));
-        }
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignatureHandler.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignatureHandler.java
deleted file mode 100644
index 0bc4e8c788..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignatureHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-public interface SignatureHandler {
-    
-    void init() throws Exception;
-
-    String sign(String source);
-
-    boolean verify(String source, String signature);
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenFactory.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenFactory.java
deleted file mode 100644
index 17e25c15ae..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.api.SimpleTokenFactory;
-import org.apache.james.jmap.draft.model.AttachmentAccessToken;
-import org.apache.james.jmap.draft.model.ContinuationToken;
-import org.apache.james.util.date.ZonedDateTimeProvider;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-
-public class SignedTokenFactory implements SimpleTokenFactory {
-
-    private final SignatureHandler signatureHandler;
-    private final ZonedDateTimeProvider zonedDateTimeProvider;
-
-    @Inject
-    public SignedTokenFactory(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider) {
-        this.signatureHandler = signatureHandler;
-        this.zonedDateTimeProvider = zonedDateTimeProvider;
-    }
-
-    @Override
-    public ContinuationToken generateContinuationToken(String username) {
-        Preconditions.checkNotNull(username);
-        ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(15);
-        return new ContinuationToken(username,
-            expirationTime,
-            signatureHandler.sign(
-                    Joiner.on(ContinuationToken.SEPARATOR)
-                        .join(username,
-                            DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime))));
-    }
-
-    @Override
-    public AttachmentAccessToken generateAttachmentAccessToken(String username, String blobId) {
-        Preconditions.checkArgument(! Strings.isNullOrEmpty(blobId));
-        ZonedDateTime expirationTime = zonedDateTimeProvider.get().plusMinutes(5);
-        return AttachmentAccessToken.builder()
-                .username(username)
-                .blobId(blobId)
-                .expirationDate(expirationTime)
-                .signature(signatureHandler.sign(Joiner.on(AttachmentAccessToken.SEPARATOR)
-                                                    .join(blobId,
-                                                            username, 
-                                                            DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expirationTime))))
-                .build();
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenManager.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenManager.java
deleted file mode 100644
index 9ff4233585..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/crypto/SignedTokenManager.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.crypto;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.api.SimpleTokenManager;
-import org.apache.james.jmap.draft.model.SignedExpiringToken;
-import org.apache.james.util.date.ZonedDateTimeProvider;
-
-import com.google.common.base.Preconditions;
-
-public class SignedTokenManager implements SimpleTokenManager {
-
-    private final SignatureHandler signatureHandler;
-    private final ZonedDateTimeProvider zonedDateTimeProvider;
-
-    @Inject
-    public SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider) {
-        this.signatureHandler = signatureHandler;
-        this.zonedDateTimeProvider = zonedDateTimeProvider;
-    }
-
-    @Override
-    public TokenStatus getValidity(SignedExpiringToken token) {
-        Preconditions.checkNotNull(token);
-        if (! isCorrectlySigned(token)) {
-            return TokenStatus.INVALID;
-        }
-        if (isExpired(token)) {
-            return TokenStatus.EXPIRED;
-        }
-        return TokenStatus.OK;
-    }
-    
-    @Override
-    public boolean isValid(SignedExpiringToken token) {
-        Preconditions.checkNotNull(token);
-        return TokenStatus.OK.equals(getValidity(token));
-    }
-
-    private boolean isCorrectlySigned(SignedExpiringToken token) {
-        return signatureHandler.verify(token.getSignedContent(), token.getSignature());
-    }
-
-    private boolean isExpired(SignedExpiringToken token) {
-        return token.getExpirationDate().isBefore(zonedDateTimeProvider.get());
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/AttachmentsNotFoundException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/AttachmentsNotFoundException.java
deleted file mode 100644
index 83ee2878fe..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/AttachmentsNotFoundException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-import java.util.List;
-
-import org.apache.james.jmap.model.BlobId;
-
-import com.google.common.collect.ImmutableList;
-
-public class AttachmentsNotFoundException extends RuntimeException {
-    
-    private List<BlobId> attachmentIds;
-
-
-    public AttachmentsNotFoundException(List<BlobId> attachmentIds) {
-        this.attachmentIds = ImmutableList.copyOf(attachmentIds);
-    }
-    
-    public List<BlobId> getAttachmentIds() {
-        return attachmentIds;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/BadRequestException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/BadRequestException.java
deleted file mode 100644
index 172c8ae5eb..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/BadRequestException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft.exceptions;
-
-public class BadRequestException extends RuntimeException {
-
-    public BadRequestException(String message) {
-        super(message);
-    }
-
-    public BadRequestException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InternalErrorException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InternalErrorException.java
deleted file mode 100644
index 7f5a548a59..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InternalErrorException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft.exceptions;
-
-public class InternalErrorException extends RuntimeException {
-
-    public InternalErrorException(String message) {
-        super(message);
-    }
-
-    public InternalErrorException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidDraftKeywordsException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidDraftKeywordsException.java
deleted file mode 100644
index 0092035587..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidDraftKeywordsException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class InvalidDraftKeywordsException extends IllegalArgumentException {
-    public InvalidDraftKeywordsException(String s) {
-        super(s);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidMailboxForCreationException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidMailboxForCreationException.java
deleted file mode 100644
index 6e8365f3a6..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidMailboxForCreationException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-import org.apache.james.mailbox.exception.MailboxException;
-
-public class InvalidMailboxForCreationException extends MailboxException {
-
-    public InvalidMailboxForCreationException(String message) {
-        super(message);
-    }
-    
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOriginMessageForMDNException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOriginMessageForMDNException.java
deleted file mode 100644
index cc4eb3bed4..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOriginMessageForMDNException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class InvalidOriginMessageForMDNException extends Exception {
-    private static final String MISSING_HEADER = " header is missing";
-
-    public static InvalidOriginMessageForMDNException missingHeader(String headerName) {
-        return new InvalidOriginMessageForMDNException(headerName + MISSING_HEADER);
-    }
-
-    private final String explanation;
-
-    public InvalidOriginMessageForMDNException(String explanation) {
-        this.explanation = explanation;
-    }
-
-    public String getExplanation() {
-        return explanation;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOutboxMoveException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOutboxMoveException.java
deleted file mode 100644
index 818f08d90a..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/InvalidOutboxMoveException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class InvalidOutboxMoveException extends RuntimeException {
-    public InvalidOutboxMoveException(String message) {
-        super(message);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/JmapFieldNotSupportedException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/JmapFieldNotSupportedException.java
deleted file mode 100644
index 61ace3a287..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/JmapFieldNotSupportedException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-import org.apache.commons.lang3.NotImplementedException;
-
-public class JmapFieldNotSupportedException extends NotImplementedException {
-    private final String issuer;
-    private final String field;
-
-    public JmapFieldNotSupportedException(String issuer, String field) {
-        super("not implemented");
-        this.issuer = issuer;
-        this.field = field;
-    }
-
-    public String getField() {
-        return field;
-    }
-
-    public String getIssuer() {
-        return issuer;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxHasChildException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxHasChildException.java
deleted file mode 100644
index e208aaa6de..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxHasChildException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class MailboxHasChildException extends Exception {
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxNotOwnedException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxNotOwnedException.java
deleted file mode 100644
index 6f2c893c98..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxNotOwnedException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-import org.apache.james.mailbox.exception.MailboxException;
-
-public class MailboxNotOwnedException extends MailboxException {
-
-    public MailboxNotOwnedException() {
-        super();
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxParentNotFoundException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxParentNotFoundException.java
deleted file mode 100644
index 6a8005d846..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MailboxParentNotFoundException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-import org.apache.james.jmap.draft.model.MailboxCreationId;
-import org.apache.james.mailbox.model.MailboxId;
-
-public class MailboxParentNotFoundException extends RuntimeException {
-
-    private final String parentId;
-
-    public MailboxParentNotFoundException(MailboxId parentId) {
-        super(String.format("The parent mailbox '%s' was not found.", parentId.serialize()));
-        this.parentId = parentId.serialize();
-    }
-
-    public MailboxParentNotFoundException(MailboxCreationId parentId) {
-        super(String.format("The parent mailbox '%s' was not found.", parentId.getCreationId()));
-        this.parentId = parentId.getCreationId();
-    }
-
-    public String getParentId() {
-        return parentId;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MalformedContinuationTokenException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MalformedContinuationTokenException.java
deleted file mode 100644
index 10468571a9..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MalformedContinuationTokenException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class MalformedContinuationTokenException extends Exception {
-
-    public MalformedContinuationTokenException(String s) {
-        super(s);
-    }
-
-    public MalformedContinuationTokenException(String s, Throwable throwable) {
-        super(s, throwable);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MessageNotFoundException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MessageNotFoundException.java
deleted file mode 100644
index 99c5c800a2..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/MessageNotFoundException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class MessageNotFoundException extends Exception {
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SizeExceededException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SizeExceededException.java
deleted file mode 100644
index 1ccd76c048..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SizeExceededException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class SizeExceededException extends IllegalArgumentException {
-    public SizeExceededException(long actualSize, long limit) {
-        super(String.format("Attempt to create a message of %d bytes while the maximum allowed is %d", actualSize, limit));
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SystemMailboxNotUpdatableException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SystemMailboxNotUpdatableException.java
deleted file mode 100644
index 24095844ef..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/exceptions/SystemMailboxNotUpdatableException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.exceptions;
-
-public class SystemMailboxNotUpdatableException extends RuntimeException {
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FieldNamePropertyFilter.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FieldNamePropertyFilter.java
deleted file mode 100644
index 649d2eb40b..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FieldNamePropertyFilter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.json;
-
-import java.util.function.Predicate;
-
-import com.fasterxml.jackson.databind.ser.PropertyWriter;
-import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
-
-public class FieldNamePropertyFilter extends SimpleBeanPropertyFilter {
-
-    private final Predicate<String> predicate;
-
-    public FieldNamePropertyFilter(Predicate<String> predicate) {
-        this.predicate = predicate;
-    }
-
-    @Override
-    protected boolean include(PropertyWriter writer) {
-        return predicate.test(writer.getName());
-    }
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FilterDeserializer.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FilterDeserializer.java
deleted file mode 100644
index 5fa1c11f66..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/FilterDeserializer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft.json;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Optional;
-
-import org.apache.james.jmap.draft.model.Filter;
-import org.apache.james.jmap.draft.model.FilterCondition;
-import org.apache.james.jmap.draft.model.FilterOperator;
-import org.apache.james.util.streams.Iterators;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-public class FilterDeserializer extends StdDeserializer<Filter> {
-
-    public FilterDeserializer() {
-        super(Filter.class);
-    }
-
-    @Override
-    public Filter deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
-        ObjectMapper mapper = (ObjectMapper) p.getCodec();
-        ObjectNode obj = (ObjectNode) mapper.readTree(p);
-
-        return mapper.treeToValue(obj, detectClass(obj.fields()));
-    }
-
-    private Class<? extends Filter> detectClass(Iterator<Map.Entry<String, JsonNode>> elements) {
-        Optional<Class<? extends Filter>> maybeFilterOperator = Iterators.toStream(elements)
-                .map(Map.Entry::getKey)
-                .filter(name -> name.equals("operator"))
-                .findFirst()
-                .map(x -> FilterOperator.class);
-
-        return maybeFilterOperator.orElse(FilterCondition.class);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleClassesDeserializer.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleClassesDeserializer.java
deleted file mode 100644
index feebcd2923..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleClassesDeserializer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft.json;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.google.common.base.Preconditions;
-
-public class MultipleClassesDeserializer extends StdDeserializer<Object> {
-
-    private final Map<String, Class<?>> registry = new HashMap<>();
-
-    MultipleClassesDeserializer() {
-        super(Object.class);
-    }
-
-    @Override
-    public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
-        ObjectMapper mapper = (ObjectMapper) p.getCodec();
-        final JsonNode root = mapper.readTree(p);
-
-        return registry.entrySet().stream()
-                .filter(req -> ! (root.at(req.getKey()).isMissingNode()))
-                .map(x -> readValue(mapper, root, x.getValue()))
-                .findFirst()
-                .orElseThrow(() -> JsonMappingException.from(ctxt, "Can't map request to a known registered class"));
-    }
-
-    private Object readValue(ObjectMapper mapper, JsonNode root, Class<?> clazz) {
-        try {
-            return mapper.treeToValue(root, clazz);
-        } catch (JsonProcessingException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void registerClass(String uniqueJsonPath, Class<?> clazz) {
-        Preconditions.checkArgument(! registry.containsKey(uniqueJsonPath), "Path %s has already been registered", uniqueJsonPath);
-        registry.put(uniqueJsonPath, clazz);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleObjectMapperBuilder.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleObjectMapperBuilder.java
deleted file mode 100644
index f85273d1cf..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/MultipleObjectMapperBuilder.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-package org.apache.james.jmap.draft.json;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-public class MultipleObjectMapperBuilder {
-
-    private final MultipleClassesDeserializer multipleClassesDeserializer = new MultipleClassesDeserializer();
-
-    public MultipleObjectMapperBuilder registerClass(String uniqueJsonPath, Class<?> clazz) {
-        multipleClassesDeserializer.registerClass(uniqueJsonPath, clazz);
-        return this;
-    }
-
-    public ObjectMapper build() {
-        ObjectMapper mapper = new ObjectMapper();
-        SimpleModule module = new SimpleModule();
-        module.addDeserializer(Object.class, multipleClassesDeserializer);
-        mapper.registerModule(module);
-        return mapper;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeDeserializer.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeDeserializer.java
deleted file mode 100644
index c43745b211..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeDeserializer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.json;
-
-import java.io.IOException;
-import java.time.ZonedDateTime;
-import java.util.Optional;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-
-public class OptionalZonedDateTimeDeserializer extends JsonDeserializer<Optional<ZonedDateTime>> {
-
-    @Override
-    public Optional<ZonedDateTime> deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
-        return Optional.ofNullable(jsonParser.getValueAsString())
-            .map(ZonedDateTime::parse);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeSerializer.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeSerializer.java
deleted file mode 100644
index 84ee026c38..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/json/OptionalZonedDateTimeSerializer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.json;
-
-import java.io.IOException;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Optional;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-
-public class OptionalZonedDateTimeSerializer extends JsonSerializer<Optional<ZonedDateTime>> {
-
-    @Override
-    public void serialize(Optional<ZonedDateTime> optionalZonedDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
-        jsonGenerator.writeString(
-            optionalZonedDateTime.map(zonedDateTime -> zonedDateTime.format(DateTimeFormatter.ISO_DATE_TIME))
-                .orElse(null));
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetFilterMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetFilterMethod.java
deleted file mode 100644
index e6a1da0e3b..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetFilterMethod.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.util.ReactorUtils.context;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.filtering.FilteringManagement;
-import org.apache.james.jmap.draft.model.GetFilterRequest;
-import org.apache.james.jmap.draft.model.GetFilterResponse;
-import org.apache.james.jmap.draft.model.SetError;
-import org.apache.james.jmap.methods.ErrorResponse;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.MDCBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class GetFilterMethod implements Method {
-    private static final Logger LOGGER = LoggerFactory.getLogger(GetFilterMethod.class);
-
-    private static final Method.Request.Name METHOD_NAME = Method.Request.name("getFilter");
-    private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("filter");
-
-    private final MetricFactory metricFactory;
-    private final FilteringManagement filteringManagement;
-
-    @Inject
-    private GetFilterMethod(MetricFactory metricFactory, FilteringManagement filteringManagement) {
-        this.metricFactory = metricFactory;
-        this.filteringManagement = filteringManagement;
-    }
-
-    @Override
-    public Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return GetFilterRequest.class;
-    }
-
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkNotNull(request);
-        Preconditions.checkNotNull(methodCallId);
-        Preconditions.checkNotNull(mailboxSession);
-        Preconditions.checkArgument(request instanceof GetFilterRequest);
-
-        GetFilterRequest filterRequest = (GetFilterRequest) request;
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            process(methodCallId, mailboxSession, filterRequest)
-                .contextWrite(context("GET_FILTER", MDCBuilder.ofValue(MDCBuilder.ACTION, "GET_FILTER")))));
-    }
-
-    private Mono<JmapResponse> process(MethodCallId methodCallId, MailboxSession mailboxSession, GetFilterRequest request) {
-        return retrieveFilter(methodCallId, mailboxSession.getUser())
-            .onErrorResume(e -> {
-                LOGGER.warn("Failed to retrieve filter", e);
-
-                return Mono.just(unKnownError(methodCallId));
-            });
-    }
-
-    private Mono<JmapResponse> retrieveFilter(MethodCallId methodCallId, Username username) {
-        return Mono.from(filteringManagement.listRulesForUser(username))
-            .map(rules -> GetFilterResponse.builder()
-                .rules(rules.getRules())
-                .build())
-            .map(getFilterResponse -> JmapResponse.builder()
-                .methodCallId(methodCallId)
-                .response(getFilterResponse)
-                .responseName(RESPONSE_NAME)
-                .build());
-    }
-
-    private JmapResponse unKnownError(MethodCallId methodCallId) {
-        return JmapResponse.builder()
-            .methodCallId(methodCallId)
-            .responseName(RESPONSE_NAME)
-            .response(ErrorResponse.builder()
-                .type(SetError.Type.ERROR.asString())
-                .description("Failed to retrieve filter")
-                .build())
-            .build();
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMailboxesMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMailboxesMethod.java
deleted file mode 100644
index 2a4bdc7557..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMailboxesMethod.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.util.ReactorUtils.DEFAULT_CONCURRENCY;
-import static org.apache.james.util.ReactorUtils.context;
-
-import java.util.Comparator;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.model.GetMailboxesRequest;
-import org.apache.james.jmap.draft.model.GetMailboxesResponse;
-import org.apache.james.jmap.draft.model.MailboxFactory;
-import org.apache.james.jmap.draft.model.MailboxProperty;
-import org.apache.james.jmap.draft.model.mailbox.Mailbox;
-import org.apache.james.jmap.draft.utils.quotas.QuotaLoaderWithDefaultPreloaded;
-import org.apache.james.jmap.http.DefaultMailboxesProvisioner;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxMetaData;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.search.MailboxQuery;
-import org.apache.james.mailbox.quota.QuotaManager;
-import org.apache.james.mailbox.quota.QuotaRootResolver;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.MDCBuilder;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
-
-public class GetMailboxesMethod implements Method {
-
-    private static final Method.Request.Name METHOD_NAME = Method.Request.name("getMailboxes");
-    private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("mailboxes");
-    private static final Optional<Map<MailboxPath, MailboxMetaData>> NO_PRELOADED_METADATA = Optional.empty();
-    private static final String ACTION = "GET_MAILBOXES";
-
-    private final MailboxManager mailboxManager;
-    private final MailboxFactory mailboxFactory;
-    private final MetricFactory metricFactory;
-    private final QuotaRootResolver quotaRootResolver;
-    private final QuotaManager quotaManager;
-    private final DefaultMailboxesProvisioner provisioner;
-
-    @Inject
-    @VisibleForTesting
-    public GetMailboxesMethod(MailboxManager mailboxManager, QuotaRootResolver quotaRootResolver, QuotaManager quotaManager, MailboxFactory mailboxFactory, MetricFactory metricFactory, DefaultMailboxesProvisioner provisioner) {
-        this.mailboxManager = mailboxManager;
-        this.mailboxFactory = mailboxFactory;
-        this.metricFactory = metricFactory;
-        this.quotaRootResolver = quotaRootResolver;
-        this.quotaManager = quotaManager;
-        this.provisioner = provisioner;
-    }
-
-    @Override
-    public Method.Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return GetMailboxesRequest.class;
-    }
-
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkArgument(request instanceof GetMailboxesRequest);
-        GetMailboxesRequest mailboxesRequest = (GetMailboxesRequest) request;
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            process(methodCallId, mailboxSession, mailboxesRequest)
-                .contextWrite(context(ACTION, mdc(mailboxesRequest)))));
-    }
-
-    private MDCBuilder mdc(GetMailboxesRequest mailboxesRequest) {
-        return MDCBuilder.create()
-            .addToContext(MDCBuilder.ACTION, ACTION)
-            .addToContextIfPresent("accountId", mailboxesRequest.getAccountId())
-            .addToContext("mailboxIds", mailboxesRequest.getIds().toString())
-            .addToContext("properties", mailboxesRequest.getProperties().toString());
-    }
-
-    private Flux<JmapResponse> process(MethodCallId methodCallId, MailboxSession mailboxSession, GetMailboxesRequest mailboxesRequest) {
-        return provisioner.createMailboxesIfNeeded(mailboxSession)
-            .thenMany(Flux.from(getMailboxesResponse(mailboxesRequest, mailboxSession)
-                .map(response -> JmapResponse.builder().methodCallId(methodCallId)
-                    .response(response)
-                    .properties(mailboxesRequest.getProperties().map(this::ensureContainsId))
-                    .responseName(RESPONSE_NAME)
-                    .build())));
-    }
-
-    private Set<MailboxProperty> ensureContainsId(Set<MailboxProperty> input) {
-        return Sets.union(input, ImmutableSet.of(MailboxProperty.ID)).immutableCopy();
-    }
-
-    private Mono<GetMailboxesResponse> getMailboxesResponse(GetMailboxesRequest mailboxesRequest, MailboxSession mailboxSession) {
-        Optional<ImmutableList<MailboxId>> mailboxIds = mailboxesRequest.getIds();
-        return retrieveMailboxes(mailboxIds, mailboxSession)
-            .sort(Comparator.comparing(Mailbox::getSortOrder))
-            .reduce(GetMailboxesResponse.builder(), GetMailboxesResponse.Builder::add)
-            .map(GetMailboxesResponse.Builder::build);
-    }
-
-    private Flux<Mailbox> retrieveMailboxes(Optional<ImmutableList<MailboxId>> mailboxIds, MailboxSession mailboxSession) {
-        return mailboxIds
-            .map(ids -> retrieveSpecificMailboxes(mailboxSession, ids))
-            .orElseGet(Throwing.supplier(() -> retrieveAllMailboxes(mailboxSession)).sneakyThrow());
-    }
-
-
-    private Flux<Mailbox> retrieveSpecificMailboxes(MailboxSession mailboxSession, ImmutableList<MailboxId> mailboxIds) {
-        return Flux.fromIterable(mailboxIds)
-            .flatMap(mailboxId -> mailboxFactory.builder()
-                    .id(mailboxId)
-                    .session(mailboxSession)
-                    .usingPreloadedMailboxesMetadata(NO_PRELOADED_METADATA)
-                    .build(), DEFAULT_CONCURRENCY);
-    }
-
-    private Flux<Mailbox> retrieveAllMailboxes(MailboxSession mailboxSession) {
-        Mono<Map<MailboxPath, MailboxMetaData>> userMailboxesMono = getAllMailboxesMetaData(mailboxSession).collectMap(m -> m.getPath());
-        Mono<QuotaLoaderWithDefaultPreloaded> quotaLoaderMono = QuotaLoaderWithDefaultPreloaded.preLoad(quotaRootResolver, quotaManager, mailboxSession);
-
-        return userMailboxesMono.zipWith(quotaLoaderMono)
-            .publishOn(Schedulers.parallel())
-            .flatMapMany(
-                tuple -> Flux.fromIterable(tuple.getT1().values())
-                    .flatMap(mailboxMetaData -> mailboxFactory.builder()
-                        .mailboxMetadata(mailboxMetaData)
-                        .session(mailboxSession)
-                        .usingPreloadedMailboxesMetadata(Optional.of(tuple.getT1()))
-                        .quotaLoader(tuple.getT2())
-                        .build()));
-    }
-
-    private Flux<MailboxMetaData> getAllMailboxesMetaData(MailboxSession mailboxSession) {
-        return mailboxManager.search(
-            MailboxQuery.builder()
-                .matchesAllMailboxNames()
-                .build(),
-            mailboxSession);
-    }
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessageListMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessageListMethod.java
deleted file mode 100644
index e02206d375..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessageListMethod.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static jakarta.mail.Flags.Flag.DELETED;
-import static org.apache.james.util.ReactorUtils.context;
-
-import java.time.ZonedDateTime;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Stream;
-
-import jakarta.inject.Inject;
-import jakarta.inject.Named;
-
-import org.apache.commons.lang3.NotImplementedException;
-import org.apache.james.jmap.JMAPConfiguration;
-import org.apache.james.jmap.api.projections.EmailQueryView;
-import org.apache.james.jmap.draft.model.Filter;
-import org.apache.james.jmap.draft.model.FilterCondition;
-import org.apache.james.jmap.draft.model.GetMessageListRequest;
-import org.apache.james.jmap.draft.model.GetMessageListResponse;
-import org.apache.james.jmap.draft.model.GetMessagesRequest;
-import org.apache.james.jmap.draft.utils.FilterToCriteria;
-import org.apache.james.jmap.draft.utils.SortConverter;
-import org.apache.james.jmap.methods.ErrorResponse;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.exception.MailboxNotFoundException;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxId.Factory;
-import org.apache.james.mailbox.model.MultimailboxesSearchQuery;
-import org.apache.james.mailbox.model.SearchQuery;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.MDCBuilder;
-import org.apache.james.util.streams.Limit;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
-
-public class GetMessageListMethod implements Method {
-    private static final long DEFAULT_POSITION = 0;
-    public static final String MAXIMUM_LIMIT = "maximumLimit";
-    public static final long DEFAULT_MAXIMUM_LIMIT = 256;
-
-    private static final Method.Request.Name METHOD_NAME = Method.Request.name("getMessageList");
-    private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("messageList");
-
-    private final MailboxManager mailboxManager;
-    private final long maximumLimit;
-    private final GetMessagesMethod getMessagesMethod;
-    private final Factory mailboxIdFactory;
-    private final EmailQueryView emailQueryView;
-    private final JMAPConfiguration configuration;
-    private final MetricFactory metricFactory;
-
-    @Inject
-    private GetMessageListMethod(MailboxManager mailboxManager,
-                                 @Named(MAXIMUM_LIMIT) long maximumLimit,
-                                 GetMessagesMethod getMessagesMethod,
-                                 Factory mailboxIdFactory,
-                                 EmailQueryView emailQueryView,
-                                 JMAPConfiguration configuration,
-                                 MetricFactory metricFactory) {
-
-        this.mailboxManager = mailboxManager;
-        this.maximumLimit = maximumLimit;
-        this.getMessagesMethod = getMessagesMethod;
-        this.mailboxIdFactory = mailboxIdFactory;
-        this.emailQueryView = emailQueryView;
-        this.configuration = configuration;
-        this.metricFactory = metricFactory;
-    }
-
-    @Override
-    public Method.Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return GetMessageListRequest.class;
-    }
-
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkArgument(request instanceof GetMessageListRequest);
-
-        GetMessageListRequest messageListRequest = (GetMessageListRequest) request;
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            process(methodCallId, mailboxSession, messageListRequest)
-                .contextWrite(context("GET_MESSAGE_LIST", mdc(messageListRequest)))));
-    }
-
-    private MDCBuilder mdc(GetMessageListRequest messageListRequest) {
-        return MDCBuilder.create()
-            .addToContext(MDCBuilder.ACTION, "GET_MESSAGE_LIST")
-            .addToContextIfPresent("accountId", messageListRequest.getAccountId())
-            .addToContextIfPresent("limit", messageListRequest.getLimit()
-                .map(Number::asLong).map(l -> Long.toString(l)))
-            .addToContextIfPresent("anchor", messageListRequest.getAnchor())
-            .addToContextIfPresent("offset", messageListRequest.getAnchorOffset()
-                .map(Number::asLong).map(l -> Long.toString(l)))
-            .addToContext("properties", Joiner.on(", ")
-                .join(messageListRequest.getFetchMessageProperties()))
-            .addToContextIfPresent("position", messageListRequest.getPosition()
-                .map(Number::asLong).map(l -> Long.toString(l)))
-            .addToContextIfPresent("filters", messageListRequest.getFilter().map(Objects::toString))
-            .addToContext("sorts", Joiner.on(", ")
-                .join(messageListRequest.getSort()))
-            .addToContextIfPresent("isFetchMessage", messageListRequest.isFetchMessages().map(b -> Boolean.toString(b)))
-            .addToContextIfPresent("isCollapseThread", messageListRequest.isCollapseThreads().map(b -> Boolean.toString(b)));
-    }
-
-    private Flux<JmapResponse> process(MethodCallId methodCallId, MailboxSession mailboxSession, GetMessageListRequest messageListRequest) {
-        return getMessageListResponse(messageListRequest, mailboxSession)
-            .flatMapMany(messageListResponse -> Flux.concat(
-                Mono.just(JmapResponse.builder().methodCallId(methodCallId)
-                    .response(messageListResponse)
-                    .responseName(RESPONSE_NAME)
-                    .build()),
-                processGetMessages(messageListRequest, messageListResponse, methodCallId, mailboxSession)))
-            .onErrorResume(NotImplementedException.class, e -> Mono.just(JmapResponse.builder()
-                .methodCallId(methodCallId)
-                .responseName(RESPONSE_NAME)
-                .error(ErrorResponse.builder()
-                    .type("invalidArguments")
-                    .description(e.getMessage())
-                    .build())
-                .build()))
-            .onErrorResume(Filter.TooDeepFilterHierarchyException.class, e -> Mono.just(JmapResponse.builder()
-                .methodCallId(methodCallId)
-                .responseName(RESPONSE_NAME)
-                .error(ErrorResponse.builder()
-                    .type("invalidArguments")
-                    .description(e.getMessage())
-                    .build())
-                .build()));
-    }
-
-    private Mono<GetMessageListResponse> getMessageListResponse(GetMessageListRequest messageListRequest, MailboxSession mailboxSession) {
-        long position = messageListRequest.getPosition().map(Number::asLong).orElse(DEFAULT_POSITION);
-        long limit = position + messageListRequest.getLimit().map(Number::asLong).orElse(maximumLimit);
-
-        if (isListingContentInMailboxQuery(messageListRequest)) {
-            Filter filter = messageListRequest.getFilter().get();
-            FilterCondition condition = (FilterCondition) filter;
-            String mailboxIdAsString = condition.getInMailboxes().get().iterator().next();
-            MailboxId mailboxId = mailboxIdFactory.fromString(mailboxIdAsString);
-            Limit aLimit = Limit.from(Math.toIntExact(limit));
-
-            return Mono.from(mailboxManager.getMailboxReactive(mailboxId, mailboxSession))
-                .then(emailQueryView.listMailboxContentSortedBySentAt(mailboxId, aLimit)
-                    .skip(position)
-                    .take(limit)
-                    .reduce(GetMessageListResponse.builder(), GetMessageListResponse.Builder::messageId)
-                    .map(GetMessageListResponse.Builder::build))
-                .onErrorResume(MailboxNotFoundException.class, e -> Mono.just(GetMessageListResponse.builder().build()));
-        }
-        if (isListingContentInMailboxAfterQuery(messageListRequest)) {
-            Filter filter = messageListRequest.getFilter().get();
-            FilterCondition condition = (FilterCondition) filter;
-            String mailboxIdAsString = condition.getInMailboxes().get().iterator().next();
-            MailboxId mailboxId = mailboxIdFactory.fromString(mailboxIdAsString);
-            ZonedDateTime after = condition.getAfter().get();
-            Limit aLimit = Limit.from(Math.toIntExact(limit));
-
-            return Mono.from(mailboxManager.getMailboxReactive(mailboxId, mailboxSession))
-                .then(emailQueryView.listMailboxContentSinceAfterSortedBySentAt(mailboxId, after, aLimit)
-                    .skip(position)
-                    .take(limit)
-                    .reduce(GetMessageListResponse.builder(), GetMessageListResponse.Builder::messageId)
-                    .map(GetMessageListResponse.Builder::build))
-                .onErrorResume(MailboxNotFoundException.class, e -> Mono.just(GetMessageListResponse.builder().build()));
-        }
-        return querySearchBackend(messageListRequest, position, limit, mailboxSession);
-    }
-
-    private boolean isListingContentInMailboxQuery(GetMessageListRequest messageListRequest) {
-        return configuration.isEmailQueryViewEnabled()
-            && messageListRequest.getFilter().map(Filter::inMailboxFilterOnly).orElse(false)
-            && messageListRequest.getSort().equals(ImmutableList.of("date desc"));
-    }
-
-    private boolean isListingContentInMailboxAfterQuery(GetMessageListRequest messageListRequest) {
-        return configuration.isEmailQueryViewEnabled()
-            && messageListRequest.getFilter().map(Filter::inMailboxAndAfterFiltersOnly).orElse(false)
-            && messageListRequest.getSort().equals(ImmutableList.of("date desc"));
-    }
-
-    private Mono<GetMessageListResponse> querySearchBackend(GetMessageListRequest messageListRequest, long position, long limit, MailboxSession mailboxSession) {
-        Mono<MultimailboxesSearchQuery> searchQuery = Mono.fromCallable(() -> convertToSearchQuery(messageListRequest))
-            .subscribeOn(Schedulers.parallel());
-
-        return searchQuery
-            .flatMapMany(Throwing.function(query ->
-                mailboxManager.search(query.addCriterion(SearchQuery.flagIsUnSet(DELETED)), mailboxSession, limit)))
-            .skip(position)
-            .reduce(GetMessageListResponse.builder(), GetMessageListResponse.Builder::messageId)
-            .map(GetMessageListResponse.Builder::build);
-    }
-
-    private MultimailboxesSearchQuery convertToSearchQuery(GetMessageListRequest messageListRequest) {
-        if (messageListRequest.getFilter().map(this::containsNestedMailboxFilters).orElse(false)) {
-            throw new NotImplementedException("'inMailboxes' and 'notInMailboxes' wrapped within Filter Operators are not " +
-                "implemented. Review your search request.");
-        }
-
-        SearchQuery.Builder searchQueryBuilder = SearchQuery.builder();
-
-        messageListRequest.getFilter()
-            .map(filter -> new FilterToCriteria().convert(filter).collect(ImmutableList.toImmutableList()))
-            .ifPresent(searchQueryBuilder::andCriteria);
-        Set<MailboxId> inMailboxes = buildFilterMailboxesSet(messageListRequest.getFilter(), FilterCondition::getInMailboxes);
-        Set<MailboxId> notInMailboxes = buildFilterMailboxesSet(messageListRequest.getFilter(), FilterCondition::getNotInMailboxes);
-        List<SearchQuery.Sort> sorts = SortConverter.convertToSorts(messageListRequest.getSort());
-        if (!sorts.isEmpty()) {
-            searchQueryBuilder.sorts(sorts);
-        }
-        return MultimailboxesSearchQuery
-            .from(searchQueryBuilder.build())
-            .inMailboxes(inMailboxes)
-            .notInMailboxes(notInMailboxes)
-            .build();
-    }
-
-    private boolean containsNestedMailboxFilters(Filter filter) {
-        if (filter instanceof FilterCondition) {
-            // The condition is not nested
-            return false;
-        }
-        return containsMailboxFilters(filter);
-    }
-
-    private boolean containsMailboxFilters(Filter filter) {
-        return filter.breadthFirstVisit()
-            .stream()
-            .anyMatch(this::hasMailboxClause);
-    }
-
-    private boolean hasMailboxClause(FilterCondition condition) {
-        return condition.getInMailboxes().isPresent() || condition.getInMailboxes().isPresent();
-    }
-
-    private Set<MailboxId> buildFilterMailboxesSet(Optional<Filter> maybeFilter, Function<FilterCondition, Optional<List<String>>> mailboxListExtractor) {
-        return filterToFilterCondition(maybeFilter)
-            .flatMap(condition -> mailboxListExtractor.apply(condition).stream())
-            .flatMap(List::stream)
-            .map(mailboxIdFactory::fromString)
-            .collect(ImmutableSet.toImmutableSet());
-    }
-    
-    private Stream<FilterCondition> filterToFilterCondition(Optional<Filter> maybeCondition) {
-        return maybeCondition.stream()
-            .flatMap(c -> {
-                if (c instanceof FilterCondition) {
-                    return Stream.of((FilterCondition)c);
-                }
-                return Stream.of();
-            });
-    }
-
-    private Flux<JmapResponse> processGetMessages(GetMessageListRequest messageListRequest, GetMessageListResponse messageListResponse, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        if (shouldChainToGetMessages(messageListRequest)) {
-            GetMessagesRequest getMessagesRequest = GetMessagesRequest.builder()
-                .ids(messageListResponse.getMessageIds())
-                .properties(messageListRequest.getFetchMessageProperties())
-                .build();
-            return getMessagesMethod.process(getMessagesRequest, methodCallId, mailboxSession);
-        }
-        return Flux.empty();
-    }
-
-    private boolean shouldChainToGetMessages(GetMessageListRequest messageListRequest) {
-        return messageListRequest.isFetchMessages().orElse(false)
-            && !messageListRequest.isFetchThreads().orElse(false);
-    }
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessagesMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessagesMethod.java
deleted file mode 100644
index d912b42a80..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetMessagesMethod.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.util.ReactorUtils.context;
-
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import jakarta.inject.Inject;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.james.jmap.draft.exceptions.JmapFieldNotSupportedException;
-import org.apache.james.jmap.draft.json.FieldNamePropertyFilter;
-import org.apache.james.jmap.draft.model.GetMessagesRequest;
-import org.apache.james.jmap.draft.model.GetMessagesResponse;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MessageProperties;
-import org.apache.james.jmap.model.MessageProperties.HeaderProperty;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.jmap.model.Property;
-import org.apache.james.jmap.model.message.view.MessageView;
-import org.apache.james.jmap.model.message.view.MessageViewFactory;
-import org.apache.james.jmap.model.message.view.MetaMessageViewFactory;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.MDCBuilder;
-
-import com.fasterxml.jackson.databind.ser.PropertyFilter;
-import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableSet;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class GetMessagesMethod implements Method {
-
-    public static final String HEADERS_FILTER = "headersFilter";
-    private static final String ISSUER = "GetMessagesMethod";
-    private static final Method.Request.Name METHOD_NAME = Method.Request.name("getMessages");
-    private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("messages");
-    private final MetaMessageViewFactory messageViewFactory;
-    private final MetricFactory metricFactory;
-
-    @Inject
-    @VisibleForTesting GetMessagesMethod(MetaMessageViewFactory messageViewFactory, MetricFactory metricFactory) {
-        this.messageViewFactory = messageViewFactory;
-        this.metricFactory = metricFactory;
-    }
-    
-    @Override
-    public Method.Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-    
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return GetMessagesRequest.class;
-    }
-    
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkNotNull(request);
-        Preconditions.checkNotNull(mailboxSession);
-        Preconditions.checkArgument(request instanceof GetMessagesRequest);
-
-        GetMessagesRequest getMessagesRequest = (GetMessagesRequest) request;
-        MessageProperties outputProperties = getMessagesRequest.getProperties().toOutputProperties();
-        Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> integerSimpleFilterProviderPair = buildOptionalHeadersFilteringFilterProvider(outputProperties);
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            Flux.from(getMessagesResponse(mailboxSession, getMessagesRequest)
-                .map(response -> JmapResponse.builder().methodCallId(methodCallId)
-                    .response(response)
-                    .responseName(RESPONSE_NAME)
-                    .properties(outputProperties.getOptionalMessageProperties())
-                    .filterProvider(integerSimpleFilterProviderPair)
-                    .build()))
-            .contextWrite(context("GET_MESSAGES", mdc(getMessagesRequest)))));
-    }
-
-    private MDCBuilder mdc(GetMessagesRequest getMessagesRequest) {
-        return MDCBuilder.create()
-            .addToContext(MDCBuilder.ACTION, "GET_MESSAGES")
-            .addToContextIfPresent("accountId", getMessagesRequest.getAccountId())
-            .addToContext("ids", getMessagesRequest.getIds()
-                .stream()
-                .map(MessageId::serialize)
-                .collect(Collectors.joining(", ")))
-            .addToContext("properties", getMessagesRequest.getProperties().asFieldList()
-                .collect(Collectors.joining(", ")));
-    }
-
-    private Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> buildOptionalHeadersFilteringFilterProvider(MessageProperties properties) {
-        return properties.getOptionalHeadersProperties()
-            .map(headerProperties -> Pair.of(headerProperties, new SimpleFilterProvider()
-                .addFilter(HEADERS_FILTER, buildHeadersPropertyFilter(headerProperties))));
-    }
-    
-    private PropertyFilter buildHeadersPropertyFilter(ImmutableSet<HeaderProperty> headerProperties) {
-        return new FieldNamePropertyFilter((fieldName) -> headerProperties.contains(HeaderProperty.fromFieldName(fieldName)));
-    }
-
-    private Mono<GetMessagesResponse> getMessagesResponse(MailboxSession mailboxSession, GetMessagesRequest getMessagesRequest) {
-        getMessagesRequest.getAccountId().ifPresent(input -> notImplemented("accountId"));
-
-        MessageProperties.ReadProfile readProfile = getMessagesRequest.getProperties().computeReadLevel();
-        MessageViewFactory<? extends MessageView> factory = messageViewFactory.getFactory(readProfile);
-        Mono<? extends Set<? extends MessageView>> messageViewsMono = factory.fromMessageIds(getMessagesRequest.getIds(), mailboxSession)
-            .collect(ImmutableSet.toImmutableSet());
-
-        return messageViewsMono.map(messageViews ->
-            GetMessagesResponse.builder()
-                .messages(messageViews)
-                .expectedMessageIds(getMessagesRequest.getIds())
-                .build());
-    }
-
-    private static void notImplemented(String field) {
-        throw new JmapFieldNotSupportedException(ISSUER, field);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetVacationResponseMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetVacationResponseMethod.java
deleted file mode 100644
index b2a3e9ff3f..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/GetVacationResponseMethod.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.jmap.http.LoggingHelper.jmapAction;
-import static org.apache.james.jmap.utils.AccountIdUtil.toVacationAccountId;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.api.model.AccountId;
-import org.apache.james.jmap.draft.model.GetVacationRequest;
-import org.apache.james.jmap.draft.model.GetVacationResponse;
-import org.apache.james.jmap.draft.model.VacationResponse;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.date.ZonedDateTimeProvider;
-import org.apache.james.vacation.api.Vacation;
-import org.apache.james.vacation.api.VacationService;
-
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class GetVacationResponseMethod implements Method {
-
-    public static final Request.Name METHOD_NAME = Request.name("getVacationResponse");
-    public static final Response.Name RESPONSE_NAME = Method.Response.name("vacationResponse");
-
-    private final VacationService vacationService;
-    private final ZonedDateTimeProvider zonedDateTimeProvider;
-    private final MetricFactory metricFactory;
-
-    @Inject
-    public GetVacationResponseMethod(VacationService vacationService, ZonedDateTimeProvider zonedDateTimeProvider, MetricFactory metricFactory) {
-        this.vacationService = vacationService;
-        this.zonedDateTimeProvider = zonedDateTimeProvider;
-        this.metricFactory = metricFactory;
-    }
-
-    @Override
-    public Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return GetVacationRequest.class;
-    }
-
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkNotNull(request);
-        Preconditions.checkNotNull(methodCallId);
-        Preconditions.checkNotNull(mailboxSession);
-        Preconditions.checkArgument(request instanceof GetVacationRequest);
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            process(mailboxSession)
-                .map(response -> JmapResponse.builder()
-                    .methodCallId(methodCallId)
-                    .responseName(RESPONSE_NAME)
-                    .response(response)
-                    .build())
-                .flux()))
-            .contextWrite(jmapAction("VACATION"));
-    }
-
-    private Mono<GetVacationResponse> process(MailboxSession mailboxSession) {
-        return vacationService.retrieveVacation(toVacationAccountId(AccountId.fromUsername(mailboxSession.getUser())))
-            .map(vacation -> asVacationResponse(mailboxSession, vacation));
-    }
-
-    private GetVacationResponse asVacationResponse(MailboxSession mailboxSession, Vacation vacation) {
-        return GetVacationResponse.builder()
-            .accountId(mailboxSession.getUser().asString())
-            .vacationResponse(VacationResponse.builder()
-                .fromVacation(vacation)
-                .activated(vacation.isActiveAtDate(zonedDateTimeProvider.get()))
-                .build())
-            .build();
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParser.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParser.java
deleted file mode 100644
index 9be20e37e7..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParser.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.io.IOException;
-
-import org.apache.james.jmap.draft.model.InvocationRequest;
-import org.apache.james.jmap.methods.JmapRequest;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-
-public interface JmapRequestParser {
-
-    <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass)
-            throws IOException, JsonParseException, JsonMappingException;
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParserImpl.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParserImpl.java
deleted file mode 100644
index 47608d2e9b..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/JmapRequestParserImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.io.IOException;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.model.InvocationRequest;
-import org.apache.james.jmap.json.ObjectMapperFactory;
-import org.apache.james.jmap.methods.JmapRequest;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Preconditions;
-
-public class JmapRequestParserImpl implements JmapRequestParser {
-
-    private final ObjectMapper objectMapper;
-
-    @Inject
-    public JmapRequestParserImpl(ObjectMapperFactory objectMapperFactory) {
-        this.objectMapper = objectMapperFactory.forParsing();
-    }
-
-    @Override
-    public <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass)
-            throws IOException, JsonParseException, JsonMappingException {
-        Preconditions.checkNotNull(requestClass, "requestClass should not be null");
-
-        return objectMapper.treeToValue(request.getParameters(), requestClass);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MIMEMessageConverter.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MIMEMessageConverter.java
deleted file mode 100644
index c7acdf36e5..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MIMEMessageConverter.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Optional;
-import java.util.TimeZone;
-import java.util.function.Consumer;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.model.CreationMessage;
-import org.apache.james.jmap.draft.model.CreationMessage.DraftEmailer;
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.message.view.MessageViewFactory;
-import org.apache.james.mime4j.codec.DecodeMonitor;
-import org.apache.james.mime4j.codec.EncoderUtil;
-import org.apache.james.mime4j.codec.EncoderUtil.Usage;
-import org.apache.james.mime4j.dom.FieldParser;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.mime4j.dom.Multipart;
-import org.apache.james.mime4j.dom.TextBody;
-import org.apache.james.mime4j.dom.address.Mailbox;
-import org.apache.james.mime4j.dom.field.ContentDispositionField;
-import org.apache.james.mime4j.dom.field.ContentTypeField;
-import org.apache.james.mime4j.dom.field.FieldName;
-import org.apache.james.mime4j.dom.field.UnstructuredField;
-import org.apache.james.mime4j.field.ContentIdFieldImpl;
-import org.apache.james.mime4j.field.Fields;
-import org.apache.james.mime4j.field.LenientFieldParser;
-import org.apache.james.mime4j.field.UnstructuredFieldImpl;
-import org.apache.james.mime4j.message.BasicBodyFactory;
-import org.apache.james.mime4j.message.BodyPart;
-import org.apache.james.mime4j.message.BodyPartBuilder;
-import org.apache.james.mime4j.message.DefaultMessageWriter;
-import org.apache.james.mime4j.message.MultipartBuilder;
-import org.apache.james.mime4j.stream.NameValuePair;
-import org.apache.james.mime4j.stream.RawField;
-import org.apache.james.mime4j.util.MimeUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.io.ByteStreams;
-import com.google.common.net.MediaType;
-
-public class MIMEMessageConverter {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(MIMEMessageConverter.class);
-
-    private static final String PLAIN_TEXT_MEDIA_TYPE = MediaType.PLAIN_TEXT_UTF_8.withoutParameters().toString();
-    private static final String HTML_MEDIA_TYPE = MediaType.HTML_UTF_8.withoutParameters().toString();
-    private static final NameValuePair UTF_8_CHARSET = new NameValuePair("charset", StandardCharsets.UTF_8.name());
-    private static final String ALTERNATIVE_SUB_TYPE = "alternative";
-    private static final String MIXED_SUB_TYPE = "mixed";
-    private static final String RELATED_SUB_TYPE = "related";
-    private static final String QUOTED_PRINTABLE = "quoted-printable";
-    private static final String BASE64 = "base64";
-    private static final String IN_REPLY_TO_HEADER = "In-Reply-To";
-    private static final List<String> COMPUTED_HEADERS = ImmutableList.of(
-            FieldName.FROM,
-            FieldName.SENDER,
-            FieldName.REPLY_TO,
-            FieldName.TO,
-            FieldName.CC,
-            FieldName.BCC,
-            FieldName.SUBJECT,
-            FieldName.MESSAGE_ID,
-            FieldName.DATE,
-            FieldName.CONTENT_TYPE,
-            FieldName.MIME_VERSION,
-            FieldName.CONTENT_TRANSFER_ENCODING);
-    private static final List<String> LOWERCASED_COMPUTED_HEADERS = COMPUTED_HEADERS.stream()
-            .map(s -> s.toLowerCase(Locale.ENGLISH))
-            .collect(ImmutableList.toImmutableList());
-    private static final LenientFieldParser FIELD_PARSER = new LenientFieldParser();
-
-    private final BasicBodyFactory bodyFactory;
-
-    @Inject
-    public MIMEMessageConverter() {
-        this.bodyFactory = new BasicBodyFactory();
-    }
-
-    public byte[] convert(ValueWithId.CreationMessageEntry creationMessageEntry, ImmutableList<Attachment.WithBlob> messageAttachments) {
-        Message message = convertToMime(creationMessageEntry, messageAttachments);
-        byte[] result = asBytes(message);
-        message.dispose();
-        return result;
-    }
-
-    public byte[] asBytes(Message message) {
-        try {
-            return DefaultMessageWriter.asBytes(message);
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    @VisibleForTesting Message convertToMime(ValueWithId.CreationMessageEntry creationMessageEntry, ImmutableList<Attachment.WithBlob> messageAttachments) {
-        if (creationMessageEntry == null || creationMessageEntry.getValue() == null) {
-            throw new IllegalArgumentException("creationMessageEntry is either null or has null message");
-        }
-
-        Message.Builder messageBuilder = Message.Builder.of()
-            .use(FIELD_PARSER);
-        if (isMultipart(creationMessageEntry.getValue(), messageAttachments)) {
-            messageBuilder.setBody(createMultipart(creationMessageEntry.getValue(), messageAttachments));
-        } else {
-            messageBuilder.setBody(createTextBody(creationMessageEntry.getValue()))
-                .setContentTransferEncoding(QUOTED_PRINTABLE);
-        }
-        buildMimeHeaders(messageBuilder, creationMessageEntry.getValue(), messageAttachments);
-        return messageBuilder.build();
-    }
-
-    private void buildMimeHeaders(Message.Builder messageBuilder, CreationMessage newMessage, ImmutableList<Attachment.WithBlob> messageAttachments) {
-        Optional<Mailbox> fromAddress = newMessage.getFrom().filter(DraftEmailer::hasValidEmail).map(this::convertEmailToMimeHeader);
-        fromAddress.ifPresent(messageBuilder::setFrom);
-        fromAddress.ifPresent(messageBuilder::setSender);
-
-        messageBuilder.setReplyTo(newMessage.getReplyTo().stream()
-                .map(this::convertEmailToMimeHeader)
-                .collect(Collectors.toList()));
-        messageBuilder.setTo(newMessage.getTo().stream()
-                .filter(DraftEmailer::hasValidEmail)
-                .map(this::convertEmailToMimeHeader)
-                .collect(Collectors.toList()));
-        messageBuilder.setCc(newMessage.getCc().stream()
-                .filter(DraftEmailer::hasValidEmail)
-                .map(this::convertEmailToMimeHeader)
-                .collect(Collectors.toList()));
-        messageBuilder.setBcc(newMessage.getBcc().stream()
-                .filter(DraftEmailer::hasValidEmail)
-                .map(this::convertEmailToMimeHeader)
-                .collect(Collectors.toList()));
-        messageBuilder.setSubject(newMessage.getSubject());
-        messageBuilder.setMessageId(generateUniqueMessageId(fromAddress));
-
-        // note that date conversion probably lose milliseconds!
-        messageBuilder.setDate(Date.from(newMessage.getDate().toInstant()), TimeZone.getTimeZone(newMessage.getDate().getZone()));
-        newMessage.getInReplyToMessageId()
-            .ifPresent(id -> addHeader(messageBuilder, IN_REPLY_TO_HEADER, id));
-        if (!isMultipart(newMessage, messageAttachments)) {
-            newMessage.getHtmlBody().ifPresent(x -> messageBuilder.setContentType(HTML_MEDIA_TYPE, UTF_8_CHARSET));
-        }
-        newMessage.getHeaders().entrySet().stream()
-            .filter(header -> ! header.getKey().trim().isEmpty())
-            .filter(header -> ! LOWERCASED_COMPUTED_HEADERS.contains(header.getKey().toLowerCase(Locale.ENGLISH)))
-            .forEach(header -> addMultivaluedHeader(messageBuilder, header.getKey(), header.getValue()));
-    }
-
-    private String generateUniqueMessageId(Optional<Mailbox> fromAddress) {
-        String noDomain = null;
-        return MimeUtil.createUniqueMessageId(fromAddress
-            .map(Mailbox::getDomain)
-            .orElse(noDomain));
-    }
-
-    private void addMultivaluedHeader(Message.Builder messageBuilder, String fieldName, String multipleValues) {
-        Splitter.on(MessageViewFactory.JMAP_MULTIVALUED_FIELD_DELIMITER).split(multipleValues)
-            .forEach(value -> addHeader(messageBuilder, fieldName, value));
-    }
-
-    private void addHeader(Message.Builder messageBuilder, String fieldName, String value) {
-        FieldParser<UnstructuredField> parser = UnstructuredFieldImpl.PARSER;
-        RawField rawField = new RawField(fieldName, value);
-        messageBuilder.addField(parser.parse(rawField, DecodeMonitor.SILENT));
-    }
-
-    private boolean isMultipart(CreationMessage newMessage, ImmutableList<Attachment.WithBlob> messageAttachments) {
-        return (newMessage.getTextBody().isPresent() && newMessage.getHtmlBody().isPresent())
-                || hasAttachment(messageAttachments);
-    }
-
-    private boolean hasAttachment(ImmutableList<Attachment.WithBlob> messageAttachments) {
-        return !messageAttachments.isEmpty();
-    }
-
-    private TextBody createTextBody(CreationMessage newMessage) {
-        String body = newMessage.getHtmlBody()
-                        .orElse(newMessage.getTextBody()
-                                .orElse(""));
-        return bodyFactory.textBody(body, StandardCharsets.UTF_8);
-    }
-
-    private Multipart createMultipart(CreationMessage newMessage, ImmutableList<Attachment.WithBlob> messageAttachments) {
-        try {
-            if (hasAttachment(messageAttachments)) {
-                return createMultipartWithAttachments(newMessage, messageAttachments);
-            } else {
-                return createMultipartAlternativeBody(newMessage);
-            }
-        } catch (IOException e) {
-            LOGGER.error("Error while creating textBody \n{}\n or htmlBody \n{}", newMessage.getTextBody().get(), newMessage.getHtmlBody().get(), e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    private Multipart createMultipartWithAttachments(CreationMessage newMessage, ImmutableList<Attachment.WithBlob> messageAttachments) throws IOException {
-        MultipartBuilder mixedMultipartBuilder = MultipartBuilder.create(MIXED_SUB_TYPE);
-        List<Attachment.WithBlob> inlineAttachments = messageAttachments.stream()
-            .filter(attachment -> attachment.getAttachment().isIsInline())
-            .collect(ImmutableList.toImmutableList());
-        List<Attachment.WithBlob> besideAttachments = messageAttachments.stream()
-            .filter(Predicate.not(attachment -> attachment.getAttachment().isIsInline()))
-            .collect(ImmutableList.toImmutableList());
-
-        if (inlineAttachments.size() > 0) {
-            mixedMultipartBuilder.addBodyPart(relatedInnerMessage(newMessage, inlineAttachments));
-        } else {
-            addBody(newMessage, mixedMultipartBuilder);
-        }
-
-        addAttachments(besideAttachments, mixedMultipartBuilder);
-
-        return mixedMultipartBuilder.build();
-    }
-
-    private Message relatedInnerMessage(CreationMessage newMessage, List<Attachment.WithBlob> inlines) throws IOException {
-        MultipartBuilder relatedMultipart = MultipartBuilder.create(RELATED_SUB_TYPE);
-        addBody(newMessage, relatedMultipart);
-
-        return Message.Builder.of()
-            .setBody(addAttachments(inlines, relatedMultipart)
-                .build())
-            .build();
-    }
-
-    private MultipartBuilder addAttachments(List<Attachment.WithBlob> messageAttachments,
-                                            MultipartBuilder multipartBuilder) {
-        messageAttachments.forEach(addAttachment(multipartBuilder));
-
-        return multipartBuilder;
-    }
-    
-    private void addBody(CreationMessage newMessage, MultipartBuilder builder) throws IOException {
-        if (newMessage.getHtmlBody().isPresent() && newMessage.getTextBody().isPresent()) {
-            Multipart body = createMultipartAlternativeBody(newMessage);
-            builder.addBodyPart(BodyPartBuilder.create().setBody(body));
-        } else {
-            addText(builder, newMessage.getTextBody());
-            addHtml(builder, newMessage.getHtmlBody());
-        }
-    }
-
-    private Multipart createMultipartAlternativeBody(CreationMessage newMessage) throws IOException {
-        MultipartBuilder bodyBuilder = MultipartBuilder.create(ALTERNATIVE_SUB_TYPE);
-        addText(bodyBuilder, newMessage.getTextBody());
-        addHtml(bodyBuilder, newMessage.getHtmlBody());
-        return bodyBuilder.build();
-    }
-
-    private void addText(MultipartBuilder builder, Optional<String> textBody) throws IOException {
-        if (textBody.isPresent()) {
-            builder.addBodyPart(BodyPartBuilder.create()
-                .use(bodyFactory)
-                .setBody(textBody.get(), StandardCharsets.UTF_8)
-                .setContentType(PLAIN_TEXT_MEDIA_TYPE, UTF_8_CHARSET)
-                .setContentTransferEncoding(QUOTED_PRINTABLE));
-        }
-    }
-
-    private void addHtml(MultipartBuilder builder, Optional<String> htmlBody) throws IOException {
-        if (htmlBody.isPresent()) {
-            builder.addBodyPart(BodyPartBuilder.create()
-                .use(bodyFactory)
-                .setBody(htmlBody.get(), StandardCharsets.UTF_8)
-                .setContentType(HTML_MEDIA_TYPE, UTF_8_CHARSET)
-                .setContentTransferEncoding(QUOTED_PRINTABLE));
-        }
-    }
-
-    private Consumer<Attachment.WithBlob> addAttachment(MultipartBuilder builder) {
-        return att -> { 
-            try {
-                builder.addBodyPart(attachmentBodyPart(att));
-            } catch (IOException e) {
-                LOGGER.error("Error while creating attachment", e);
-                throw new RuntimeException(e);
-            }
-        };
-    }
-
-    private BodyPart attachmentBodyPart(Attachment.WithBlob att) throws IOException {
-        try (InputStream attachmentStream = att.getBlob().getStream()) {
-            BodyPartBuilder builder = BodyPartBuilder.create()
-                .use(bodyFactory)
-                .setBody(new BasicBodyFactory().binaryBody(ByteStreams.toByteArray(attachmentStream)))
-                .setField(contentTypeField(att.getAttachment()))
-                .setField(contentDispositionField(att.getAttachment().isIsInline()))
-                .setContentTransferEncoding(BASE64);
-            contentId(builder, att);
-            return builder.build();
-        }
-    }
-
-    private void contentId(BodyPartBuilder builder, Attachment.WithBlob att) {
-        if (att.getAttachment().getCid().isPresent()) {
-            builder.setField(ContentIdFieldImpl.PARSER.parse(new RawField("Content-ID", att.getAttachment().getCid().get()), DecodeMonitor.SILENT));
-        }
-    }
-
-    @VisibleForTesting
-    ContentTypeField contentTypeField(Attachment attachment) {
-        final ContentTypeField typeAsField = attachment.getType().asMime4J();
-        if (attachment.getName().isPresent()) {
-            return Fields.contentType(typeAsField.getMimeType(),
-                ImmutableMap.<String, String>builder()
-                    .putAll(parametersWithoutName(typeAsField))
-                    .put("name", encode(attachment.getName().get()))
-                    .build());
-        }
-        return typeAsField;
-    }
-
-    private ImmutableMap<String, String> parametersWithoutName(ContentTypeField typeAsField) {
-        return typeAsField.getParameters()
-            .entrySet()
-            .stream()
-            .filter(entry -> !entry.getKey().equals("name"))
-            .collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
-    }
-
-    private String encode(String name) {
-        return EncoderUtil.encodeEncodedWord(name, Usage.TEXT_TOKEN);
-    }
-
-    private ContentDispositionField contentDispositionField(boolean isInline) {
-        if (isInline) {
-            return Fields.contentDisposition("inline");
-        }
-        return Fields.contentDisposition("attachment");
-    }
-
-    private Mailbox convertEmailToMimeHeader(DraftEmailer address) {
-        if (!address.hasValidEmail()) {
-            throw new IllegalArgumentException("address");
-        }
-        CreationMessage.EmailUserAndDomain emailUserAndDomain = address.getEmailUserAndDomain();
-        return new Mailbox(address.getName().orElse(null), null, emailUserAndDomain.getUser().orElse(null), emailUserAndDomain.getDomain().orElse(null));
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxInvalidMessageCreationException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxInvalidMessageCreationException.java
deleted file mode 100644
index c6d572bd87..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxInvalidMessageCreationException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import org.apache.james.mailbox.exception.MailboxException;
-
-public class MailboxInvalidMessageCreationException extends MailboxException {
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxSendingNotAllowedException.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxSendingNotAllowedException.java
deleted file mode 100644
index 8c3f0f55c0..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MailboxSendingNotAllowedException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.util.Optional;
-
-import org.apache.james.core.Username;
-import org.apache.james.mailbox.exception.MailboxException;
-
-public class MailboxSendingNotAllowedException extends MailboxException {
-
-    private final Username connectedUser;
-    private final Optional<Username> fromField;
-
-    public MailboxSendingNotAllowedException(Username connectedUser, Optional<Username> fromField) {
-        super();
-        this.connectedUser = connectedUser;
-        this.fromField = fromField;
-    }
-
-    public Optional<Username> getFromField() {
-        return fromField;
-    }
-
-    public Username getConnectedUser() {
-        return connectedUser;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageAppender.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageAppender.java
deleted file mode 100644
index 978a218405..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageAppender.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import jakarta.inject.Inject;
-import jakarta.mail.Flags;
-import jakarta.mail.util.SharedByteArrayInputStream;
-
-import org.apache.james.jmap.JMAPConfiguration;
-import org.apache.james.jmap.draft.exceptions.AttachmentsNotFoundException;
-import org.apache.james.jmap.draft.exceptions.SizeExceededException;
-import org.apache.james.jmap.draft.methods.ValueWithId.CreationMessageEntry;
-import org.apache.james.jmap.draft.model.CreationMessage;
-import org.apache.james.jmap.methods.BlobManager;
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.Blob;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.message.view.MessageFullViewFactory.MetaDataWithContent;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.MessageManager.AppendResult;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.ByteContent;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.util.ReactorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class MessageAppender {
-    private static final Logger LOGGER = LoggerFactory.getLogger(MessageAppender.class);
-
-    private static class NewMessage {
-        private final byte[] messageContent;
-        private final Message message;
-        private final Date date;
-
-        private NewMessage(byte[] messageContent, Message message, Date date) {
-            this.messageContent = messageContent;
-            this.message = message;
-            this.date = date;
-        }
-    }
-
-    private final MailboxManager mailboxManager;
-    private final MessageIdManager messageIdManager;
-    private final MIMEMessageConverter mimeMessageConverter;
-    private final BlobManager blobManager;
-    private final JMAPConfiguration configuration;
-
-    @Inject
-    public MessageAppender(MailboxManager mailboxManager, MessageIdManager messageIdManager, MIMEMessageConverter mimeMessageConverter, BlobManager blobManager, JMAPConfiguration configuration) {
-        this.mailboxManager = mailboxManager;
-        this.messageIdManager = messageIdManager;
-        this.mimeMessageConverter = mimeMessageConverter;
-        this.blobManager = blobManager;
-        this.configuration = configuration;
-    }
-
-    public Mono<MetaDataWithContent> appendMessageInMailboxes(CreationMessageEntry createdEntry, List<MailboxId> targetMailboxes, MailboxSession session) {
-        return Mono.fromCallable(() -> {
-                Preconditions.checkArgument(!targetMailboxes.isEmpty());
-                ImmutableList<Attachment.WithBlob> attachmentsWithBlobs = getMessageAttachments(session, createdEntry.getValue().getAttachments());
-                Message message = mimeMessageConverter.convertToMime(createdEntry, attachmentsWithBlobs);
-
-                byte[] messageContent = mimeMessageConverter.asBytes(message);
-
-                if (maximumSizeExceeded(messageContent)) {
-                    throw new SizeExceededException(messageContent.length, configuration.getMaximumSendSize().get());
-                }
-
-                Date internalDate = Date.from(createdEntry.getValue().getDate().toInstant());
-
-                return new NewMessage(messageContent, message, internalDate);
-            }).subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER)
-            .flatMap(newMessage -> Mono.from(mailboxManager.getMailboxReactive(targetMailboxes.get(0), session))
-                .flatMap(mailbox -> Mono.from(mailbox.appendMessageReactive(
-                    MessageManager.AppendCommand.builder()
-                        .withInternalDate(newMessage.date)
-                        .withFlags(getFlags(createdEntry.getValue()))
-                        .notRecent()
-                        .withParsedMessage(newMessage.message)
-                        .build(new ByteContent(newMessage.messageContent)),
-                    session))
-                    .flatMap(appendResult -> {
-                        ComposedMessageId ids = appendResult.getId();
-                        if (targetMailboxes.size() > 1) {
-                            return Mono.from(messageIdManager.setInMailboxesReactive(ids.getMessageId(), targetMailboxes, session))
-                                .thenReturn(appendResult);
-                        }
-                        return Mono.just(appendResult);
-                    })
-                    .doFinally(any -> newMessage.message.dispose())
-                    .map(appendResult -> MetaDataWithContent.builder()
-                        .uid(appendResult.getId().getUid())
-                        .keywords(createdEntry.getValue().getKeywords())
-                        .internalDate(newMessage.date.toInstant())
-                        .sharedContent(new SharedByteArrayInputStream(newMessage.messageContent))
-                        .size(newMessage.messageContent.length)
-                        .attachments(appendResult.getMessageAttachments())
-                        .mailboxId(mailbox.getId())
-                        .message(newMessage.message)
-                        .messageId(appendResult.getId().getMessageId())
-                        .build())));
-    }
-
-    private Boolean maximumSizeExceeded(byte[] messageContent) {
-        return configuration.getMaximumSendSize().map(limit -> messageContent.length > limit).orElse(false);
-    }
-
-    public MetaDataWithContent appendMessageInMailbox(org.apache.james.mime4j.dom.Message message,
-                                                      MessageManager messageManager,
-                                                      Flags flags,
-                                                      MailboxSession session) throws MailboxException {
-
-
-        byte[] messageContent = mimeMessageConverter.asBytes(message);
-        Date internalDate = new Date();
-
-        AppendResult appendResult = messageManager.appendMessage(MessageManager.AppendCommand.builder()
-            .withFlags(flags)
-            .build(new ByteContent(messageContent)), session);
-        ComposedMessageId ids = appendResult.getId();
-
-        return MetaDataWithContent.builder()
-            .uid(ids.getUid())
-            .keywords(Keywords.lenientFactory().fromFlags(flags))
-            .internalDate(internalDate.toInstant())
-            .sharedContent(new SharedByteArrayInputStream(messageContent))
-            .size(messageContent.length)
-            .attachments(appendResult.getMessageAttachments())
-            .mailboxId(messageManager.getId())
-            .message(message)
-            .messageId(ids.getMessageId())
-            .build();
-    }
-
-    private Flags getFlags(CreationMessage message) {
-        return message.getKeywords().asFlags();
-    }
-
-    private ImmutableList<Attachment.WithBlob> getMessageAttachments(MailboxSession session, ImmutableList<Attachment> attachments) {
-        ImmutableMap<BlobId, Blob> blobs = Flux.from(blobManager.retrieve(attachments.stream()
-                .map(Attachment::getBlobId)
-                .collect(ImmutableList.toImmutableList()),
-            session))
-            .collect(ImmutableMap.toImmutableMap(Blob::getBlobId, Function.identity()))
-            .block();
-
-        ImmutableList<Attachment.WithBlob> result = attachments
-            .stream()
-            .flatMap(attachment -> Optional.ofNullable(blobs.get(attachment.getBlobId()))
-                .map(blob -> new Attachment.WithBlob(attachment, blob))
-                .stream())
-            .collect(ImmutableList.toImmutableList());
-
-        if (result.size() != attachments.size()) {
-            Sets.SetView<BlobId> notFound = Sets.difference(attachments.stream().map(Attachment::getBlobId).collect(Collectors.toSet()),
-                result.stream().map(att -> att.getAttachment().getBlobId()).collect(Collectors.toSet()));
-            throw new AttachmentsNotFoundException(ImmutableList.copyOf(notFound));
-        }
-        return result;
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageSender.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageSender.java
deleted file mode 100644
index e443735024..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/MessageSender.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.io.InputStream;
-
-import jakarta.inject.Inject;
-import jakarta.mail.MessagingException;
-
-import org.apache.james.jmap.draft.send.MailSpool;
-import org.apache.james.jmap.model.message.view.MessageFullViewFactory.MetaDataWithContent;
-import org.apache.james.jmap.send.MailMetadata;
-import org.apache.james.lifecycle.api.LifecycleUtil;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.server.core.Envelope;
-import org.apache.james.server.core.MailImpl;
-import org.apache.james.server.core.MimeMessageSource;
-import org.apache.mailet.Mail;
-
-import com.google.common.annotations.VisibleForTesting;
-
-import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
-
-public class MessageSender {
-    public static class MessageMimeMessageSource implements MimeMessageSource {
-        private final String id;
-        private final MetaDataWithContent message;
-
-        public MessageMimeMessageSource(String id, MetaDataWithContent message) {
-            this.id = id;
-            this.message = message;
-        }
-
-        @Override
-        public String getSourceId() {
-            return id;
-        }
-
-        @Override
-        public InputStream getInputStream() {
-            return message.getContent();
-        }
-
-        @Override
-        public long getMessageSize() {
-            return message.getSize();
-        }
-    }
-
-    private final MailSpool mailSpool;
-
-    @Inject
-    public MessageSender(MailSpool mailSpool) {
-        this.mailSpool = mailSpool;
-    }
-
-    public Mono<Void> sendMessage(MetaDataWithContent message, Envelope envelope, MailboxSession session) {
-        return Mono.usingWhen(Mono.fromCallable(() -> buildMail(message, envelope)),
-            mail -> sendMessage(message.getMessageId(), mail, session),
-            mail -> Mono.fromRunnable(() -> LifecycleUtil.dispose(mail)).subscribeOn(Schedulers.boundedElastic()));
-    }
-
-    @VisibleForTesting
-    static Mail buildMail(MetaDataWithContent message, Envelope envelope) throws MessagingException {
-        String name = message.getMessageId().serialize();
-        MailImpl mail = MailImpl.builder()
-            .name(name)
-            .sender(envelope.getFrom().asOptional().orElseThrow(() -> new RuntimeException("Sender is mandatory")))
-            .addRecipients(envelope.getRecipients())
-            .build();
-        mail.setMessageContent(new MessageMimeMessageSource(name, message));
-        return mail;
-    }
-
-    public Mono<Void> sendMessage(MessageId messageId, Mail mail, MailboxSession session) {
-        MailMetadata metadata = new MailMetadata(messageId, session.getUser().asString());
-        return mailSpool.send(mail, metadata);
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/ReferenceUpdater.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/ReferenceUpdater.java
deleted file mode 100644
index 91f0c8ba11..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/ReferenceUpdater.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Optional;
-
-import jakarta.inject.Inject;
-import jakarta.mail.Flags;
-
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager.FlagsUpdateMode;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.Header;
-import org.apache.james.mailbox.model.Headers;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MultimailboxesSearchQuery;
-import org.apache.james.mailbox.model.SearchQuery;
-import org.apache.james.util.streams.Iterators;
-import org.apache.mailet.base.RFC2822Headers;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class ReferenceUpdater {
-    public static final String X_FORWARDED_ID_HEADER = "X-Forwarded-Message-Id";
-    public static final Flags FORWARDED_FLAG = new Flags("$Forwarded");
-
-    private static final Logger logger = LoggerFactory.getLogger(ReferenceUpdater.class);
-
-    private final MessageIdManager messageIdManager;
-    private final MailboxManager mailboxManager;
-
-    @Inject
-    public ReferenceUpdater(MessageIdManager messageIdManager, MailboxManager mailboxManager) {
-        this.messageIdManager = messageIdManager;
-        this.mailboxManager = mailboxManager;
-    }
-
-    public Mono<Void> updateReferences(Headers headers, MailboxSession session) throws MailboxException {
-        Map<String, String> headersAsMap = Iterators.toStream(headers.headers())
-            .collect(ImmutableMap.toImmutableMap(Header::getName, Header::getValue));
-        return updateReferences(headersAsMap, session);
-    }
-
-    public Mono<Void> updateReferences(Map<String, String> headers, MailboxSession session) throws MailboxException {
-        Optional<String> inReplyToId = Optional.ofNullable(headers.get(RFC2822Headers.IN_REPLY_TO));
-        Optional<String> forwardedId = Optional.ofNullable(headers.get(X_FORWARDED_ID_HEADER));
-
-        return inReplyToId.map(Throwing.function((String id) -> updateAnswered(id, session)).sneakyThrow()).orElse(Mono.empty())
-            .then(forwardedId.map((Throwing.function((String id) -> updateForwarded(id, session)).sneakyThrow())).orElse(Mono.empty()));
-    }
-
-    private Mono<Void> updateAnswered(String messageId, MailboxSession session) throws MailboxException {
-        return updateFlag(messageId, session, new Flags(Flags.Flag.ANSWERED));
-    }
-
-    private Mono<Void> updateForwarded(String messageId, MailboxSession session) throws MailboxException {
-        return updateFlag(messageId, session, FORWARDED_FLAG);
-    }
-
-    private Mono<Void> updateFlag(String messageId, MailboxSession session, Flags flag) throws MailboxException {
-        int limit = 2;
-        MultimailboxesSearchQuery searchByRFC822MessageId = MultimailboxesSearchQuery
-            .from(SearchQuery.of(SearchQuery.mimeMessageID(messageId)))
-            .build();
-        return Flux.from(mailboxManager.search(searchByRFC822MessageId, session, limit))
-            .collectList()
-            .flatMap(references -> {
-                MessageId reference = Iterables.getOnlyElement(references);
-                return Flux.from(messageIdManager.messageMetadata(reference, session))
-                    .map(metaData -> metaData.getComposedMessageId().getMailboxId())
-                    .collect(ImmutableList.toImmutableList())
-                    .flatMap(mailboxIds -> Mono.from(messageIdManager.setFlagsReactive(flag, FlagsUpdateMode.ADD, reference, mailboxIds, session)));
-            })
-            .onErrorResume(NoSuchElementException.class, e -> {
-                logger.info("Unable to find a message with this Mime Message Id: " + messageId);
-                return Mono.empty();
-            })
-            .onErrorResume(IllegalArgumentException.class, e -> {
-                logger.info("Too many messages are matching this Mime Message Id: " + messageId);
-                return Mono.empty();
-            });
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/RequestHandler.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/RequestHandler.java
deleted file mode 100644
index 63d4fb0cd9..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/RequestHandler.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.draft.exceptions.JmapFieldNotSupportedException;
-import org.apache.james.jmap.draft.model.AuthenticatedRequest;
-import org.apache.james.jmap.methods.ErrorResponse;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.JmapResponseWriter;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.InvocationResponse;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.util.MDCBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class RequestHandler {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class);
-
-    private final JmapRequestParser jmapRequestParser;
-    private final JmapResponseWriter jmapResponseWriter;
-    private final Map<Method.Request.Name, Method> methods;
-
-    @Inject
-    public RequestHandler(Set<Method> methods, JmapRequestParser jmapRequestParser, JmapResponseWriter jmapResponseWriter) {
-        this.jmapRequestParser = jmapRequestParser;
-        this.jmapResponseWriter = jmapResponseWriter;
-        this.methods = methods.stream()
-                .collect(Collectors.toMap(Method::requestHandled, Function.identity()));
-    }
-
-    public Flux<InvocationResponse> handle(AuthenticatedRequest request) {
-        Optional<MailboxSession> mailboxSession = Optional.ofNullable(request.getMailboxSession());
-        try (Closeable closeable =
-                 MDCBuilder.create()
-                     .addToContextIfPresent(MDCBuilder.USER, mailboxSession.map(MailboxSession::getUser).map(Username::asString))
-                     .addToContextIfPresent(MDCBuilder.SESSION_ID, mailboxSession.map(MailboxSession::getSessionId)
-                        .map(MailboxSession.SessionId::getValue)
-                        .map(l -> Long.toString(l)))
-                     .addToContext(MDCBuilder.ACTION, request.getMethodName().getName())
-                     .build()) {
-            return Optional.ofNullable(methods.get(request.getMethodName()))
-                .map(extractAndProcess(request))
-                .map(jmapResponseWriter::formatMethodResponse)
-                .orElseThrow(() -> new IllegalStateException("unknown method " + request.getMethodName()));
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    private Function<Method, Flux<JmapResponse>> extractAndProcess(AuthenticatedRequest request) {
-        MailboxSession mailboxSession = request.getMailboxSession();
-        return (Method method) ->
-            Mono.fromCallable(() -> jmapRequestParser.extractJmapRequest(request, method.requestType()))
-                .flatMapMany(jmapRequest -> method.process(jmapRequest, request.getMethodCallId(), mailboxSession))
-                .onErrorResume(JmapFieldNotSupportedException.class, e -> errorNotImplemented(e, request))
-                .onErrorResume(
-                    e -> e.getCause() instanceof JmapFieldNotSupportedException,
-                    e -> errorNotImplemented((JmapFieldNotSupportedException) e.getCause(), request))
-                .onErrorResume(IOException.class, e -> error(request, generateInvalidArgumentError(e.getMessage())));
-    }
-
-    public ErrorResponse generateInvalidArgumentError(String description) {
-        return ErrorResponse.builder()
-            .type("invalidArguments")
-            .description(description)
-            .build();
-    }
-
-    private Flux<JmapResponse> errorNotImplemented(JmapFieldNotSupportedException error, AuthenticatedRequest request) {
-        return Flux.just(
-                JmapResponse.builder()
-                    .methodCallId(request.getMethodCallId())
-                    .error(generateInvalidArgumentError("The field '" + error.getField() + "' of '" + error.getIssuer() + "' is not supported"))
-                    .build());
-    }
-
-    private Flux<JmapResponse> error(AuthenticatedRequest request, ErrorResponse error) {
-        return Flux.just(
-                JmapResponse.builder()
-                    .methodCallId(request.getMethodCallId())
-                    .error(error)
-                    .build());
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SendMDNProcessor.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SendMDNProcessor.java
deleted file mode 100644
index 7d2e643300..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SendMDNProcessor.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.jmap.methods.Method.JMAP_PREFIX;
-
-import java.io.IOException;
-import java.util.List;
-
-import jakarta.inject.Inject;
-import jakarta.mail.Flags;
-import jakarta.mail.MessagingException;
-
-import org.apache.james.jmap.draft.exceptions.InvalidOriginMessageForMDNException;
-import org.apache.james.jmap.draft.exceptions.MessageNotFoundException;
-import org.apache.james.jmap.draft.model.JmapMDN;
-import org.apache.james.jmap.draft.model.SetError;
-import org.apache.james.jmap.draft.model.SetMessagesRequest;
-import org.apache.james.jmap.draft.model.SetMessagesResponse;
-import org.apache.james.jmap.model.message.view.MessageFullViewFactory.MetaDataWithContent;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.Role;
-import org.apache.james.mailbox.SystemMailboxesProvider;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.exception.OverQuotaException;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.mime4j.codec.DecodeMonitor;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.mime4j.dom.field.ParseException;
-import org.apache.james.mime4j.message.DefaultMessageBuilder;
-import org.apache.james.mime4j.stream.MimeConfig;
-import org.apache.james.server.core.Envelope;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import reactor.core.publisher.Flux;
-
-public class SendMDNProcessor implements SetMessagesProcessor {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(SendMDNProcessor.class);
-
-    private final MetricFactory metricFactory;
-    private final SystemMailboxesProvider systemMailboxesProvider;
-    private final MessageIdManager messageIdManager;
-    private final MessageAppender messageAppender;
-    private final MessageSender messageSender;
-
-    @Inject
-    public SendMDNProcessor(MetricFactory metricFactory, SystemMailboxesProvider systemMailboxesProvider,
-                            MessageIdManager messageIdManager, MessageAppender messageAppender, MessageSender messageSender) {
-        this.metricFactory = metricFactory;
-        this.systemMailboxesProvider = systemMailboxesProvider;
-        this.messageIdManager = messageIdManager;
-        this.messageAppender = messageAppender;
-        this.messageSender = messageSender;
-    }
-
-    @Override
-    public SetMessagesResponse process(SetMessagesRequest request, MailboxSession mailboxSession) {
-        if (request.getSendMDN().isEmpty()) {
-            return SetMessagesResponse.builder().build();
-        }
-        return metricFactory.decorateSupplierWithTimerMetric(JMAP_PREFIX + "SendMDN",
-            () -> handleMDNCreation(request, mailboxSession));
-    }
-
-    private SetMessagesResponse handleMDNCreation(SetMessagesRequest request, MailboxSession mailboxSession) {
-        return request.getSendMDN()
-            .stream()
-            .map(MDNCreationEntry -> handleMDNCreation(MDNCreationEntry, mailboxSession))
-            .reduce(SetMessagesResponse.builder(), SetMessagesResponse.Builder::mergeWith)
-            .build();
-    }
-
-    private SetMessagesResponse.Builder handleMDNCreation(ValueWithId.MDNCreationEntry MDNCreationEntry, MailboxSession mailboxSession) {
-        try {
-            MessageId messageId = sendMdn(MDNCreationEntry, mailboxSession);
-            return SetMessagesResponse.builder()
-                .mdnSent(MDNCreationEntry.getCreationId(), messageId);
-        } catch (InvalidOriginMessageForMDNException e) {
-            return SetMessagesResponse.builder()
-                .mdnNotSent(MDNCreationEntry.getCreationId(),
-                    SetError.builder()
-                        .description(String.format("Origin messageId '%s' is invalid." +
-                                " A Message Delivery Notification can not be generated for it." +
-                                " Explanation: " + e.getExplanation(),
-                            MDNCreationEntry.getValue().getMessageId().serialize()))
-                        .type(SetError.Type.INVALID_ARGUMENTS)
-                        .build());
-
-        } catch (MessageNotFoundException e) {
-            return SetMessagesResponse.builder()
-                .mdnNotSent(MDNCreationEntry.getCreationId(),
-                    SetError.builder()
-                        .description(String.format("Message with id %s not found. Thus could not send MDN.",
-                            MDNCreationEntry.getValue().getMessageId().serialize()))
-                        .type(SetError.Type.INVALID_ARGUMENTS)
-                        .build());
-
-        } catch (OverQuotaException e) {
-            return SetMessagesResponse.builder()
-                .mdnNotSent(MDNCreationEntry.getCreationId(),
-                    SetError.builder()
-                        .description(e.getMessage())
-                        .type(SetError.Type.MAX_QUOTA_REACHED)
-                        .build());
-
-        } catch (Exception e) {
-            LOGGER.error("Error while sending MDN", e);
-            return SetMessagesResponse.builder()
-                .mdnNotSent(MDNCreationEntry.getCreationId(),
-                    SetError.builder()
-                        .description(String.format("Could not send MDN %s", MDNCreationEntry.getCreationId().getId()))
-                        .type(SetError.Type.ERROR)
-                        .build());
-        }
-    }
-
-    private MessageId sendMdn(ValueWithId.MDNCreationEntry MDNCreationEntry, MailboxSession mailboxSession)
-            throws MailboxException, IOException, MessagingException, ParseException, MessageNotFoundException, InvalidOriginMessageForMDNException {
-
-        JmapMDN mdn = MDNCreationEntry.getValue();
-        Message originalMessage = retrieveOriginalMessage(mdn, mailboxSession);
-
-        Message mdnAnswer = mdn.generateMDNMessage(originalMessage, mailboxSession);
-        originalMessage.dispose();
-
-        Flags seen = new Flags(Flags.Flag.SEEN);
-        MetaDataWithContent metaDataWithContent = messageAppender.appendMessageInMailbox(mdnAnswer,
-            getOutbox(mailboxSession), seen, mailboxSession);
-
-        messageSender.sendMessage(metaDataWithContent, Envelope.fromMime4JMessage(mdnAnswer), mailboxSession)
-            .block();
-
-        return metaDataWithContent.getMessageId();
-    }
-
-    private Message retrieveOriginalMessage(JmapMDN mdn, MailboxSession mailboxSession) throws MailboxException, IOException, MessageNotFoundException {
-        List<MessageResult> messages = messageIdManager.getMessage(mdn.getMessageId(), FetchGroup.HEADERS, mailboxSession);
-
-        if (messages.size() == 0) {
-            throw new MessageNotFoundException();
-        }
-
-        DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder();
-        messageBuilder.setMimeEntityConfig(MimeConfig.PERMISSIVE);
-        messageBuilder.setDecodeMonitor(DecodeMonitor.SILENT);
-        return messageBuilder.parseMessage(messages.get(0).getHeaders().getInputStream());
-    }
-
-    private MessageManager getOutbox(MailboxSession mailboxSession) throws MailboxException {
-        return Flux.from(systemMailboxesProvider.getMailboxByRole(Role.OUTBOX, mailboxSession.getUser()))
-            .toStream()
-            .findAny()
-            .orElseThrow(() -> new IllegalStateException("User don't have an Outbox"));
-    }
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetFilterMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetFilterMethod.java
deleted file mode 100644
index 32cbe9292f..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetFilterMethod.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.jmap.http.LoggingHelper.jmapAction;
-import static org.apache.james.util.ReactorUtils.context;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.filtering.FilteringManagement;
-import org.apache.james.jmap.api.filtering.Rule;
-import org.apache.james.jmap.draft.model.JmapRuleDTO;
-import org.apache.james.jmap.draft.model.SetError;
-import org.apache.james.jmap.draft.model.SetFilterRequest;
-import org.apache.james.jmap.draft.model.SetFilterResponse;
-import org.apache.james.jmap.methods.ErrorResponse;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.MDCBuilder;
-import org.apache.james.util.ReactorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableListMultimap;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class SetFilterMethod implements Method {
-
-    public static class DuplicatedRuleException extends Exception {
-        private final ImmutableList<Rule.Id> duplicatedIds;
-
-        public DuplicatedRuleException(ImmutableList<Rule.Id> duplicatedIds) {
-            super("The following rules were duplicated:" + format(duplicatedIds));
-            this.duplicatedIds = duplicatedIds;
-        }
-    }
-
-    public static class MultipleMailboxIdException extends Exception {
-        private final ImmutableList<Rule.Id> idsWithMultipleMailboxes;
-
-        public MultipleMailboxIdException(ImmutableList<Rule.Id> idsWithMultipleMailboxes) {
-            super("The following rules were targeting several mailboxes:" + format(idsWithMultipleMailboxes));
-            this.idsWithMultipleMailboxes = idsWithMultipleMailboxes;
-        }
-    }
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(SetFilterMethod.class);
-
-    private static final Request.Name METHOD_NAME = Request.name("setFilter");
-    private static final Response.Name RESPONSE_NAME = Response.name("filterSet");
-
-    private static String format(ImmutableList<Rule.Id> ids) {
-        return "[" + ids.stream()
-                .map(Rule.Id::asString)
-                .map(SetFilterMethod::quote)
-                .collect(Collectors.joining(","))
-                + "]";
-    }
-
-    private static String quote(String s) {
-        return "'" + s + "'";
-    }
-
-    private final MetricFactory metricFactory;
-    private final FilteringManagement filteringManagement;
-
-    @Inject
-    public SetFilterMethod(MetricFactory metricFactory, FilteringManagement filteringManagement) {
-        this.filteringManagement = filteringManagement;
-        this.metricFactory = metricFactory;
-    }
-
-    @Override
-    public Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return SetFilterRequest.class;
-    }
-
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkNotNull(request);
-        Preconditions.checkNotNull(methodCallId);
-        Preconditions.checkNotNull(mailboxSession);
-
-        Preconditions.checkArgument(request instanceof SetFilterRequest);
-
-        SetFilterRequest setFilterRequest = (SetFilterRequest) request;
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            process(methodCallId, mailboxSession, setFilterRequest)
-                .contextWrite(jmapAction("SET_FILTER"))
-                .contextWrite(context("SET_FILTER", MDCBuilder.ofValue("update", setFilterRequest.getSingleton().toString())))));
-    }
-
-    private Mono<JmapResponse> process(MethodCallId methodCallId, MailboxSession mailboxSession, SetFilterRequest request) {
-        try {
-            return updateFilter(methodCallId, request, mailboxSession.getUser())
-                .doOnEach(ReactorUtils.logOnError(e -> LOGGER.warn("Failed setting Rules", e)))
-                .onErrorResume(e -> Mono.just(unknownError(methodCallId)));
-        } catch (MultipleMailboxIdException e) {
-            LOGGER.debug("Rule targeting several mailboxes", e);
-            return Mono.just(multipleMailboxesError(methodCallId, e));
-        }  catch (DuplicatedRuleException e) {
-            LOGGER.debug("Duplicated rules", e);
-            return Mono.just(duplicatedIdsError(methodCallId, e));
-        }  catch (IllegalArgumentException e) {
-            LOGGER.warn("IllegalArgumentException of setting Rules", e);
-            return Mono.just(invalidArgumentsError(methodCallId, e.getMessage()));
-        } catch (IllegalStateException e) {
-            LOGGER.warn("IllegalStateException of setting Rules", e);
-            return Mono.just(invalidArgumentsError(methodCallId, e.getMessage()));
-        } catch (Exception e) {
-            LOGGER.warn("Failed setting Rules", e);
-            return Mono.just(unknownError(methodCallId));
-        }
-    }
-
-    private Mono<JmapResponse> updateFilter(MethodCallId methodCallId, SetFilterRequest request, Username username) throws DuplicatedRuleException, MultipleMailboxIdException {
-        ImmutableList<Rule> rules = request.getSingleton().stream()
-            .map(JmapRuleDTO::toRule)
-            .collect(ImmutableList.toImmutableList());
-
-        ensureNoDuplicatedRules(rules);
-        ensureNoMultipleMailboxesRules(rules);
-
-        return Mono.from(filteringManagement.defineRulesForUser(username, rules, Optional.empty()))
-            .thenReturn(JmapResponse.builder()
-                .methodCallId(methodCallId)
-                .responseName(RESPONSE_NAME)
-                .response(SetFilterResponse.updated())
-                .build());
-    }
-
-    private void ensureNoMultipleMailboxesRules(ImmutableList<Rule> rules) throws MultipleMailboxIdException {
-        ImmutableList<Rule.Id> idWithMultipleMailboxes = rules.stream()
-            .filter(rule -> rule.getAction().getAppendInMailboxes().getMailboxIds().size() > 1)
-            .map(Rule::getId)
-            .collect(ImmutableList.toImmutableList());
-
-        if (!idWithMultipleMailboxes.isEmpty()) {
-            throw new MultipleMailboxIdException(idWithMultipleMailboxes);
-        }
-    }
-
-    private void ensureNoDuplicatedRules(List<Rule> rules) throws DuplicatedRuleException {
-        ImmutableList<Rule.Id> duplicatedIds = rules.stream()
-            .collect(ImmutableListMultimap.toImmutableListMultimap(
-                Rule::getId,
-                Function.identity()))
-            .asMap()
-            .entrySet()
-            .stream()
-            .filter(entry -> entry.getValue().size() > 1)
-            .map(Map.Entry::getKey)
-            .collect(ImmutableList.toImmutableList());
-
-        if (!duplicatedIds.isEmpty()) {
-            throw new DuplicatedRuleException(duplicatedIds);
-        }
-    }
-
-    private JmapResponse unknownError(MethodCallId methodCallId) {
-        return unknownError(methodCallId, "Failed to retrieve filter");
-    }
-
-    private JmapResponse invalidArgumentsError(MethodCallId methodCallId, String errorMessage) {
-        return JmapResponse.builder()
-            .methodCallId(methodCallId)
-            .responseName(RESPONSE_NAME)
-            .response(ErrorResponse.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS.asString())
-                .description(errorMessage)
-                .build())
-            .build();
-    }
-
-    private JmapResponse unknownError(MethodCallId methodCallId, String errorMessage) {
-        return JmapResponse.builder()
-            .methodCallId(methodCallId)
-            .responseName(RESPONSE_NAME)
-            .response(ErrorResponse.builder()
-                .type(SetError.Type.ERROR.asString())
-                .description(errorMessage)
-                .build())
-            .build();
-    }
-
-    private JmapResponse duplicatedIdsError(MethodCallId methodCallId, DuplicatedRuleException e) {
-        return JmapResponse.builder()
-            .methodCallId(methodCallId)
-            .responseName(RESPONSE_NAME)
-            .response(SetFilterResponse.notUpdated(SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description("The following rules were duplicated: " + format(e.duplicatedIds))
-                .build()))
-            .build();
-    }
-
-    private JmapResponse multipleMailboxesError(MethodCallId methodCallId, MultipleMailboxIdException e) {
-        return JmapResponse.builder()
-            .methodCallId(methodCallId)
-            .responseName(RESPONSE_NAME)
-            .response(SetFilterResponse.notUpdated(SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description("The following rules targeted several mailboxes, which is not supported: " + format(e.idsWithMultipleMailboxes))
-                .build()))
-            .build();
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesCreationProcessor.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesCreationProcessor.java
deleted file mode 100644
index 3a246a8278..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesCreationProcessor.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.jmap.methods.Method.JMAP_PREFIX;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.exceptions.MailboxNotOwnedException;
-import org.apache.james.jmap.draft.exceptions.MailboxParentNotFoundException;
-import org.apache.james.jmap.draft.model.MailboxCreationId;
-import org.apache.james.jmap.draft.model.MailboxFactory;
-import org.apache.james.jmap.draft.model.SetError;
-import org.apache.james.jmap.draft.model.SetMailboxesRequest;
-import org.apache.james.jmap.draft.model.SetMailboxesResponse;
-import org.apache.james.jmap.draft.model.mailbox.Mailbox;
-import org.apache.james.jmap.draft.model.mailbox.MailboxCreateRequest;
-import org.apache.james.jmap.draft.utils.DependencyGraph.CycleDetectedException;
-import org.apache.james.jmap.draft.utils.SortingHierarchicalCollections;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.exception.InboxAlreadyCreated;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.exception.MailboxExistsException;
-import org.apache.james.mailbox.exception.MailboxNameException;
-import org.apache.james.mailbox.exception.MailboxNotFoundException;
-import org.apache.james.mailbox.exception.TooLongMailboxNameException;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxId.Factory;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.metrics.api.TimeMetric;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.github.fge.lambdas.Throwing;
-import com.github.fge.lambdas.functions.FunctionChainer;
-import com.google.common.annotations.VisibleForTesting;
-
-public class SetMailboxesCreationProcessor implements SetMailboxesProcessor {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(SetMailboxesCreationProcessor.class);
-
-    private final MailboxManager mailboxManager;
-    private final SortingHierarchicalCollections<Map.Entry<MailboxCreationId, MailboxCreateRequest>, MailboxCreationId> sortingHierarchicalCollections;
-    private final MailboxFactory mailboxFactory;
-    private final Factory mailboxIdFactory;
-    private final MetricFactory metricFactory;
-
-    @Inject
-    @VisibleForTesting
-    SetMailboxesCreationProcessor(MailboxManager mailboxManager, MailboxFactory mailboxFactory, Factory mailboxIdFactory, MetricFactory metricFactory) {
-        this.mailboxManager = mailboxManager;
-        this.metricFactory = metricFactory;
-        this.sortingHierarchicalCollections =
-            new SortingHierarchicalCollections<>(
-                Map.Entry::getKey,
-                x -> x.getValue().getParentId());
-        this.mailboxFactory = mailboxFactory;
-        this.mailboxIdFactory = mailboxIdFactory;
-    }
-
-    @Override
-    public SetMailboxesResponse process(SetMailboxesRequest request, MailboxSession mailboxSession) {
-        TimeMetric timeMetric = metricFactory.timer(JMAP_PREFIX + "SetMailboxesCreationProcessor");
-
-        SetMailboxesResponse.Builder builder = SetMailboxesResponse.builder();
-        try {
-            Map<MailboxCreationId, MailboxId> creationIdsToCreatedMailboxId = new HashMap<>();
-            sortingHierarchicalCollections.sortFromRootToLeaf(request.getCreate().entrySet())
-                .forEach(entry -> 
-                    createMailbox(entry.getKey(), entry.getValue(), mailboxSession, creationIdsToCreatedMailboxId, builder));
-        } catch (CycleDetectedException e) {
-            markRequestsAsNotCreatedDueToCycle(request, builder);
-        }
-
-        timeMetric.stopAndPublish();
-        return builder.build();
-    }
-
-    private void markRequestsAsNotCreatedDueToCycle(SetMailboxesRequest request, SetMailboxesResponse.Builder builder) {
-        request.getCreate().forEach((key, value) ->
-            builder.notCreated(
-                key,
-                SetError.builder()
-                    .type(SetError.Type.INVALID_ARGUMENTS)
-                    .description("The created mailboxes introduce a cycle.")
-                    .build()));
-    }
-
-    private void createMailbox(MailboxCreationId mailboxCreationId, MailboxCreateRequest mailboxRequest, MailboxSession mailboxSession,
-            Map<MailboxCreationId, MailboxId> creationIdsToCreatedMailboxId, SetMailboxesResponse.Builder builder) {
-        try {
-            ensureValidMailboxName(mailboxRequest, mailboxSession);
-            MailboxPath mailboxPath = computeMailboxPath(mailboxRequest, creationIdsToCreatedMailboxId, mailboxSession);
-            Optional<MailboxId> mailboxId = mailboxManager.createMailbox(mailboxPath, MailboxManager.CreateOption.CREATE_SUBSCRIPTION, mailboxSession);
-            Optional<Mailbox> mailbox = mailboxId.flatMap(id -> mailboxFactory.builder()
-                    .id(id)
-                    .session(mailboxSession)
-                    .build()
-                    .blockOptional());
-            if (mailbox.isPresent()) {
-                builder.created(mailboxCreationId, mailbox.get());
-                creationIdsToCreatedMailboxId.put(mailboxCreationId, mailbox.get().getId());
-            } else {
-                builder.notCreated(mailboxCreationId, SetError.builder()
-                    .type(SetError.Type.ERROR)
-                    .description("An error occurred when creating the mailbox")
-                    .build());
-            }
-        } catch (TooLongMailboxNameException e) {
-            builder.notCreated(mailboxCreationId, SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description("The mailbox name length is too long")
-                .build());
-        } catch (MailboxNotOwnedException e) {
-            builder.notCreated(mailboxCreationId, SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description("The mailbox can not be created with a parent mailbox belonging to another user")
-                .build());
-        } catch (MailboxNameException | MailboxParentNotFoundException e) {
-            builder.notCreated(mailboxCreationId, SetError.builder()
-                    .type(SetError.Type.INVALID_ARGUMENTS)
-                    .description(e.getMessage())
-                    .build());
-        } catch (InboxAlreadyCreated e) {
-            String message = String.format("The mailbox '%s' already exists as 'INBOX'", e.getMailboxName());
-            LOGGER.error(message, e);
-            builder.notCreated(mailboxCreationId, SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description(message)
-                .build());
-        } catch (MailboxExistsException e) {
-            String message = String.format("The mailbox '%s' already exists.", mailboxCreationId.getCreationId());
-            builder.notCreated(mailboxCreationId, SetError.builder()
-                    .type(SetError.Type.INVALID_ARGUMENTS)
-                    .description(message)
-                    .build());
-        } catch (MailboxException e) {
-            String message = String.format("An error occurred when creating the mailbox '%s'", mailboxCreationId.getCreationId());
-            LOGGER.error(message, e);
-            builder.notCreated(mailboxCreationId, SetError.builder()
-                .type(SetError.Type.ERROR)
-                .description(message)
-                .build());
-        }
-    }
-
-    private void ensureValidMailboxName(MailboxCreateRequest mailboxRequest, MailboxSession mailboxSession) throws MailboxNameException {
-        String name = mailboxRequest.getName();
-        char pathDelimiter = mailboxSession.getPathDelimiter();
-        if (name.contains(String.valueOf(pathDelimiter))) {
-            throw new MailboxNameException(String.format("The mailbox '%s' contains an illegal character: '%c'", name, pathDelimiter));
-        }
-    }
-
-    private MailboxPath computeMailboxPath(MailboxCreateRequest mailboxRequest, Map<MailboxCreationId, MailboxId> creationIdsToCreatedMailboxId, MailboxSession mailboxSession) throws MailboxException {
-        if (mailboxRequest.getParentId().isPresent()) {
-            MailboxCreationId parentId = mailboxRequest.getParentId().get();
-            MailboxPath parentPath = getMailboxPath(creationIdsToCreatedMailboxId, mailboxSession, parentId);
-
-            assertBelongsToUser(parentPath, mailboxSession);
-
-            return MailboxPath.forUser(mailboxSession.getUser(),
-                parentPath.getName() + mailboxSession.getPathDelimiter() + mailboxRequest.getName());
-        }
-        return MailboxPath.forUser(mailboxSession.getUser(), mailboxRequest.getName());
-    }
-
-    private void assertBelongsToUser(MailboxPath mailboxPath, MailboxSession mailboxSession) throws MailboxNotOwnedException {
-        if (!mailboxPath.belongsTo(mailboxSession)) {
-            throw new MailboxNotOwnedException();
-        }
-    }
-
-    private MailboxPath getMailboxPath(Map<MailboxCreationId, MailboxId> creationIdsToCreatedMailboxId, MailboxSession mailboxSession, MailboxCreationId parentId) throws MailboxException {
-        Optional<MailboxId> mailboxId = readCreationIdAsMailboxId(parentId)
-            .or(() -> Optional.ofNullable(creationIdsToCreatedMailboxId.get(parentId)));
-
-        return getMailboxPathFromId(mailboxId, mailboxSession)
-                .orElseThrow(() -> new MailboxParentNotFoundException(parentId));
-    }
-
-    private Optional<MailboxId> readCreationIdAsMailboxId(MailboxCreationId creationId) {
-        try {
-            return Optional.of(mailboxIdFactory.fromString(creationId.getCreationId()));
-        } catch (Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    @VisibleForTesting
-    Optional<MailboxPath> getMailboxPathFromId(Optional<MailboxId> mailboxId, MailboxSession mailboxSession) {
-        FunctionChainer<MailboxId, Optional<MailboxPath>> fromMailboxIdToMailboxPath = Throwing.function(id -> {
-            try {
-                return Optional.of(mailboxManager.getMailbox(id, mailboxSession).getMailboxPath());
-            } catch (MailboxNotFoundException e) {
-                return Optional.empty();
-            }
-        });
-        return mailboxId
-            .flatMap(fromMailboxIdToMailboxPath.sneakyThrow());
-    }
-
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesDestructionProcessor.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesDestructionProcessor.java
deleted file mode 100644
index 1cadec1dbf..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesDestructionProcessor.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.jmap.methods.Method.JMAP_PREFIX;
-
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.exceptions.MailboxHasChildException;
-import org.apache.james.jmap.draft.exceptions.SystemMailboxNotUpdatableException;
-import org.apache.james.jmap.draft.model.MailboxFactory;
-import org.apache.james.jmap.draft.model.SetError;
-import org.apache.james.jmap.draft.model.SetMailboxesRequest;
-import org.apache.james.jmap.draft.model.SetMailboxesResponse;
-import org.apache.james.jmap.draft.model.SetMailboxesResponse.Builder;
-import org.apache.james.jmap.draft.model.mailbox.Mailbox;
-import org.apache.james.jmap.draft.utils.MailboxUtils;
-import org.apache.james.jmap.draft.utils.SortingHierarchicalCollections;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.Role;
-import org.apache.james.mailbox.SubscriptionManager;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.exception.TooLongMailboxNameException;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.metrics.api.TimeMetric;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ImmutableMap;
-
-public class SetMailboxesDestructionProcessor implements SetMailboxesProcessor {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(SetMailboxesDestructionProcessor.class);
-
-    private final MailboxManager mailboxManager;
-    private final SubscriptionManager subscriptionManager;
-    private final SortingHierarchicalCollections<Map.Entry<MailboxId, Mailbox>, MailboxId> sortingHierarchicalCollections;
-    private final MailboxUtils mailboxUtils;
-    private final MailboxFactory mailboxFactory;
-    private final MetricFactory metricFactory;
-
-    @Inject
-    @VisibleForTesting
-    SetMailboxesDestructionProcessor(MailboxManager mailboxManager, SubscriptionManager subscriptionManager, MailboxUtils mailboxUtils, MailboxFactory mailboxFactory, MetricFactory metricFactory) {
-        this.mailboxManager = mailboxManager;
-        this.subscriptionManager = subscriptionManager;
-        this.metricFactory = metricFactory;
-        this.sortingHierarchicalCollections =
-            new SortingHierarchicalCollections<>(
-                    Entry::getKey,
-                    x -> x.getValue().getParentId());
-        this.mailboxUtils = mailboxUtils;
-        this.mailboxFactory = mailboxFactory;
-    }
-
-    @Override
-    public SetMailboxesResponse process(SetMailboxesRequest request, MailboxSession mailboxSession) {
-        TimeMetric timeMetric = metricFactory.timer(JMAP_PREFIX + "SetMailboxesDestructionProcessor");
-        ImmutableMap<MailboxId, Mailbox> idToMailbox = mapDestroyRequests(request, mailboxSession);
-
-        SetMailboxesResponse.Builder builder = SetMailboxesResponse.builder();
-        sortingHierarchicalCollections.sortFromLeafToRoot(idToMailbox.entrySet())
-            .forEach(entry -> destroyMailbox(entry, mailboxSession, builder));
-
-        notDestroyedRequests(request, idToMailbox, builder);
-        timeMetric.stopAndPublish();
-        return builder.build();
-    }
-
-    private ImmutableMap<MailboxId, Mailbox> mapDestroyRequests(SetMailboxesRequest request, MailboxSession mailboxSession) {
-        ImmutableMap.Builder<MailboxId, Mailbox> idToMailboxBuilder = ImmutableMap.builder(); 
-        request.getDestroy().stream()
-            .map(id -> mailboxFactory.builder()
-                    .id(id)
-                    .session(mailboxSession)
-                    .build()
-                    .blockOptional())
-            .flatMap(Optional::stream)
-            .forEach(mailbox -> idToMailboxBuilder.put(mailbox.getId(), mailbox));
-        return idToMailboxBuilder.build();
-    }
-
-    private void notDestroyedRequests(SetMailboxesRequest request, ImmutableMap<MailboxId, Mailbox> idToMailbox, SetMailboxesResponse.Builder builder) {
-        request.getDestroy().stream()
-            .filter(id -> !idToMailbox.containsKey(id))
-            .forEach(id -> notDestroy(id, builder));
-    }
-
-    private void destroyMailbox(Entry<MailboxId, Mailbox> entry, MailboxSession mailboxSession, SetMailboxesResponse.Builder builder) {
-        try {
-            Mailbox mailbox = entry.getValue();
-            preconditions(mailbox, mailboxSession);
-
-            MailboxPath deletedMailbox = mailboxManager.deleteMailbox(mailbox.getId(), mailboxSession).generateAssociatedPath();
-            subscriptionManager.unsubscribe(mailboxSession, deletedMailbox);
-            builder.destroyed(entry.getKey());
-        } catch (MailboxHasChildException e) {
-            builder.notDestroyed(entry.getKey(), SetError.builder()
-                    .type(SetError.Type.MAILBOX_HAS_CHILD)
-                    .description(String.format("The mailbox '%s' has a child.", entry.getKey().serialize()))
-                    .build());
-        } catch (SystemMailboxNotUpdatableException e) {
-            builder.notDestroyed(entry.getKey(), SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description(String.format("The mailbox '%s' is a system mailbox.", entry.getKey().serialize()))
-                .build());
-        } catch (TooLongMailboxNameException e) {
-            builder.notDestroyed(entry.getKey(), SetError.builder()
-                .type(SetError.Type.INVALID_ARGUMENTS)
-                .description("The mailbox name length is too long")
-                .build());
-        } catch (MailboxException e) {
-            String message = String.format("An error occurred when deleting the mailbox '%s'", entry.getKey().serialize());
-            LOGGER.error(message, e);
-            builder.notDestroyed(entry.getKey(), SetError.builder()
-                    .type(SetError.Type.ERROR)
-                    .description(message)
-                    .build());
-        }
-    }
-
-    private void preconditions(Mailbox mailbox, MailboxSession mailboxSession) throws MailboxHasChildException, SystemMailboxNotUpdatableException, MailboxException {
-        checkForChild(mailbox.getId(), mailboxSession);
-        checkRole(mailbox.getRole());
-    }
-
-    private void checkForChild(MailboxId id, MailboxSession mailboxSession) throws MailboxHasChildException, MailboxException {
-        if (mailboxUtils.hasChildren(id, mailboxSession)) {
-            throw new MailboxHasChildException();
-        }
-    }
-
-    private void checkRole(Optional<Role> role) throws SystemMailboxNotUpdatableException {
-        if (role.map(Role::isSystemRole).orElse(false)) {
-            throw new SystemMailboxNotUpdatableException();
-        }
-    }
-
-    private void notDestroy(MailboxId id, Builder builder) {
-        builder.notDestroyed(id, SetError.builder()
-                .type(SetError.Type.NOT_FOUND)
-                .description(String.format("The mailbox '%s' was not found.", id.serialize()))
-                .build());
-    }
-}
diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesMethod.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesMethod.java
deleted file mode 100644
index f725fa41c1..0000000000
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/methods/SetMailboxesMethod.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.draft.methods;
-
-import static org.apache.james.util.MDCBuilder.ACTION;
-import static org.apache.james.util.ReactorUtils.context;
-
-import java.util.Set;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.draft.model.SetMailboxesRequest;
-import org.apache.james.jmap.draft.model.SetMailboxesResponse;
-import org.apache.james.jmap.methods.JmapRequest;
-import org.apache.james.jmap.methods.JmapResponse;
-import org.apache.james.jmap.methods.Method;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.metrics.api.MetricFactory;
-import org.apache.james.util.MDCBuilder;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class SetMailboxesMethod implements Method {
-
-    private static final Request.Name METHOD_NAME = Request.name("setMailboxes");
-    @VisibleForTesting static final Response.Name RESPONSE_NAME = Response.name("mailboxesSet");
-
-    private final Set<SetMailboxesProcessor> processors;
-    private final MetricFactory metricFactory;
-
-    @Inject
-    public SetMailboxesMethod(Set<SetMailboxesProcessor> processors, MetricFactory metricFactory) {
-        this.processors = processors;
-        this.metricFactory = metricFactory;
-    }
-
-    @Override
-    public Request.Name requestHandled() {
-        return METHOD_NAME;
-    }
-
-    @Override
-    public Class<? extends JmapRequest> requestType() {
-        return SetMailboxesRequest.class;
-    }
-
-    @Override
-    public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        Preconditions.checkNotNull(request);
-        Preconditions.checkNotNull(methodCallId);
-        Preconditions.checkNotNull(mailboxSession);
-        Preconditions.checkArgument(request instanceof SetMailboxesRequest);
-
-        SetMailboxesRequest setMailboxesRequest = (SetMailboxesRequest) request;
-
-        return Flux.from(metricFactory.decoratePublisherWithTimerMetric(JMAP_PREFIX + METHOD_NAME.getName(),
-            setMailboxesResponse(setMailboxesRequest, mailboxSession)
-                .map(response -> JmapResponse.builder().methodCallId(methodCallId)
-                    .response(response)
-                    .responseName(RESPONSE_NAME)
-                    .build())))
-            .contextWrite(context(ACTION, mdc(setMailboxesRequest)));
-    }
-
-    private MDCBuilder mdc(SetMailboxesRequest setMailboxesRequest) {
-        return MDCBuilder.create()
-            .addToContext(MDCBuilder.ACTION, "SET_MAILBOXES")
... 26570 lines suppressed ...


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


(james-project) 06/10: JAMES-4025 Drop AccessToken authentication strategy and related classes

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

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

commit 99ea88c1cca03fb5aacb9751a1ac97f77d10acca
Author: vttran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Drop AccessToken authentication strategy and related classes
---
 .../james/modules/data/CassandraJmapModule.java    |   7 -
 .../james/modules/data/MemoryDataJmapModule.java   |   5 -
 .../james/jmap/JMAPWithoutDraftCommonModule.java   |   6 -
 .../cassandra/access/CassandraAccessModule.java    |  39 ----
 .../cassandra/access/CassandraAccessTokenDAO.java  |  95 ---------
 .../access/CassandraAccessTokenRepository.java     |  64 ------
 .../access/table/CassandraAccessTokenTable.java    |  31 ---
 .../access/CassandraAccessTokenRepositoryTest.java |  46 -----
 .../apache/james/jmap/api/access/AccessToken.java  |  65 -------
 .../jmap/api/access/AccessTokenRepository.java     |  37 ----
 .../api/access/exceptions/InvalidAccessToken.java  |  29 ---
 .../exceptions/NotAnAccessTokenException.java      |  27 ---
 .../memory/access/MemoryAccessTokenRepository.java |  74 -------
 .../api/access/AccessTokenRepositoryContract.java  |  85 --------
 .../james/jmap/api/access/AccessTokenTest.java     |  43 -----
 .../access/MemoryAccessTokenRepositoryTest.java    |  38 ----
 .../java/org/apache/james/jmap/AccessToken.java    |  40 ----
 .../apache/james/jmap/HttpJmapAuthentication.java  |  76 --------
 .../org/apache/james/jmap/JmapCommonRequests.java  | 214 ---------------------
 19 files changed, 1021 deletions(-)

diff --git a/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java b/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
index c651368c4f..cebbbb50e2 100644
--- a/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
+++ b/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
@@ -28,7 +28,6 @@ import org.apache.james.eventsourcing.Event;
 import org.apache.james.eventsourcing.eventstore.EventStore;
 import org.apache.james.eventsourcing.eventstore.dto.EventDTO;
 import org.apache.james.eventsourcing.eventstore.dto.EventDTOModule;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
 import org.apache.james.jmap.api.filtering.FilteringManagement;
 import org.apache.james.jmap.api.filtering.FilteringRuleSetDefineDTOModules;
 import org.apache.james.jmap.api.filtering.FiltersDeleteUserDataTaskStep;
@@ -43,8 +42,6 @@ import org.apache.james.jmap.api.pushsubscription.PushDeleteUserDataTaskStep;
 import org.apache.james.jmap.api.pushsubscription.PushSubscriptionRepository;
 import org.apache.james.jmap.api.upload.UploadRepository;
 import org.apache.james.jmap.api.upload.UploadUsageRepository;
-import org.apache.james.jmap.cassandra.access.CassandraAccessModule;
-import org.apache.james.jmap.cassandra.access.CassandraAccessTokenRepository;
 import org.apache.james.jmap.cassandra.change.CassandraEmailChangeModule;
 import org.apache.james.jmap.cassandra.change.CassandraMailboxChangeModule;
 import org.apache.james.jmap.cassandra.filtering.CassandraFilteringProjection;
@@ -75,9 +72,6 @@ import com.google.inject.multibindings.Multibinder;
 public class CassandraJmapModule extends AbstractModule {
     @Override
     protected void configure() {
-        bind(CassandraAccessTokenRepository.class).in(Scopes.SINGLETON);
-        bind(AccessTokenRepository.class).to(CassandraAccessTokenRepository.class);
-
         bind(CassandraUploadRepository.class).in(Scopes.SINGLETON);
         bind(UploadDAO.class).in(Scopes.SINGLETON);
         bind(UploadRepository.class).to(CassandraUploadRepository.class);
@@ -103,7 +97,6 @@ public class CassandraJmapModule extends AbstractModule {
         bind(EmailQueryView.class).to(CassandraEmailQueryView.class);
 
         Multibinder<CassandraModule> cassandraDataDefinitions = Multibinder.newSetBinder(binder(), CassandraModule.class);
-        cassandraDataDefinitions.addBinding().toInstance(CassandraAccessModule.MODULE);
         cassandraDataDefinitions.addBinding().toInstance(CassandraMessageFastViewProjectionModule.MODULE);
         cassandraDataDefinitions.addBinding().toInstance(CassandraEmailQueryViewModule.MODULE);
         cassandraDataDefinitions.addBinding().toInstance(CassandraMailboxChangeModule.MODULE);
diff --git a/server/container/guice/memory/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java b/server/container/guice/memory/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
index 09a866669e..cea7c2d0d6 100644
--- a/server/container/guice/memory/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
+++ b/server/container/guice/memory/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
@@ -20,7 +20,6 @@
 package org.apache.james.modules.data;
 
 import org.apache.james.core.healthcheck.HealthCheck;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
 import org.apache.james.jmap.api.filtering.FilteringManagement;
 import org.apache.james.jmap.api.filtering.FiltersDeleteUserDataTaskStep;
 import org.apache.james.jmap.api.filtering.impl.EventSourcingFilteringManagement;
@@ -32,7 +31,6 @@ import org.apache.james.jmap.api.projections.MessageFastViewProjection;
 import org.apache.james.jmap.api.projections.MessageFastViewProjectionHealthCheck;
 import org.apache.james.jmap.api.pushsubscription.PushDeleteUserDataTaskStep;
 import org.apache.james.jmap.api.upload.UploadRepository;
-import org.apache.james.jmap.memory.access.MemoryAccessTokenRepository;
 import org.apache.james.jmap.memory.identity.MemoryCustomIdentityDAO;
 import org.apache.james.jmap.memory.projections.MemoryEmailQueryView;
 import org.apache.james.jmap.memory.projections.MemoryMessageFastViewProjection;
@@ -51,9 +49,6 @@ public class MemoryDataJmapModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        bind(MemoryAccessTokenRepository.class).in(Scopes.SINGLETON);
-        bind(AccessTokenRepository.class).to(MemoryAccessTokenRepository.class);
-
         bind(InMemoryUploadRepository.class).in(Scopes.SINGLETON);
         bind(UploadRepository.class).to(InMemoryUploadRepository.class);
 
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
index 3e645f75b5..d2746a8f09 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
@@ -19,9 +19,6 @@
 
 package org.apache.james.jmap;
 
-import java.util.concurrent.TimeUnit;
-
-import org.apache.james.jmap.api.access.AccessTokenRepository;
 import org.apache.james.jmap.json.ObjectMapperFactory;
 import org.apache.james.jmap.methods.BlobManager;
 import org.apache.james.jmap.methods.BlobManagerImpl;
@@ -37,10 +34,8 @@ import org.apache.james.util.mime.MessageContentExtractor;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Scopes;
-import com.google.inject.name.Names;
 
 public class JMAPWithoutDraftCommonModule extends AbstractModule {
-    private static final long DEFAULT_TOKEN_EXPIRATION_IN_MS = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES);
 
     @Override
     protected void configure() {
@@ -59,6 +54,5 @@ public class JMAPWithoutDraftCommonModule extends AbstractModule {
         bind(JmapResponseWriterImpl.class).in(Scopes.SINGLETON);
         bind(JmapResponseWriter.class).to(JmapResponseWriterImpl.class);
 
-        bindConstant().annotatedWith(Names.named(AccessTokenRepository.TOKEN_EXPIRATION_IN_MS)).to(DEFAULT_TOKEN_EXPIRATION_IN_MS);
     }
 }
diff --git a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessModule.java b/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessModule.java
deleted file mode 100644
index f0109da014..0000000000
--- a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessModule.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.cassandra.access;
-
-import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.RowsPerPartition.rows;
-
-import org.apache.james.backends.cassandra.components.CassandraModule;
-import org.apache.james.backends.cassandra.utils.CassandraConstants;
-import org.apache.james.jmap.cassandra.access.table.CassandraAccessTokenTable;
-
-import com.datastax.oss.driver.api.core.type.DataTypes;
-
-public interface CassandraAccessModule {
-    CassandraModule MODULE = CassandraModule.table(CassandraAccessTokenTable.TABLE_NAME)
-        .comment("Holds JMAP access token required to process to authentication.")
-        .options(options -> options
-            .withCaching(true, rows(CassandraConstants.DEFAULT_CACHED_ROW_PER_PARTITION)))
-        .statement(statement -> types -> statement
-            .withPartitionKey(CassandraAccessTokenTable.TOKEN, DataTypes.UUID)
-            .withColumn(CassandraAccessTokenTable.USERNAME, DataTypes.TEXT))
-        .build();
-}
diff --git a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenDAO.java b/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenDAO.java
deleted file mode 100644
index 1f31aa491b..0000000000
--- a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenDAO.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.cassandra.access;
-
-import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.bindMarker;
-import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.deleteFrom;
-import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.insertInto;
-import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom;
-import static org.apache.james.jmap.api.access.AccessTokenRepository.TOKEN_EXPIRATION_IN_MS;
-
-import java.util.concurrent.TimeUnit;
-
-import jakarta.inject.Inject;
-import jakarta.inject.Named;
-
-import org.apache.james.backends.cassandra.utils.CassandraAsyncExecutor;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.AccessToken;
-import org.apache.james.jmap.cassandra.access.table.CassandraAccessTokenTable;
-
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.cql.PreparedStatement;
-import com.datastax.oss.driver.api.core.type.codec.TypeCodecs;
-import com.google.common.primitives.Ints;
-
-import reactor.core.publisher.Mono;
-
-public class CassandraAccessTokenDAO {
-
-    private static final String TTL = "ttl";
-
-    private final CassandraAsyncExecutor cassandraAsyncExecutor;
-    private final PreparedStatement removeStatement;
-    private final PreparedStatement insertStatement;
-    private final PreparedStatement selectStatement;
-    private final int durationInSeconds;
-
-    @Inject
-    public CassandraAccessTokenDAO(CqlSession session, @Named(TOKEN_EXPIRATION_IN_MS) long durationInMilliseconds) {
-        this.cassandraAsyncExecutor = new CassandraAsyncExecutor(session);
-        this.durationInSeconds = Ints.checkedCast(TimeUnit.MILLISECONDS.toSeconds(durationInMilliseconds));
-
-        this.removeStatement = session.prepare(deleteFrom(CassandraAccessTokenTable.TABLE_NAME)
-            .whereColumn(CassandraAccessTokenTable.TOKEN).isEqualTo(bindMarker(CassandraAccessTokenTable.TOKEN))
-            .build());
-
-        this.insertStatement = session.prepare(insertInto(CassandraAccessTokenTable.TABLE_NAME)
-            .value(CassandraAccessTokenTable.TOKEN, bindMarker(CassandraAccessTokenTable.TOKEN))
-            .value(CassandraAccessTokenTable.USERNAME, bindMarker(CassandraAccessTokenTable.USERNAME))
-            .usingTtl(bindMarker(TTL))
-            .build());
-
-        this.selectStatement = session.prepare(selectFrom(CassandraAccessTokenTable.TABLE_NAME)
-            .column(CassandraAccessTokenTable.USERNAME)
-            .whereColumn(CassandraAccessTokenTable.TOKEN)
-            .isEqualTo(bindMarker(CassandraAccessTokenTable.TOKEN))
-            .build());
-    }
-
-    public Mono<Void> addToken(Username username, AccessToken accessToken) {
-        return cassandraAsyncExecutor.executeVoid(insertStatement.bind()
-            .setUuid(CassandraAccessTokenTable.TOKEN, accessToken.asUUID())
-            .setString(CassandraAccessTokenTable.USERNAME, username.asString())
-            .setInt(TTL, durationInSeconds));
-    }
-
-    public Mono<Void> removeToken(AccessToken accessToken) {
-        return cassandraAsyncExecutor.executeVoid(removeStatement.bind()
-            .setUuid(CassandraAccessTokenTable.TOKEN, accessToken.asUUID()));
-    }
-
-    public Mono<Username> getUsernameFromToken(AccessToken accessToken) {
-        return cassandraAsyncExecutor.executeSingleRow(selectStatement.bind()
-                .set(CassandraAccessTokenTable.TOKEN, accessToken.asUUID(), TypeCodecs.UUID))
-            .map(row -> row.get(0, TypeCodecs.TEXT))
-            .map(Username::of);
-    }
-}
diff --git a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepository.java b/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepository.java
deleted file mode 100644
index 0f108867db..0000000000
--- a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepository.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.cassandra.access;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.AccessToken;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.api.access.exceptions.InvalidAccessToken;
-
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Mono;
-
-public class CassandraAccessTokenRepository implements AccessTokenRepository {
-
-    private final CassandraAccessTokenDAO cassandraAccessTokenDAO;
-
-    @Inject
-    CassandraAccessTokenRepository(CassandraAccessTokenDAO cassandraAccessTokenDAO) {
-        this.cassandraAccessTokenDAO = cassandraAccessTokenDAO;
-    }
-
-    @Override
-    public Mono<Void> addToken(Username username, AccessToken accessToken) {
-        Preconditions.checkNotNull(username);
-        Preconditions.checkNotNull(accessToken);
-
-        return cassandraAccessTokenDAO.addToken(username, accessToken);
-    }
-
-    @Override
-    public Mono<Void> removeToken(AccessToken accessToken) {
-        Preconditions.checkNotNull(accessToken);
-
-        return cassandraAccessTokenDAO.removeToken(accessToken);
-    }
-
-    @Override
-    public Mono<Username> getUsernameFromToken(AccessToken accessToken) throws InvalidAccessToken {
-        Preconditions.checkNotNull(accessToken);
-
-        return cassandraAccessTokenDAO.getUsernameFromToken(accessToken)
-            .switchIfEmpty(Mono.error(() -> new InvalidAccessToken(accessToken)));
-    }
-}
diff --git a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/table/CassandraAccessTokenTable.java b/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/table/CassandraAccessTokenTable.java
deleted file mode 100644
index 026f80eb99..0000000000
--- a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/access/table/CassandraAccessTokenTable.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.cassandra.access.table;
-
-import com.datastax.oss.driver.api.core.CqlIdentifier;
-
-public interface CassandraAccessTokenTable {
-
-    String TABLE_NAME = "access_token";
-
-    CqlIdentifier TOKEN = CqlIdentifier.fromCql("access_token");
-    CqlIdentifier USERNAME = CqlIdentifier.fromCql("username");
-
-}
diff --git a/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepositoryTest.java b/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepositoryTest.java
deleted file mode 100644
index 66640e9697..0000000000
--- a/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/access/CassandraAccessTokenRepositoryTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.cassandra.access;
-
-import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.CassandraClusterExtension;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.api.access.AccessTokenRepositoryContract;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-class CassandraAccessTokenRepositoryTest implements AccessTokenRepositoryContract {
-    @RegisterExtension
-    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraAccessModule.MODULE);
-
-    AccessTokenRepository accessTokenRepository;
-
-    @BeforeEach
-    void setUp(CassandraCluster cassandra) {
-        accessTokenRepository = new CassandraAccessTokenRepository(
-            new CassandraAccessTokenDAO(cassandra.getConf(), AccessTokenRepositoryContract.TTL_IN_MS));
-    }
-
-    @Override
-    public AccessTokenRepository accessTokenRepository() {
-        return accessTokenRepository;
-    }
-
-}
diff --git a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessToken.java b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessToken.java
deleted file mode 100644
index aeb699bb7e..0000000000
--- a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessToken.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.api.access;
-
-import java.util.Objects;
-import java.util.UUID;
-
-import org.apache.james.jmap.api.access.exceptions.NotAnAccessTokenException;
-
-public class AccessToken {
-
-    public static AccessToken fromString(String tokenString) throws NotAnAccessTokenException {
-        try {
-            return new AccessToken(UUID.fromString(tokenString));
-        } catch (IllegalArgumentException e) {
-            throw new NotAnAccessTokenException(e);
-        }
-    }
-
-    private final UUID token;
-
-    private AccessToken(UUID token) {
-        this.token = token;
-    }
-    
-    public static AccessToken generate() {
-        return new AccessToken(UUID.randomUUID());
-    }
-
-    public String serialize() {
-        return token.toString();
-    }
-
-    public UUID asUUID() {
-        return token;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        return o instanceof AccessToken
-            && Objects.equals(this.token, ((AccessToken)o).token);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(token);
-    }
-}
diff --git a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessTokenRepository.java b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessTokenRepository.java
deleted file mode 100644
index 3682a73082..0000000000
--- a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/AccessTokenRepository.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.api.access;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.exceptions.InvalidAccessToken;
-
-import reactor.core.publisher.Mono;
-
-public interface AccessTokenRepository {
-
-    String TOKEN_EXPIRATION_IN_MS = "tokenExpirationInMs";
-    
-    Mono<Void> addToken(Username username, AccessToken accessToken);
-
-    Mono<Void> removeToken(AccessToken accessToken);
-
-    Mono<Username> getUsernameFromToken(AccessToken accessToken) throws InvalidAccessToken;
-
-}
diff --git a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/InvalidAccessToken.java b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/InvalidAccessToken.java
deleted file mode 100644
index c5ee869161..0000000000
--- a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/InvalidAccessToken.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.api.access.exceptions;
-
-import org.apache.james.jmap.api.access.AccessToken;
-
-public class InvalidAccessToken extends RuntimeException {
-
-    public InvalidAccessToken(AccessToken token) {
-        super(token.serialize() + " is missing");
-    }
-}
diff --git a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/NotAnAccessTokenException.java b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/NotAnAccessTokenException.java
deleted file mode 100644
index ca8940f0d0..0000000000
--- a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/access/exceptions/NotAnAccessTokenException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.api.access.exceptions;
-
-public class NotAnAccessTokenException extends RuntimeException {
-
-    public NotAnAccessTokenException(Exception e) {
-        super(e);
-    }
-}
diff --git a/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepository.java b/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepository.java
deleted file mode 100644
index 3745d54d36..0000000000
--- a/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepository.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.memory.access;
-
-import java.util.Optional;
-
-import jakarta.inject.Inject;
-import jakarta.inject.Named;
-
-import org.apache.commons.collections4.map.PassiveExpiringMap;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.AccessToken;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.api.access.exceptions.InvalidAccessToken;
-
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Mono;
-
-public class MemoryAccessTokenRepository implements AccessTokenRepository {
-    private final PassiveExpiringMap<AccessToken, Username> tokensExpirationDates;
-
-    @Inject
-    public MemoryAccessTokenRepository(@Named(TOKEN_EXPIRATION_IN_MS) long durationInMilliseconds) {
-        tokensExpirationDates = new PassiveExpiringMap<>(durationInMilliseconds);
-    }
-
-    @Override
-    public Mono<Void> addToken(Username username, AccessToken accessToken) {
-        Preconditions.checkNotNull(username);
-        Preconditions.checkNotNull(accessToken);
-        synchronized (tokensExpirationDates) {
-            tokensExpirationDates.put(accessToken, username);
-        }
-        return Mono.empty();
-    }
-
-    @Override
-    public Mono<Void> removeToken(AccessToken accessToken) {
-        Preconditions.checkNotNull(accessToken);
-        synchronized (tokensExpirationDates) {
-            tokensExpirationDates.remove(accessToken);
-        }
-        return Mono.empty();
-    }
-
-    @Override
-    public Mono<Username> getUsernameFromToken(AccessToken accessToken) throws InvalidAccessToken {
-        Preconditions.checkNotNull(accessToken);
-        synchronized (tokensExpirationDates) {
-            return Mono.just(
-                Optional.ofNullable(tokensExpirationDates.get(accessToken))
-                    .orElseThrow(() -> new InvalidAccessToken(accessToken)));
-        }
-    }
-
-}
diff --git a/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenRepositoryContract.java b/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenRepositoryContract.java
deleted file mode 100644
index 87e11cfaac..0000000000
--- a/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenRepositoryContract.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.api.access;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.api.access.exceptions.InvalidAccessToken;
-import org.junit.jupiter.api.Test;
-
-public interface AccessTokenRepositoryContract {
-    AccessToken TOKEN = AccessToken.generate();
-    Username USERNAME = Username.of("username");
-    long TTL_IN_MS = 1000;
-
-    AccessTokenRepository accessTokenRepository();
-
-    @Test
-    default void validTokenMustBeRetrieved() {
-        accessTokenRepository().addToken(USERNAME, TOKEN).block();
-        assertThat(accessTokenRepository().getUsernameFromToken(TOKEN).block()).isEqualTo(USERNAME);
-    }
-
-    @Test
-    default void absentTokensMustBeInvalid() {
-        assertThatThrownBy(() -> accessTokenRepository().getUsernameFromToken(TOKEN).block()).isExactlyInstanceOf(InvalidAccessToken.class);
-    }
-
-    @Test
-    default void removedTokensMustBeInvalid() {
-        accessTokenRepository().addToken(USERNAME, TOKEN).block();
-        accessTokenRepository().removeToken(TOKEN).block();
-        assertThatThrownBy(() -> accessTokenRepository().getUsernameFromToken(TOKEN).block()).isExactlyInstanceOf(InvalidAccessToken.class);
-    }
-
-    @Test
-    default void outDatedTokenMustBeInvalid() throws Exception {
-        accessTokenRepository().addToken(USERNAME, TOKEN).block();
-        Thread.sleep(2 * TTL_IN_MS);
-        assertThatThrownBy(() -> accessTokenRepository().getUsernameFromToken(TOKEN).block()).isExactlyInstanceOf(InvalidAccessToken.class);
-    }
-
-    @Test
-    default void addTokenMustThrowWhenUsernameIsNull() {
-        assertThatThrownBy(() -> accessTokenRepository().addToken(null, TOKEN))
-            .isInstanceOf(NullPointerException.class);
-    }
-
-    @Test
-    default void addTokenMustThrowWhenTokenIsNull() {
-        assertThatThrownBy(() -> accessTokenRepository().addToken(USERNAME, null))
-            .isInstanceOf(NullPointerException.class);
-    }
-
-    @Test
-    default void removeTokenTokenMustThrowWhenTokenIsNull() {
-        assertThatThrownBy(() -> accessTokenRepository().removeToken(null))
-            .isInstanceOf(NullPointerException.class);
-    }
-
-    @Test
-    default void getUsernameFromTokenMustThrowWhenTokenIsNull() {
-        assertThatThrownBy(() -> accessTokenRepository().getUsernameFromToken(null))
-            .isInstanceOf(NullPointerException.class);
-    }
-
-}
diff --git a/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenTest.java b/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenTest.java
deleted file mode 100644
index 9693af9519..0000000000
--- a/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/access/AccessTokenTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.api.access;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import org.apache.james.jmap.api.access.exceptions.NotAnAccessTokenException;
-import org.junit.jupiter.api.Test;
-
-class AccessTokenTest {
-
-    @Test
-    void fromStringShouldThrowWhenNotAnUUID() {
-        assertThatThrownBy(() -> AccessToken.fromString("bad"))
-            .isInstanceOf(NotAnAccessTokenException.class);
-    }
-
-    @Test
-    void fromStringShouldWork() throws NotAnAccessTokenException {
-        String expectedToken = "dab315ad-a59a-4107-8d00-0fef9a0745b8";
-
-        AccessToken accessToken = AccessToken.fromString(expectedToken);
-        assertThat(accessToken.serialize()).isEqualTo(expectedToken);
-    }
-}
diff --git a/server/data/data-jmap/src/test/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepositoryTest.java b/server/data/data-jmap/src/test/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepositoryTest.java
deleted file mode 100644
index 4c868f12bb..0000000000
--- a/server/data/data-jmap/src/test/java/org/apache/james/jmap/memory/access/MemoryAccessTokenRepositoryTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.memory.access;
-
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.api.access.AccessTokenRepositoryContract;
-import org.junit.jupiter.api.BeforeEach;
-
-class MemoryAccessTokenRepositoryTest implements AccessTokenRepositoryContract {
-    AccessTokenRepository accessTokenRepository;
-
-    @BeforeEach
-    void setUp() {
-        accessTokenRepository = new MemoryAccessTokenRepository(AccessTokenRepositoryContract.TTL_IN_MS);
-    }
-    
-    @Override
-    public AccessTokenRepository accessTokenRepository() {
-        return accessTokenRepository;
-    }
-}
diff --git a/server/testing/src/main/java/org/apache/james/jmap/AccessToken.java b/server/testing/src/main/java/org/apache/james/jmap/AccessToken.java
deleted file mode 100644
index 0e9969db0e..0000000000
--- a/server/testing/src/main/java/org/apache/james/jmap/AccessToken.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import com.google.common.annotations.VisibleForTesting;
-
-@VisibleForTesting
-public class AccessToken {
-
-    public static AccessToken of(String tokenString) {
-        return new AccessToken(tokenString);
-    }
-
-    private final String token;
-
-    private AccessToken(String token) {
-        this.token = token;
-    }
-
-    public String asString() {
-        return token;
-    }
-}
diff --git a/server/testing/src/main/java/org/apache/james/jmap/HttpJmapAuthentication.java b/server/testing/src/main/java/org/apache/james/jmap/HttpJmapAuthentication.java
deleted file mode 100644
index 00fbc34b41..0000000000
--- a/server/testing/src/main/java/org/apache/james/jmap/HttpJmapAuthentication.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.time.Duration;
-
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.fluent.Request;
-import org.apache.http.client.fluent.Response;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.entity.ContentType;
-import org.apache.james.core.Username;
-import org.hamcrest.core.IsAnything;
-
-import com.jayway.jsonpath.JsonPath;
-
-public class HttpJmapAuthentication {
-
-    public static AccessToken authenticateJamesUser(URIBuilder uriBuilder, Username username, String password) {
-        return calmlyAwait
-            .atMost(Duration.ofMinutes(2))
-            .until(
-            () -> doAuthenticate(uriBuilder, username, password), IsAnything.anything());
-    }
-
-    public static AccessToken doAuthenticate(URIBuilder uriBuilder, Username username, String password) throws ClientProtocolException, IOException, URISyntaxException {
-        String continuationToken = getContinuationToken(uriBuilder, username);
-
-        Response response = postAuthenticate(uriBuilder, password, continuationToken);
-
-        return AccessToken.of(
-            JsonPath.parse(response.returnContent().asString())
-                .read("accessToken"));
-    }
-
-    private static Response postAuthenticate(URIBuilder uriBuilder, String password, String continuationToken) throws ClientProtocolException, IOException, URISyntaxException {
-        return Request.Post(uriBuilder.setPath("/authentication").build())
-                .bodyString("{\"token\": \"" + continuationToken + "\", \"method\": \"password\", \"password\": \"" + password + "\"}", 
-                        ContentType.APPLICATION_JSON)
-                .setHeader("Accept", ContentType.APPLICATION_JSON.getMimeType())
-                .execute();
-    }
-
-    private static String getContinuationToken(URIBuilder uriBuilder, Username username) throws ClientProtocolException, IOException, URISyntaxException {
-        Response response = Request.Post(uriBuilder.setPath("/authentication").build())
-            .bodyString("{\"username\": \"" + username.asString() + "\", \"clientName\": \"Mozilla Thunderbird\", \"clientVersion\": \"42.0\", \"deviceName\": \"Joe Blogg’s iPhone\"}",
-                ContentType.APPLICATION_JSON)
-            .setHeader("Accept", ContentType.APPLICATION_JSON.getMimeType())
-            .execute();
-
-        return JsonPath.parse(response.returnContent().asString())
-            .read("continuationToken");
-    }
-
-}
diff --git a/server/testing/src/main/java/org/apache/james/jmap/JmapCommonRequests.java b/server/testing/src/main/java/org/apache/james/jmap/JmapCommonRequests.java
deleted file mode 100644
index 981e549951..0000000000
--- a/server/testing/src/main/java/org/apache/james/jmap/JmapCommonRequests.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap;
-
-import static io.restassured.RestAssured.with;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasKey;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.text.IsEmptyString.emptyOrNullString;
-
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.apache.james.mailbox.Role;
-import org.apache.james.mailbox.model.MailboxId;
-
-import io.restassured.builder.ResponseSpecBuilder;
-import io.restassured.path.json.JsonPath;
-import io.restassured.specification.ResponseSpecification;
-
-public class JmapCommonRequests {
-    private static final String NAME = "[0][0]";
-    private static final String ARGUMENTS = "[0][1]";
-    private static final String NOT_UPDATED = ARGUMENTS + ".notUpdated";
-
-    public static String getOutboxId(AccessToken accessToken) {
-        return getMailboxId(accessToken, Role.OUTBOX);
-    }
-
-    public static String getSentId(AccessToken accessToken) {
-        return getMailboxId(accessToken, Role.SENT);
-    }
-
-    public static String getDraftId(AccessToken accessToken) {
-        return getMailboxId(accessToken, Role.DRAFTS);
-    }
-
-    public static String getMailboxId(AccessToken accessToken, Role role) {
-        return getAllMailboxesIds(accessToken).stream()
-            .filter(mailbox -> mailbox.get("role").equals(role.serialize()))
-            .map(mailbox -> mailbox.get("id"))
-            .findFirst().get();
-    }
-
-    public static List<Map<String, String>> getAllMailboxesIds(AccessToken accessToken) {
-        return with()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"properties\": [\"role\", \"name\", \"id\"]}, \"#0\"]]")
-            .post("/jmap")
-        .andReturn()
-            .body()
-            .jsonPath()
-            .getList(ARGUMENTS + ".list");
-    }
-
-    public static boolean isAnyMessageFoundInRecipientsMailboxes(AccessToken recipientToken) {
-        try {
-            with()
-                .header("Authorization", recipientToken.asString())
-                .body("[[\"getMessageList\", {}, \"#0\"]]")
-            .when()
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(NAME, equalTo("messageList"))
-                .body(ARGUMENTS + ".messageIds", hasSize(1));
-            return true;
-
-        } catch (AssertionError e) {
-            return false;
-        }
-    }
-
-    public static boolean isAnyMessageFoundInRecipientsMailbox(AccessToken recipientToken, MailboxId mailboxId) {
-        return isAnyMessageFoundInRecipientsMailbox(recipientToken, mailboxId.serialize());
-    }
-
-    public static boolean isAnyMessageFoundInRecipientsMailbox(AccessToken recipientToken, String serialize) {
-        try {
-            with()
-                .header("Authorization", recipientToken.asString())
-                .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + serialize + "\"]}}, \"#0\"]]")
-            .when()
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(NAME, equalTo("messageList"))
-                .body(ARGUMENTS + ".messageIds", hasSize(1));
-            return true;
-
-        } catch (AssertionError e) {
-            return false;
-        }
-    }
-
-    public static String getInboxId(AccessToken accessToken) {
-        return getMailboxId(accessToken, Role.INBOX);
-    }
-
-    public static List<String> listMessageIdsForAccount(AccessToken accessToken) {
-        return with()
-                .header("Authorization", accessToken.asString())
-                .body("[[\"getMessageList\", {}, \"#0\"]]")
-                .post("/jmap")
-            .then()
-                .extract()
-                .body()
-                .path(ARGUMENTS + ".messageIds");
-    }
-
-    public static String getLastMessageId(AccessToken accessToken) {
-        return with()
-                .header("Authorization", accessToken.asString())
-                .body("[[\"getMessageList\", {\"sort\":[\"date desc\"]}, \"#0\"]]")
-                .post("/jmap")
-            .then()
-                .extract()
-                .body()
-                .path(ARGUMENTS + ".messageIds[0]");
-    }
-
-    public static String getLatestMessageId(AccessToken accessToken, Role mailbox) {
-        String mailboxId = getMailboxId(accessToken, mailbox);
-        return with()
-                .header("Authorization", accessToken.asString())
-                .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + mailboxId + "\"]}, \"sort\":[\"date desc\"]}, \"#0\"]]")
-                .post("/jmap")
-            .then()
-                .extract()
-                .path(ARGUMENTS + ".messageIds[0]");
-    }
-
-    public static String bodyOfMessage(AccessToken accessToken, String messageId) {
-        return getMessageContent(accessToken, messageId)
-                .get(ARGUMENTS + ".list[0].textBody");
-    }
-
-    public static List<String> receiversOfMessage(AccessToken accessToken, String messageId) {
-        return getMessageContent(accessToken, messageId)
-                .getList(ARGUMENTS + ".list[0].to.email");
-    }
-
-    private static JsonPath getMessageContent(AccessToken accessToken, String messageId) {
-        return with()
-                .header("Authorization", accessToken.asString())
-                .body("[[\"getMessages\", {\"ids\": [\"" + messageId + "\"]}, \"#0\"]]")
-            .when()
-                .post("/jmap")
-            .then()
-                .statusCode(200)
-                .body(NAME, equalTo("messages"))
-                .body(ARGUMENTS + ".list", hasSize(1))
-            .extract()
-                .jsonPath();
-    }
-
-    public static List<String> listMessageIdsInMailbox(AccessToken accessToken, String mailboxId) {
-        return with()
-                .header("Authorization", accessToken.asString())
-                .body("[[\"getMessageList\", {\"filter\":{\"inMailboxes\":[\"" + mailboxId + "\"]}}, \"#0\"]]")
-                .post("/jmap")
-            .then()
-                .extract()
-                .body()
-                .path(ARGUMENTS + ".messageIds");
-    }
-
-    public static ResponseSpecification getSetMessagesUpdateOKResponseAssertions(String messageId) {
-        ResponseSpecBuilder builder = new ResponseSpecBuilder()
-            .expectStatusCode(200)
-            .expectBody(NAME, equalTo("messagesSet"))
-            .expectBody(ARGUMENTS + ".updated", hasSize(1))
-            .expectBody(ARGUMENTS + ".updated", contains(messageId))
-            .expectBody(ARGUMENTS + ".error", is(emptyOrNullString()))
-            .expectBody(NOT_UPDATED, not(hasKey(messageId)));
-        return builder.build();
-    }
-
-    public static void deleteMessages(AccessToken accessToken, List<String> idsToDestroy) {
-        String idString = concatMessageIds(idsToDestroy);
-
-        with()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"setMessages\", {\"destroy\": [" + idString + "]}, \"#0\"]]")
-            .post("/jmap");
-    }
-
-    public static String concatMessageIds(List<String> ids) {
-        return ids.stream()
-            .map(id -> "\"" + id + "\"")
-            .collect(Collectors.joining(","));
-    }
-}


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


(james-project) 02/10: JAMES-4025 Update JMAP server test cases after remove jmap draft

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

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

commit 732f872aba39aa566d48db881a60693f83780c2d
Author: Tung Tran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Update JMAP server test cases after remove jmap draft
---
 .../apache/james/MemoryJmapJamesServerTest.java    | 58 ----------------------
 .../james/jmap/draft/JmapJamesServerContract.java  |  8 +--
 2 files changed, 4 insertions(+), 62 deletions(-)

diff --git a/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java b/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java
index 34fc8b60af..1f905555ef 100644
--- a/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java
+++ b/server/apps/memory-app/src/test/java/org/apache/james/MemoryJmapJamesServerTest.java
@@ -20,17 +20,12 @@
 package org.apache.james;
 
 import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
-import org.apache.james.jmap.draft.JMAPConfigurationStartUpCheck;
-import org.apache.james.jmap.draft.JMAPDraftConfiguration;
 import org.apache.james.jmap.draft.JmapJamesServerContract;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.protocols.ImapGuiceProbe;
 import org.apache.james.modules.protocols.SmtpGuiceProbe;
 import org.junit.jupiter.api.Nested;
-import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 class MemoryJmapJamesServerTest {
@@ -61,57 +56,4 @@ class MemoryJmapJamesServerTest {
         @RegisterExtension
         JamesServerExtension jamesServerExtension = extensionBuilder().build();
     }
-
-    @Nested
-    class JamesServerJmapConfigurationTest {
-
-        @Nested
-        class BadAliasKeyStore {
-
-            @RegisterExtension
-            JamesServerExtension jamesServerExtension = extensionBuilder()
-                .disableAutoStart()
-                .overrideServerModule(binder -> binder.bind(JMAPDraftConfiguration.class)
-                    .toInstance(TestJMAPServerModule
-                        .jmapDraftConfigurationBuilder()
-                        .keystore("badAliasKeystore")
-                        .secret("password")
-                        .build()))
-                .build();
-
-            @Test
-            void jamesShouldNotStartWhenBadAliasKeyStore(GuiceJamesServer server) {
-                assertThatThrownBy(server::start)
-                    .isInstanceOfSatisfying(
-                        StartUpChecksPerformer.StartUpChecksException.class,
-                        ex -> assertThat(ex.badCheckNames())
-                            .containsOnly(JMAPConfigurationStartUpCheck.CHECK_NAME))
-                    .hasMessageContaining("Alias 'james' keystore can't be found");
-            }
-        }
-
-        @Nested
-        class BadSecretKeyStore {
-
-            @RegisterExtension
-            JamesServerExtension jamesServerExtension = extensionBuilder()
-                .disableAutoStart()
-                .overrideServerModule(binder -> binder.bind(JMAPDraftConfiguration.class)
-                    .toInstance(TestJMAPServerModule
-                        .jmapDraftConfigurationBuilder()
-                        .secret("WrongSecret")
-                        .build()))
-                .build();
-
-            @Test
-            void jamesShouldNotStartWhenBadSecret(GuiceJamesServer server) {
-                assertThatThrownBy(server::start)
-                    .isInstanceOfSatisfying(
-                        StartUpChecksPerformer.StartUpChecksException.class,
-                        ex -> assertThat(ex.badCheckNames())
-                            .containsOnly(JMAPConfigurationStartUpCheck.CHECK_NAME))
-                    .hasMessageContaining("Keystore was tampered with, or password was incorrect");
-            }
-        }
-    }
 }
diff --git a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java
index 064078b67a..5a9a2d0c84 100644
--- a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java
+++ b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JmapJamesServerContract.java
@@ -37,20 +37,20 @@ public interface JmapJamesServerContract {
     String JAMES_SERVER_HOST = "127.0.0.1";
 
     @Test
-    default void connectJMAPServerShouldRespondBadRequest(GuiceJamesServer server) {
+    default void connectJMAPServerShouldFailWhenUnAuthenticatedRequest(GuiceJamesServer server) {
         RestAssured.requestSpecification = requestSpec(server);
         given()
             .body("{\"badAttributeName\": \"value\"}")
         .when()
-            .post("/authentication")
+            .post("/jmap")
         .then()
-            .statusCode(400);
+            .statusCode(401);
     }
 
     static RequestSpecification requestSpec(GuiceJamesServer server) {
         return new RequestSpecBuilder()
             .setContentType(ContentType.JSON)
-            .setAccept(ContentType.JSON)
+            .setAccept("application/json; jmapVersion=rfc-8621")
             .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(StandardCharsets.UTF_8)))
             .setPort(server.getProbe(JmapGuiceProbe.class).getJmapPort().getValue())
             .build();


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


(james-project) 08/10: JAMES-4025 Drop Jmap draft - remove unused classes

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

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

commit ddf95a97db72bd1b40ddc5d98e42b14516380678
Author: vttran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Drop Jmap draft - remove unused classes
---
 .../james/jmap/JMAPWithoutDraftCommonModule.java   |  21 -
 .../james/modules/protocols/JMAPServerModule.java  |   2 -
 .../jmap/exceptions/BlobNotFoundException.java     |  41 -
 .../james/jmap/json/ObjectMapperFactory.java       | 295 -------
 .../java/org/apache/james/jmap/json/RoleMixIn.java |  28 -
 .../org/apache/james/jmap/methods/BlobManager.java |  35 -
 .../apache/james/jmap/methods/BlobManagerImpl.java | 217 -----
 .../apache/james/jmap/methods/ErrorResponse.java   |  88 --
 .../org/apache/james/jmap/methods/JmapRequest.java |  23 -
 .../apache/james/jmap/methods/JmapResponse.java    | 167 ----
 .../james/jmap/methods/JmapResponseWriter.java     |  30 -
 .../james/jmap/methods/JmapResponseWriterImpl.java | 142 ---
 .../java/org/apache/james/jmap/methods/Method.java | 135 ---
 .../org/apache/james/jmap/model/Attachment.java    | 228 -----
 .../java/org/apache/james/jmap/model/Blob.java     | 157 ----
 .../java/org/apache/james/jmap/model/BlobId.java   |  92 --
 .../java/org/apache/james/jmap/model/Emailer.java  | 198 -----
 .../james/jmap/model/InvocationResponse.java       |  57 --
 .../java/org/apache/james/jmap/model/Keyword.java  | 146 ----
 .../java/org/apache/james/jmap/model/Keywords.java | 222 -----
 .../apache/james/jmap/model/MessageProperties.java | 319 -------
 .../org/apache/james/jmap/model/MethodCallId.java  |  59 --
 .../java/org/apache/james/jmap/model/Number.java   | 104 ---
 .../org/apache/james/jmap/model/PreviewDTO.java    |  84 --
 .../java/org/apache/james/jmap/model/Property.java |  24 -
 .../apache/james/jmap/model/mailbox/Rights.java    | 264 ------
 .../jmap/model/message/view/MessageFastView.java   | 130 ---
 .../model/message/view/MessageFastViewFactory.java | 152 ----
 .../jmap/model/message/view/MessageFullView.java   | 177 ----
 .../model/message/view/MessageFullViewFactory.java | 409 ---------
 .../jmap/model/message/view/MessageHeaderView.java | 207 -----
 .../message/view/MessageHeaderViewFactory.java     |  94 --
 .../model/message/view/MessageMetadataView.java    | 170 ----
 .../message/view/MessageMetadataViewFactory.java   |  76 --
 .../james/jmap/model/message/view/MessageView.java |  26 -
 .../model/message/view/MessageViewFactory.java     | 161 ----
 .../model/message/view/MetaMessageViewFactory.java |  55 --
 .../james/jmap/model/message/view/SubMessage.java  | 233 -----
 .../apache/james/jmap/utils/KeywordsCombiner.java  |  64 --
 ...mputeMessageFastViewProjectionListenerTest.java |  18 +-
 .../james/jmap/json/ObjectMapperFactoryTest.java   | 288 -------
 .../james/jmap/methods/BlobManagerImplTest.java    | 255 ------
 .../apache/james/jmap/model/AttachmentTest.java    | 125 ---
 .../java/org/apache/james/jmap/model/BlobTest.java |  89 --
 .../org/apache/james/jmap/model/EmailerTest.java   | 173 ----
 .../org/apache/james/jmap/model/KeywordTest.java   | 207 -----
 .../org/apache/james/jmap/model/KeywordsTest.java  | 209 -----
 .../apache/james/jmap/model/MethodCallIdTest.java  |  47 -
 .../apache/james/jmap/model/PreviewDTOTest.java    |  71 --
 .../james/jmap/model/mailbox/RightsTest.java       | 331 -------
 .../james/jmap/model/message/view/BlobIdTest.java  |  51 --
 .../message/view/MessageFastViewFactoryTest.java   | 252 ------
 .../message/view/MessageFullViewFactoryTest.java   | 951 ---------------------
 .../model/message/view/MessageFullViewTest.java    | 468 ----------
 .../message/view/MessageHeaderViewFactoryTest.java | 127 ---
 .../view/MessageMetadataViewFactoryTest.java       | 135 ---
 .../model/message/view/MessageViewFixture.java     |  48 --
 .../jmap/model/message/view/SubMessageTest.java    | 163 ----
 .../james/jmap/utils/KeywordsCombinerTest.java     | 132 ---
 59 files changed, 1 insertion(+), 9271 deletions(-)

diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
index d2746a8f09..ade3870ddc 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPWithoutDraftCommonModule.java
@@ -19,15 +19,6 @@
 
 package org.apache.james.jmap;
 
-import org.apache.james.jmap.json.ObjectMapperFactory;
-import org.apache.james.jmap.methods.BlobManager;
-import org.apache.james.jmap.methods.BlobManagerImpl;
-import org.apache.james.jmap.methods.JmapResponseWriter;
-import org.apache.james.jmap.methods.JmapResponseWriterImpl;
-import org.apache.james.jmap.model.message.view.MessageFastViewFactory;
-import org.apache.james.jmap.model.message.view.MessageFullViewFactory;
-import org.apache.james.jmap.model.message.view.MessageHeaderViewFactory;
-import org.apache.james.jmap.model.message.view.MessageMetadataViewFactory;
 import org.apache.james.util.date.DefaultZonedDateTimeProvider;
 import org.apache.james.util.date.ZonedDateTimeProvider;
 import org.apache.james.util.mime.MessageContentExtractor;
@@ -39,20 +30,8 @@ public class JMAPWithoutDraftCommonModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        bind(MessageFullViewFactory.class).in(Scopes.SINGLETON);
-        bind(MessageMetadataViewFactory.class).in(Scopes.SINGLETON);
-        bind(MessageHeaderViewFactory.class).in(Scopes.SINGLETON);
-        bind(MessageFastViewFactory.class).in(Scopes.SINGLETON);
-
         bind(MessageContentExtractor.class).in(Scopes.SINGLETON);
         bind(DefaultZonedDateTimeProvider.class).in(Scopes.SINGLETON);
         bind(ZonedDateTimeProvider.class).to(DefaultZonedDateTimeProvider.class);
-
-        bind(BlobManagerImpl.class).in(Scopes.SINGLETON);
-        bind(BlobManager.class).to(BlobManagerImpl.class);
-        bind(ObjectMapperFactory.class).in(Scopes.SINGLETON);
-        bind(JmapResponseWriterImpl.class).in(Scopes.SINGLETON);
-        bind(JmapResponseWriter.class).to(JmapResponseWriterImpl.class);
-
     }
 }
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
index 637f0a6534..a12a0c1a0a 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
@@ -26,7 +26,6 @@ import org.apache.james.jmap.JMAPModule;
 import org.apache.james.jmap.JMAPServer;
 import org.apache.james.jmap.JmapGuiceProbe;
 import org.apache.james.jmap.MessageIdProbe;
-import org.apache.james.jmap.methods.Method;
 import org.apache.james.utils.GuiceProbe;
 import org.apache.james.utils.InitializationOperation;
 import org.apache.james.utils.InitilizationOperationBuilder;
@@ -44,7 +43,6 @@ public class JMAPServerModule extends AbstractModule {
         Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(JmapGuiceProbe.class);
         Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(MessageIdProbe.class);
 
-        Multibinder.newSetBinder(binder(), Method.class);
     }
 
     @ProvidesIntoSet
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/exceptions/BlobNotFoundException.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/exceptions/BlobNotFoundException.java
deleted file mode 100644
index 66fb34c568..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/exceptions/BlobNotFoundException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.exceptions;
-
-import org.apache.james.jmap.model.BlobId;
-
-public class BlobNotFoundException extends RuntimeException {
-
-    private final BlobId blobId;
-
-    public BlobNotFoundException(BlobId blobId) {
-        super("Could not retrieve " + blobId.getRawValue());
-        this.blobId = blobId;
-    }
-
-    public BlobNotFoundException(BlobId blobId, Throwable cause) {
-        super("Could not retrieve " + blobId.getRawValue(), cause);
-        this.blobId = blobId;
-    }
-
-    public BlobId getBlobId() {
-        return blobId;
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/ObjectMapperFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/ObjectMapperFactory.java
deleted file mode 100644
index a5b43696c0..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/ObjectMapperFactory.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.json;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Set;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.model.mailbox.Rights;
-import org.apache.james.mailbox.Role;
-import org.apache.james.mailbox.model.ContentType;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mdn.action.mode.DispositionActionMode;
-import org.apache.james.mdn.sending.mode.DispositionSendingMode;
-import org.apache.james.mdn.type.DispositionType;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.KeyDeserializer;
-import com.fasterxml.jackson.databind.Module;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.fasterxml.jackson.datatype.guava.GuavaModule;
-import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
-public class ObjectMapperFactory {
-
-    private static final ImmutableSet.Builder<Module> JACKSON_BASE_MODULES = ImmutableSet.<Module>builder().add(
-            new Jdk8Module(),
-            new JavaTimeModule(),
-            new GuavaModule());
-
-    private final Set<Module> jacksonModules;
-
-    @Inject
-    public ObjectMapperFactory(MailboxId.Factory mailboxIdFactory, MessageId.Factory messageIdFactory) {
-        SimpleModule mailboxIdModule = new SimpleModule();
-        mailboxIdModule.addDeserializer(MailboxId.class, new MailboxIdDeserializer(mailboxIdFactory));
-        mailboxIdModule.addSerializer(MailboxId.class, new MailboxIdSerializer());
-        mailboxIdModule.addKeyDeserializer(MailboxId.class, new MailboxIdKeyDeserializer(mailboxIdFactory));
-        mailboxIdModule.addKeySerializer(MailboxId.class, new MailboxIdKeySerializer());
-
-        mailboxIdModule.addDeserializer(MessageId.class, new MessageIdDeserializer(messageIdFactory));
-        mailboxIdModule.addSerializer(MessageId.class, new MessageIdSerializer());
-        mailboxIdModule.addKeyDeserializer(MessageId.class, new MessageIdKeyDeserializer(messageIdFactory));
-        mailboxIdModule.addKeySerializer(MessageId.class, new MessageIdKeySerializer());
-        mailboxIdModule.addSerializer(Username.class, new UsernameSerializer());
-        mailboxIdModule.addDeserializer(Username.class, new UsernameDeserializer());
-        mailboxIdModule.addKeyDeserializer(Username.class, new UsernameKeyDeserializer());
-        mailboxIdModule.addKeySerializer(Username.class, new UsernameKeySerializer());
-        mailboxIdModule.addDeserializer(Rights.Right.class, new RightDeserializer());
-
-        SimpleModule mdnModule = new SimpleModule();
-        mailboxIdModule.addDeserializer(DispositionActionMode.class, new MDNActionModeDeserializer());
-        mailboxIdModule.addDeserializer(DispositionSendingMode.class, new MDNSendingModeDeserializer());
-        mailboxIdModule.addDeserializer(DispositionType.class, new MDNTypeDeserializer());
-
-        SimpleModule contentTypeModule = new SimpleModule();
-        contentTypeModule.addDeserializer(ContentType.class, new ContentTypeDeserializer());
-        contentTypeModule.addSerializer(ContentType.class, new ContentTypeSerializer());
-
-        mailboxIdModule.setMixInAnnotation(Role.class, RoleMixIn.class);
-
-        jacksonModules = JACKSON_BASE_MODULES.add(mailboxIdModule)
-            .add(mdnModule)
-            .add(contentTypeModule)
-            .build();
-    }
-
-    public ObjectMapper forParsing() {
-        return new ObjectMapper()
-                .registerModules(jacksonModules)
-                .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-    }
-
-    public ObjectMapper forWriting() {
-        return new ObjectMapper()
-                .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
-                .registerModules(jacksonModules);
-    }
-
-    public static class MDNActionModeDeserializer extends JsonDeserializer<DispositionActionMode> {
-        private static final ImmutableList<String> ALLOWED_VALUES = Arrays.stream(DispositionActionMode.values())
-            .map(DispositionActionMode::getValue)
-            .collect(ImmutableList.toImmutableList());
-
-        @Override
-        public DispositionActionMode deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
-            String value = jsonParser.getValueAsString();
-            return DispositionActionMode.fromString(value)
-                .orElseThrow(() -> new IllegalStateException(
-                    String.format("Unrecognized MDN Disposition action mode %s. Should be one of %s", value, ALLOWED_VALUES)));
-        }
-    }
-
-    public static class MDNSendingModeDeserializer extends JsonDeserializer<DispositionSendingMode> {
-        private static final ImmutableList<String> ALLOWED_VALUES = Arrays.stream(DispositionSendingMode.values())
-            .map(DispositionSendingMode::getValue)
-            .collect(ImmutableList.toImmutableList());
-
-        @Override
-        public DispositionSendingMode deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
-            String value = jsonParser.getValueAsString();
-            return DispositionSendingMode.fromString(value)
-                .orElseThrow(() -> new IllegalStateException(
-                    String.format("Unrecognized MDN Disposition sending mode %s. Should be one of %s", value, ALLOWED_VALUES)));
-        }
-    }
-
-    public static class ContentTypeDeserializer extends JsonDeserializer<ContentType> {
-        @Override
-        public ContentType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
-            String value = jsonParser.getValueAsString();
-            return ContentType.of(value);
-        }
-    }
-
-    public static class ContentTypeSerializer extends JsonSerializer<ContentType> {
-        @Override
-        public void serialize(ContentType value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeString(value.asString());
-        }
-    }
-
-    public static class MDNTypeDeserializer extends JsonDeserializer<DispositionType> {
-        private static final ImmutableList<String> ALLOWED_VALUES = Arrays.stream(DispositionType.values())
-            .map(DispositionType::getValue)
-            .collect(ImmutableList.toImmutableList());
-
-        @Override
-        public DispositionType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
-            String value = jsonParser.getValueAsString();
-            return DispositionType.fromString(value)
-                .orElseThrow(() -> new IllegalStateException(
-                    String.format("Unrecognized MDN Disposition type %s. Should be one of %s", value, ALLOWED_VALUES)));
-        }
-    }
-
-    public static class MailboxIdDeserializer extends JsonDeserializer<MailboxId> {
-        private MailboxId.Factory factory;
-
-        public MailboxIdDeserializer(MailboxId.Factory factory) {
-            this.factory = factory;
-        }
-
-        @Override
-        public MailboxId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
-            return factory.fromString(p.getValueAsString());
-        }
-    }
-
-    public static class MailboxIdSerializer extends JsonSerializer<MailboxId> {
-
-        @Override
-        public void serialize(MailboxId value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeString(value.serialize());
-        }
-    }
-
-    public static class UsernameSerializer extends JsonSerializer<Username> {
-        @Override
-        public void serialize(Username value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeString(value.asString());
-        }
-    }
-
-    public static class UsernameKeySerializer extends JsonSerializer<Username> {
-        @Override
-        public void serialize(Username value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeFieldName(value.asString());
-        }
-    }
-
-    public static class UsernameDeserializer extends JsonDeserializer<Username> {
-        @Override
-        public Username deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
-            return Username.of(p.getValueAsString());
-        }
-    }
-
-    public static class UsernameKeyDeserializer extends KeyDeserializer {
-        @Override
-        public Object deserializeKey(String key, DeserializationContext ctxt) {
-            return Username.of(key);
-        }
-    }
-
-    public static class RightDeserializer extends JsonDeserializer<Rights.Right> {
-
-        @Override
-        public Rights.Right deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
-            String nodeValue = p.getValueAsString();
-            Preconditions.checkArgument(nodeValue.length() == 1, "Rights should be represented as single value characters");
-
-            return Rights.Right.forChar(nodeValue.charAt(0));
-        }
-    }
-
-    public static class MailboxIdKeyDeserializer extends KeyDeserializer {
-        private MailboxId.Factory factory;
-
-        public MailboxIdKeyDeserializer(MailboxId.Factory factory) {
-            this.factory = factory;
-        }
-
-        @Override
-        public Object deserializeKey(String key, DeserializationContext ctxt) {
-            return factory.fromString(key);
-        }
-    }
-
-    public static class MailboxIdKeySerializer extends JsonSerializer<MailboxId> {
-
-        @Override
-        public void serialize(MailboxId value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeFieldName(value.serialize());
-        }
-    }
-
-    public static class MessageIdDeserializer extends JsonDeserializer<MessageId> {
-        private MessageId.Factory factory;
-
-        public MessageIdDeserializer(MessageId.Factory factory) {
-            this.factory = factory;
-        }
-
-        @Override
-        public MessageId deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
-            return factory.fromString(p.getValueAsString());
-        }
-    }
-
-    public static class MessageIdKeyDeserializer extends KeyDeserializer {
-        private MessageId.Factory factory;
-
-        public MessageIdKeyDeserializer(MessageId.Factory factory) {
-            this.factory = factory;
-        }
-
-        @Override
-        public Object deserializeKey(String key, DeserializationContext ctxt) {
-            return factory.fromString(key);
-        }
-    }
-
-    public static class MessageIdKeySerializer extends JsonSerializer<MessageId> {
-
-        @Override
-        public void serialize(MessageId value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeFieldName(value.serialize());
-        }
-    }
-
-
-    public static class MessageIdSerializer extends JsonSerializer<MessageId> {
-
-        @Override
-        public void serialize(MessageId value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
-            gen.writeString(value.serialize());
-        }
-    }
-
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/RoleMixIn.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/RoleMixIn.java
deleted file mode 100644
index 3faec1efac..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/json/RoleMixIn.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.json;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-
-public abstract class RoleMixIn {
-
-    @JsonValue
-    abstract String serialize();
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManager.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManager.java
deleted file mode 100644
index ae2fcc03c0..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManager.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import java.util.Collection;
-
-import org.apache.james.jmap.exceptions.BlobNotFoundException;
-import org.apache.james.jmap.model.Blob;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.reactivestreams.Publisher;
-
-public interface BlobManager {
-    Blob retrieve(BlobId blobId, MailboxSession mailboxSession) throws MailboxException, BlobNotFoundException;
-
-    Publisher<Blob> retrieve(Collection<BlobId> blobIds, MailboxSession session);
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManagerImpl.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManagerImpl.java
deleted file mode 100644
index 211b9c3414..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/BlobManagerImpl.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Function;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.api.model.UploadNotFoundException;
-import org.apache.james.jmap.api.upload.UploadRepository;
-import org.apache.james.jmap.exceptions.BlobNotFoundException;
-import org.apache.james.jmap.model.Blob;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.mailbox.AttachmentIdFactory;
-import org.apache.james.mailbox.AttachmentManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.exception.AttachmentNotFoundException;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.AttachmentId;
-import org.apache.james.mailbox.model.AttachmentMetadata;
-import org.apache.james.mailbox.model.Content;
-import org.apache.james.mailbox.model.ContentType;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.util.ReactorUtils;
-import org.reactivestreams.Publisher;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class BlobManagerImpl implements BlobManager {
-    public static final ContentType MESSAGE_RFC822_CONTENT_TYPE = ContentType.of("message/rfc822");
-    public static final String UPLOAD_PREFIX = "upload-";
-
-    private final AttachmentManager attachmentManager;
-    private final MessageIdManager messageIdManager;
-    private final MessageId.Factory messageIdFactory;
-    private final UploadRepository uploadRepository;
-    private final AttachmentIdFactory attachmentIdFactory;
-
-    @Inject
-    public BlobManagerImpl(AttachmentManager attachmentManager, MessageIdManager messageIdManager,
-                           MessageId.Factory messageIdFactory, UploadRepository uploadRepository,
-                           AttachmentIdFactory attachmentIdFactory) {
-        this.attachmentManager = attachmentManager;
-        this.messageIdManager = messageIdManager;
-        this.messageIdFactory = messageIdFactory;
-        this.uploadRepository = uploadRepository;
-        this.attachmentIdFactory = attachmentIdFactory;
-    }
-
-    @Override
-    public Publisher<Blob> retrieve(Collection<BlobId> blobIds, MailboxSession session) {
-        Set<BlobId> supplied = ImmutableSet.copyOf(blobIds);
-        Set<BlobId> encodingUploads = blobIds.stream()
-            .filter(blobId -> blobId.asUploadId().isPresent())
-            .collect(ImmutableSet.toImmutableSet());
-        Set<BlobId> notEncodingUploads = Sets.difference(supplied, encodingUploads);
-
-        Flux<Blob> uploads = Flux.fromIterable(encodingUploads)
-            .flatMap(blobId -> getBlobFromUpload(blobId, session));
-
-
-        List<AttachmentId> notEncodingUploadsAsAttachmentIds = notEncodingUploads.stream()
-            .map(blobId -> attachmentIdFactory.from(blobId.getRawValue()))
-            .collect(ImmutableList.toImmutableList());
-
-        Flux<Blob> attachmentOrMessage = Mono.fromCallable(() -> attachmentManager.getAttachments(notEncodingUploadsAsAttachmentIds, session))
-            .subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER)
-            .flatMapIterable(Function.identity())
-            .flatMap(attachment -> Mono.fromCallable(() -> loadAttachmentContent(attachment, session))
-                .subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER))
-            .collect(ImmutableList.toImmutableList())
-            .flatMapMany(attachmentsBlobs -> {
-                Set<BlobId> attachmentBlobIds = attachmentsBlobs
-                    .stream()
-                    .map(Blob::getBlobId)
-                    .collect(ImmutableSet.toImmutableSet());
-                Set<BlobId> messageBlobIds = Sets.difference(notEncodingUploads, attachmentBlobIds);
-
-                return Flux.merge(Flux.fromIterable(attachmentsBlobs),
-                    Flux.fromIterable(messageBlobIds)
-                        .flatMap(blobId -> getBlobFromMessage(blobId, session)));
-            });
-
-        return Flux.merge(uploads, attachmentOrMessage);
-    }
-
-    @Override
-    public Blob retrieve(BlobId blobId, MailboxSession mailboxSession) throws MailboxException, BlobNotFoundException {
-        try {
-            return getBlobFromUpload(blobId, mailboxSession)
-                .switchIfEmpty(Mono.fromCallable(() -> getBlobFromAttachment(blobId, mailboxSession))
-                    .subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER)
-                    .handle(ReactorUtils.publishIfPresent()))
-                .switchIfEmpty(getBlobFromMessage(blobId, mailboxSession))
-                .switchIfEmpty(Mono.error(() -> new BlobNotFoundException(blobId)))
-                .block();
-        } catch (Exception e) {
-            if (e.getCause() instanceof MailboxException) {
-                throw (MailboxException) e.getCause();
-            }
-            throw e;
-        }
-    }
-
-    private Mono<Blob> getBlobFromUpload(BlobId blobId, MailboxSession mailboxSession) {
-        return blobId.asUploadId()
-            .map(uploadId -> Mono.from(uploadRepository.retrieve(uploadId, mailboxSession.getUser()))
-                .map(upload -> Blob.builder()
-                    .id(blobId)
-                    .contentType(upload.contentType())
-                    .size(upload.sizeAsLong())
-                    .payload(upload.content()::apply)
-                    .build())
-                .onErrorResume(UploadNotFoundException.class, e -> Mono.empty()))
-            .orElse(Mono.empty());
-    }
-
-    private Optional<Blob> getBlobFromAttachment(BlobId blobId, MailboxSession mailboxSession) throws MailboxException {
-        try {
-            AttachmentId attachmentId = attachmentIdFactory.from(blobId.getRawValue());
-            AttachmentMetadata attachment = attachmentManager.getAttachment(attachmentId, mailboxSession);
-
-            return Optional.of(loadAttachmentContent(attachment, mailboxSession));
-        } catch (AttachmentNotFoundException e) {
-            return Optional.empty();
-        }
-    }
-
-    private Blob loadAttachmentContent(AttachmentMetadata attachment, MailboxSession mailboxSession) {
-        BlobId blobId = BlobId.of(attachment.getAttachmentId());
-        return Blob.builder()
-            .id(blobId)
-            .payload(new Blob.InputStreamSupplier() {
-                @Override
-                public InputStream load() throws IOException, BlobNotFoundException {
-                    try {
-                        return loadReactive().block();
-                    } catch (RuntimeException e) {
-                        if (e.getCause() instanceof IOException) {
-                            throw (IOException) e.getCause();
-                        }
-                        if (e.getCause() instanceof BlobNotFoundException) {
-                            throw (BlobNotFoundException) e.getCause();
-                        }
-                        throw e;
-                    }
-                }
-
-                @Override
-                public Mono<InputStream> loadReactive() {
-                    return attachmentManager.loadAttachmentContentReactive(attachment.getAttachmentId(), mailboxSession)
-                        .onErrorResume(AttachmentNotFoundException.class, e -> Mono.error(new BlobNotFoundException(blobId, e)));
-                }
-            })
-            .size(attachment.getSize())
-            .contentType(attachment.getType())
-            .build();
-    }
-
-    private Mono<Blob> getBlobFromMessage(BlobId blobId, MailboxSession mailboxSession) {
-        return retrieveMessageId(blobId)
-                .flatMap(messageId -> loadMessageAsInputStream(messageId, mailboxSession))
-                .map(Throwing.function(
-                    content -> Blob.builder()
-                        .id(blobId)
-                        .contentType(MESSAGE_RFC822_CONTENT_TYPE)
-                        .size(content.size())
-                        .payload(content::getInputStream)
-                        .build()));
-    }
-
-    private Mono<MessageId> retrieveMessageId(BlobId blobId) {
-        try {
-            return Mono.just(messageIdFactory.fromString(blobId.getRawValue()));
-        } catch (IllegalArgumentException e) {
-            return Mono.empty();
-        }
-    }
-
-    private Mono<Content> loadMessageAsInputStream(MessageId messageId, MailboxSession mailboxSession)  {
-            return Flux.from(messageIdManager.getMessagesReactive(ImmutableSet.of(messageId), FetchGroup.FULL_CONTENT, mailboxSession))
-                .map(Throwing.function(MessageResult::getFullContent))
-                .next();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/ErrorResponse.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/ErrorResponse.java
deleted file mode 100644
index 760147f90c..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/ErrorResponse.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import java.util.Objects;
-import java.util.Optional;
-
-public class ErrorResponse implements Method.Response {
-    public static final Method.Response.Name ERROR_METHOD = Method.Response.name("error");
-    public static final String DEFAULT_ERROR_MESSAGE = "Error while processing";
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    public static class Builder {
-
-        private Optional<String> type = Optional.empty();
-        private Optional<String> description = Optional.empty();
-
-        private Builder() {
-        }
-
-        public Builder type(String type) {
-            this.type = Optional.ofNullable(type);
-            return this;
-        }
-
-        public Builder description(String description) {
-            this.description = Optional.ofNullable(description);
-            return this;
-        }
-
-        public ErrorResponse build() {
-            return new ErrorResponse(type.orElse(DEFAULT_ERROR_MESSAGE), description);
-        }
-    }
-
-    private final String type;
-    private final Optional<String> description;
-
-    public ErrorResponse(String type, Optional<String> description) {
-        this.type = type;
-        this.description = description;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public Optional<String> getDescription() {
-        return description;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-
-        ErrorResponse that = (ErrorResponse) o;
-
-        return Objects.equals(this.type, that.type)
-            && Objects.equals(this.description, that.description);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(type, description);
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapRequest.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapRequest.java
deleted file mode 100644
index d125555440..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapRequest.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-public interface JmapRequest {
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponse.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponse.java
deleted file mode 100644
index 94d956faa3..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponse.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import java.util.Optional;
-import java.util.Set;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.jmap.model.Property;
-
-import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableSet;
-
-public class JmapResponse {
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    public static class Builder {
-
-        private Method.Response.Name responseName;
-        private MethodCallId methodCallId;
-        private Method.Response response;
-        private Optional<? extends Set<? extends Property>> properties = Optional.empty();
-        private Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> filterProvider = Optional.empty();
-
-        private Builder() {
-        }
-
-        public Builder responseName(Method.Response.Name name) {
-            this.responseName = name;
-            return this;
-        }
-
-        public Builder methodCallId(MethodCallId methodCallId) {
-            this.methodCallId = methodCallId;
-            return this;
-        }
-
-        public Builder response(Method.Response response) {
-            this.response = response;
-            return this;
-        }
-
-        public Builder properties(Optional<? extends Set<? extends Property>> properties) {
-            this.properties = properties.map(ImmutableSet::copyOf);
-            return this;
-        }
-
-        public Builder properties(Set<? extends Property> properties) {
-            return properties(Optional.ofNullable(properties));
-        }
-
-        public Builder filterProvider(Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> filterProvider) {
-            this.filterProvider = filterProvider;
-            return this;
-        }
-
-        public Builder error() {
-            this.response = ErrorResponse.builder().build();
-            this.responseName = ErrorResponse.ERROR_METHOD;
-            return this;
-        }
-
-        public Builder error(ErrorResponse error) {
-            this.response = error;
-            this.responseName = ErrorResponse.ERROR_METHOD;
-            return this;
-        }
-
-
-        public JmapResponse build() {
-            Preconditions.checkState(methodCallId != null, "'methodCallId' needs to be specified");
-            Preconditions.checkState(responseName != null, "'responseName' needs to be specified");
-
-            return new JmapResponse(responseName, methodCallId, response, properties, filterProvider);
-        }
-    }
-
-    private final Method.Response.Name method;
-    private final MethodCallId methodCallId;
-    private final Method.Response response;
-    private final Optional<? extends Set<? extends Property>> properties;
-    private final Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> filterProvider;
-
-    private JmapResponse(Method.Response.Name method, MethodCallId methodCallId,
-                         Method.Response response,
-                         Optional<? extends Set<? extends Property>> properties,
-                         Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> filterProvider) {
-        this.method = method;
-        this.methodCallId = methodCallId;
-        this.response = response;
-        this.properties = properties;
-        this.filterProvider = filterProvider;
-    }
-
-    public Method.Response.Name getResponseName() {
-        return method;
-    }
-
-    public Method.Response getResponse() {
-        return response;
-    }
-
-    public MethodCallId getMethodCallId() {
-        return methodCallId;
-    }
-
-    public Optional<? extends Set<? extends Property>> getProperties() {
-        return properties;
-    }
-
-    public Optional<Pair<? extends Set<? extends Property>, SimpleFilterProvider>> getFilterProvider() {
-        return filterProvider;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(method, methodCallId, response, properties, filterProvider);
-    }
-
-    @Override
-    public boolean equals(Object object) {
-        if (object instanceof JmapResponse) {
-            JmapResponse that = (JmapResponse) object;
-            return Objects.equal(this.method, that.method)
-                    && Objects.equal(this.methodCallId, that.methodCallId)
-                    && Objects.equal(this.response, that.response)
-                    && Objects.equal(this.properties, that.properties)
-                    && Objects.equal(this.filterProvider, that.filterProvider);
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-                .add("method", method)
-                .add("response", response)
-                .add("methodCallId", methodCallId)
-                .add("properties", properties)
-                .add("filterProvider", filterProvider)
-                .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriter.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriter.java
deleted file mode 100644
index 7420167698..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriter.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import org.apache.james.jmap.model.InvocationResponse;
-
-import reactor.core.publisher.Flux;
-
-public interface JmapResponseWriter {
-
-    Flux<InvocationResponse> formatMethodResponse(Flux<JmapResponse> jmapResponse);
-
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriterImpl.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriterImpl.java
deleted file mode 100644
index 4219ad0dfd..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/JmapResponseWriterImpl.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import java.time.Duration;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-
-import jakarta.inject.Inject;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.james.jmap.json.ObjectMapperFactory;
-import org.apache.james.jmap.model.InvocationResponse;
-import org.apache.james.jmap.model.Property;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ser.FilterProvider;
-import com.fasterxml.jackson.databind.ser.PropertyFilter;
-import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
-import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
-import com.github.fge.lambdas.Throwing;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.collect.ImmutableSet;
-
-import reactor.core.publisher.Flux;
-
-public class JmapResponseWriterImpl implements JmapResponseWriter {
-    public static final String PROPERTIES_FILTER = "propertiesFilter";
-
-    private static class CachedObjectMapper {
-        private final ObjectMapper objectMapper;
-        private final Optional<? extends Set<? extends Property>> properties;
-        private final Optional<? extends Set<? extends Property>> subProperties;
-
-        private CachedObjectMapper(ObjectMapper objectMapper,
-                                   Optional<? extends Set<? extends Property>> properties,
-                                   Optional<? extends Set<? extends Property>> subProperties) {
-            this.objectMapper = objectMapper;
-            this.properties = properties;
-            this.subProperties = subProperties;
-        }
-
-        Optional<ObjectMapper> cachedMapperIfApplicable(JmapResponse jmapResponse) {
-            if (jmapResponse.getProperties().equals(properties)
-                && jmapResponse.getFilterProvider().map(Pair::getKey).equals(subProperties)) {
-
-                return Optional.of(objectMapper);
-            }
-            return Optional.empty();
-        }
-    }
-
-
-    private final ObjectMapper objectMapper;
-    private final Cache<Long, CachedObjectMapper> writerCache;
-
-    @Inject
-    public JmapResponseWriterImpl(ObjectMapperFactory objectMapperFactory) {
-        this.objectMapper = objectMapperFactory.forWriting();
-
-        writerCache = CacheBuilder.newBuilder()
-            .maximumSize(128)
-            .expireAfterAccess(Duration.ofMinutes(15))
-            .build();
-    }
-
-    @Override
-    public Flux<InvocationResponse> formatMethodResponse(Flux<JmapResponse> jmapResponses) {
-        return jmapResponses.map(Throwing.function(jmapResponse -> {
-            ObjectMapper objectMapper = retrieveObjectMapperFromCache(jmapResponse)
-                .cachedMapperIfApplicable(jmapResponse)
-                .orElseGet(() -> newConfiguredObjectMapper(jmapResponse));
-
-            return new InvocationResponse(
-                    jmapResponse.getResponseName(),
-                    objectMapper.valueToTree(jmapResponse.getResponse()),
-                    jmapResponse.getMethodCallId());
-        }));
-    }
-
-    private CachedObjectMapper retrieveObjectMapperFromCache(JmapResponse jmapResponse) throws ExecutionException {
-        return writerCache.get(computeCachingKey(jmapResponse), () -> new CachedObjectMapper(
-            newConfiguredObjectMapper(jmapResponse),
-            jmapResponse.getProperties(),
-            jmapResponse.getFilterProvider().map(Pair::getKey)));
-    }
-
-    private ObjectMapper newConfiguredObjectMapper(JmapResponse jmapResponse) {
-        FilterProvider filterProvider = jmapResponse
-            .getFilterProvider()
-            .map(Pair::getValue)
-            .orElseGet(SimpleFilterProvider::new)
-            .setDefaultFilter(SimpleBeanPropertyFilter.serializeAll())
-            .addFilter(PROPERTIES_FILTER, getPropertiesFilter(jmapResponse.getProperties()));
-
-        return objectMapper.copy().setFilterProvider(filterProvider);
-
-    }
-
-    private long computeCachingKey(JmapResponse jmapResponse) {
-        long lowBits = jmapResponse.getProperties().hashCode();
-        long highBits = jmapResponse.getFilterProvider()
-            .map(Pair::getKey)
-            .map(Object::hashCode)
-            .map(i -> (long) i)
-            .orElse((long) jmapResponse.getResponseName().hashCode());
-
-        return lowBits + (highBits >> 32);
-    }
-
-    private PropertyFilter getPropertiesFilter(Optional<? extends Set<? extends Property>> properties) {
-        return properties
-                .map(this::toFieldNames)
-                .map(SimpleBeanPropertyFilter::filterOutAllExcept)
-                .orElse(SimpleBeanPropertyFilter.serializeAll());
-    }
-
-    private Set<String> toFieldNames(Set<? extends Property> properties) {
-        return properties.stream()
-            .map(Property::asFieldName)
-            .collect(ImmutableSet.toImmutableSet());
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/Method.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/Method.java
deleted file mode 100644
index 52d1a9c73b..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/methods/Method.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-import java.util.stream.Stream;
-
-import org.apache.james.jmap.model.MethodCallId;
-import org.apache.james.mailbox.MailboxSession;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Flux;
-
-public interface Method {
-
-    String JMAP_PREFIX = "JMAP-";
-
-    interface Request {
-
-        static Name name(String name) {
-            return new Name(name);
-        }
-
-        class Name {
-
-            private final String name;
-
-            private Name(String name) {
-                Preconditions.checkNotNull(name);
-                Preconditions.checkArgument(!name.isEmpty());
-                this.name = name;
-            }
-
-            @JsonValue
-            public String getName() {
-                return name;
-            }
-
-            @Override
-            public boolean equals(Object obj) {
-                if (obj instanceof Name) {
-                    Name other = (Name) obj;
-                    return Objects.equals(name, other.name);
-                }
-                return false;
-            }
-
-            @Override
-            public int hashCode() {
-                return Objects.hash(name);
-            }
-
-            @Override
-            public String toString() {
-                return toStringHelper(this).add("name", name).toString();
-            }
-        }
-
-    }
-
-    interface Response {
-
-        static Name name(String name) {
-            return new Name(name);
-        }
-
-        class Name {
-
-            private final String name;
-
-            protected Name(String name) {
-                Preconditions.checkNotNull(name);
-                Preconditions.checkArgument(!name.isEmpty());
-                this.name = name;
-            }
-
-            @JsonValue
-            public String getName() {
-                return name;
-            }
-
-            @Override
-            public boolean equals(Object obj) {
-                if (obj instanceof Name) {
-                    Name other = (Name) obj;
-                    return Objects.equals(name, other.name);
-                }
-                return false;
-            }
-
-            @Override
-            public int hashCode() {
-                return Objects.hash(name);
-            }
-
-            @Override
-            public String toString() {
-                return toStringHelper(this).add("name", name).toString();
-            }
-        }
-    }
-
-
-    Request.Name requestHandled();
-
-    Class<? extends JmapRequest> requestType();
-
-    Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession);
-
-    default Stream<JmapResponse> processToStream(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) {
-        return process(request, methodCallId, mailboxSession)
-            .toStream();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Attachment.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Attachment.java
deleted file mode 100644
index 8329563af4..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Attachment.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.Objects;
-import java.util.Optional;
-
-import org.apache.james.mailbox.model.ContentType;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-
-@JsonDeserialize(builder = Attachment.Builder.class)
-public class Attachment {
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    @JsonPOJOBuilder(withPrefix = "")
-    public static class Builder {
-        private BlobId blobId;
-        private ContentType type;
-        private String name;
-        private Number size;
-        private String cid;
-        private boolean isInline;
-        private Number width;
-        private Number height;
-
-        public Builder blobId(BlobId blobId) {
-            this.blobId = blobId;
-            return this;
-        }
-
-        @JsonDeserialize
-        public Builder type(String type) {
-            this.type = ContentType.of(type);
-            return this;
-        }
-
-        public Builder type(ContentType type) {
-            this.type = type;
-            return this;
-        }
-
-        @JsonDeserialize
-        public Builder name(String name) {
-            this.name = name;
-            return this;
-        }
-
-        public Builder name(Optional<String> name) {
-            this.name = name.orElse(null);
-            return this;
-        }
-
-        public Builder size(long size) {
-            this.size = Number.DEFAULT_FACTORY.from(size)
-                .orElseThrow(() -> new IllegalArgumentException(Number.VALIDATION_MESSAGE));
-            return this;
-        }
-
-        @JsonDeserialize
-        public Builder cid(String cid) {
-            this.cid = cid;
-            return this;
-        }
-
-        public Builder cid(Optional<String> cid) {
-            this.cid = cid.orElse(null);
-            return this;
-        }
-
-        public Builder isInline(boolean isInline) {
-            this.isInline = isInline;
-            return this;
-        }
-
-        public Builder width(long width) {
-            this.width = Number.DEFAULT_FACTORY.from(width)
-                .orElseThrow(() -> new IllegalArgumentException(Number.VALIDATION_MESSAGE));
-            return this;
-        }
-
-        public Builder height(long height) {
-            this.height = Number.DEFAULT_FACTORY.from(height)
-                .orElseThrow(() -> new IllegalArgumentException(Number.VALIDATION_MESSAGE));
-            return this;
-        }
-
-        public Attachment build() {
-            Preconditions.checkState(blobId != null, "'blobId' is mandatory");
-            Preconditions.checkState(size != null, "'size' is mandatory");
-            return new Attachment(blobId, type, Optional.ofNullable(name), size, Optional.ofNullable(cid), isInline, Optional.ofNullable(width), Optional.ofNullable(height));
-        }
-    }
-
-    public static class WithBlob {
-        private final Attachment attachment;
-        private final Blob blob;
-
-        public WithBlob(Attachment attachment, Blob blob) {
-            this.attachment = attachment;
-            this.blob = blob;
-        }
-
-        public Attachment getAttachment() {
-            return attachment;
-        }
-
-        public Blob getBlob() {
-            return blob;
-        }
-    }
-
-    private final BlobId blobId;
-    private final ContentType type;
-    private final Optional<String> name;
-    private final Number size;
-    private final Optional<String> cid;
-    private final boolean isInline;
-    private final Optional<Number> width;
-    private final Optional<Number> height;
-
-    @VisibleForTesting Attachment(BlobId blobId, ContentType type, Optional<String> name, Number size, Optional<String> cid, boolean isInline, Optional<Number> width, Optional<Number> height) {
-        this.blobId = blobId;
-        this.type = type;
-        this.name = name;
-        this.size = size;
-        this.cid = cid;
-        this.isInline = isInline;
-        this.width = width;
-        this.height = height;
-    }
-
-    public BlobId getBlobId() {
-        return blobId;
-    }
-
-    public ContentType getType() {
-        return type;
-    }
-
-    public Optional<String> getName() {
-        return name;
-    }
-
-    public Number getSize() {
-        return size;
-    }
-
-    public Optional<String> getCid() {
-        return cid;
-    }
-
-    public boolean isIsInline() {
-        return isInline;
-    }
-
-    public Boolean isInlinedWithCid() {
-        return isInline && cid.isPresent();
-    }
-
-    public Optional<Number> getWidth() {
-        return width;
-    }
-
-    public Optional<Number> getHeight() {
-        return height;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof Attachment) {
-            Attachment other = (Attachment) obj;
-            return Objects.equals(blobId, other.blobId)
-                && Objects.equals(type, other.type)
-                && Objects.equals(name, other.name)
-                && Objects.equals(size, other.size)
-                && Objects.equals(cid, other.cid)
-                && Objects.equals(isInline, other.isInline)
-                && Objects.equals(width, other.width)
-                && Objects.equals(height, other.height);
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(blobId, type, name, size, cid, isInline, width, height);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects
-                .toStringHelper(this)
-                .add("blobId", blobId)
-                .add("type", type)
-                .add("name", name)
-                .add("size", size)
-                .add("cid", cid)
-                .add("isInline", isInline)
-                .add("width", width)
-                .add("height", height)
-                .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Blob.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Blob.java
deleted file mode 100644
index 3f81a8bf8b..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Blob.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Objects;
-
-import org.apache.james.jmap.exceptions.BlobNotFoundException;
-import org.apache.james.mailbox.model.ContentType;
-import org.apache.james.util.ReactorUtils;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-
-import reactor.core.publisher.Mono;
-
-public class Blob {
-
-    @FunctionalInterface
-    public interface InputStreamSupplier {
-        /**
-         * @return the content of this blob as an inputStream.
-         *
-         * The caller is responsible of closing it.
-         */
-        InputStream load() throws IOException, BlobNotFoundException;
-
-        default Mono<InputStream> loadReactive() {
-            return Mono.fromCallable(this::load)
-                .subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER);
-        }
-    }
-
-    public static class Builder {
-        private BlobId blobId;
-        private InputStreamSupplier payload;
-        private ContentType contentType;
-        private Long size;
-
-        private Builder() {
-        }
-
-        public Builder id(BlobId id) {
-            this.blobId = id;
-            return this;
-        }
-
-        public Builder payload(InputStreamSupplier payload) {
-            this.payload = payload;
-            return this;
-        }
-
-        public Builder contentType(String contentType) {
-            this.contentType = ContentType.of(contentType);
-            return this;
-        }
-
-        public Builder contentType(ContentType contentType) {
-            this.contentType = contentType;
-            return this;
-        }
-
-        public Builder size(long size) {
-            this.size = size;
-            return this;
-        }
-
-        public Blob build() {
-            Preconditions.checkState(blobId != null, "id can not be empty");
-            Preconditions.checkState(payload != null, "payload can not be empty");
-            Preconditions.checkState(contentType != null, "contentType can not be empty");
-            Preconditions.checkState(size != null, "size can not be empty");
-
-            return new Blob(blobId, payload, contentType, size);
-        }
-    }
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    private final BlobId blobId;
-    private final InputStreamSupplier payload;
-    private final ContentType contentType;
-    private final long size;
-
-    @VisibleForTesting
-    Blob(BlobId blobId, InputStreamSupplier payload, ContentType contentType, long size) {
-        this.blobId = blobId;
-        this.payload = payload;
-        this.contentType = contentType;
-        this.size = size;
-    }
-
-    public BlobId getBlobId() {
-        return blobId;
-    }
-
-    public InputStream getStream() throws IOException {
-        return payload.load();
-    }
-
-    public Mono<InputStream> getStreamReactive() {
-        return payload.loadReactive();
-    }
-
-    public long getSize() {
-        return size;
-    }
-
-    public ContentType getContentType() {
-        return contentType;
-    }
-
-    @Override
-    public final boolean equals(Object o) {
-        if (o instanceof Blob) {
-            Blob blob = (Blob) o;
-
-            return Objects.equals(this.blobId, blob.blobId)
-                && Objects.equals(this.contentType, blob.contentType);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hash(blobId, contentType);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("blobId", blobId)
-            .add("contentType", contentType)
-            .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/BlobId.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/BlobId.java
deleted file mode 100644
index cf38c33d6d..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/BlobId.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.Objects;
-import java.util.Optional;
-
-import org.apache.james.jmap.api.model.UploadId;
-import org.apache.james.mailbox.model.AttachmentId;
-import org.apache.james.mailbox.model.MessageId;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-
-public class BlobId {
-    public static final String UPLOAD_PREFIX = "upload-";
-
-    public static BlobId of(UploadId uploadId) {
-        return BlobId.of(UPLOAD_PREFIX + uploadId.asString());
-    }
-
-    public static BlobId of(MessageId messageId) {
-        return BlobId.of(messageId.serialize());
-    }
-
-    public static BlobId of(AttachmentId attachmentId) {
-        return BlobId.of(attachmentId.getId());
-    }
-
-    public static BlobId of(String rawValue) {
-        Preconditions.checkArgument(!Strings.isNullOrEmpty(rawValue), "'rawValue' is mandatory");
-        return new BlobId(rawValue);
-    }
-
-    private final String rawValue;
-
-    private BlobId(String rawValue) {
-        this.rawValue = rawValue;
-    }
-
-    @JsonValue
-    public String getRawValue() {
-        return rawValue;
-    }
-
-    public Optional<UploadId> asUploadId() {
-        if (rawValue.startsWith(UPLOAD_PREFIX)) {
-            UploadId uploadId = UploadId.from(rawValue.substring(UPLOAD_PREFIX.length()));
-            return Optional.of(uploadId);
-        }
-        return Optional.empty();
-    }
-
-    @Override
-    public final boolean equals(Object obj) {
-        if (obj instanceof BlobId) {
-            BlobId other = (BlobId) obj;
-            return Objects.equals(this.rawValue, other.rawValue);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hashCode(this.rawValue);
-    }
-
-    @Override
-    public String toString() {
-        return "BlobId{" +
-            "rawValue='" + rawValue + '\'' +
-            '}';
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Emailer.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Emailer.java
deleted file mode 100644
index 544ca26012..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Emailer.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.function.Predicate;
-
-import jakarta.mail.internet.AddressException;
-
-import org.apache.james.core.MailAddress;
-import org.apache.james.mime4j.dom.address.AddressList;
-import org.apache.james.mime4j.dom.address.Mailbox;
-import org.apache.james.mime4j.dom.address.MailboxList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-
-@JsonDeserialize(builder = Emailer.Builder.class)
-public class Emailer {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(Emailer.class);
-
-    public static List<Emailer> fromAddressList(AddressList list) {
-        return Optional.ofNullable(list)
-            .map(addresses -> addresses.flatten()
-                .stream()
-                .map(Emailer::fromMailbox)
-                .collect(ImmutableList.toImmutableList()))
-            .orElse(ImmutableList.of());
-    }
-
-    public static Optional<Emailer> firstFromMailboxList(MailboxList list) {
-        return Optional.ofNullable(list)
-            .flatMap(mailboxes -> mailboxes.stream()
-                .map(Emailer::fromMailbox)
-                .findFirst());
-    }
-
-    private static Emailer fromMailbox(Mailbox mailbox) {
-        return Emailer.builder()
-            .name(getNameOrAddress(mailbox))
-            .email(mailbox.getAddress())
-            .allowInvalid()
-            .build();
-    }
-
-    private static String getNameOrAddress(Mailbox mailbox) {
-        return Optional.ofNullable(mailbox.getName())
-            .orElseGet(mailbox::getAddress);
-    }
-
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    @JsonPOJOBuilder(withPrefix = "")
-    public static class Builder {
-        private static final boolean DEFAULT_DISABLE = false;
-
-        private Optional<Boolean> allowInvalid = Optional.empty();
-        private Optional<String> name = Optional.empty();
-        private Optional<String> email = Optional.empty();
-
-        @JsonProperty("name")
-        public Builder name(Optional<String> name) {
-            this.name = name;
-            return this;
-        }
-
-        @JsonIgnore
-        public Builder name(String name) {
-            this.name = Optional.ofNullable(name);
-            return this;
-        }
-
-        @JsonProperty("email")
-        public Builder email(Optional<String> email) {
-            this.email = email;
-            return this;
-        }
-
-        @JsonIgnore
-        public Builder email(String email) {
-            this.email = Optional.ofNullable(email);
-            return this;
-        }
-
-        @JsonIgnore
-        public Builder allowInvalid() {
-            this.allowInvalid = Optional.of(true);
-            return this;
-        }
-
-        public Emailer build() {
-            if (allowInvalid.orElse(DEFAULT_DISABLE)) {
-                return buildRelaxed();
-            } else {
-                return buildStrict();
-            }
-        }
-
-        private Emailer buildStrict() {
-            Preconditions.checkState(name.isPresent(), "'name' is mandatory");
-            Preconditions.checkState(email.isPresent(), "'email' is mandatory");
-            Preconditions.checkState(!name.get().isEmpty(), "'name' should not be empty");
-            Preconditions.checkState(!email.get().isEmpty(), "'email' should not be empty");
-            Preconditions.checkState(email.get().contains("@"), "'email' must contain '@' character");
-            return new Emailer(name, email);
-        }
-
-        private Emailer buildRelaxed() {
-            return new Emailer(replaceIfNeeded(name), replaceIfNeeded(email));
-        }
-
-        private Optional<String> replaceIfNeeded(Optional<String> value) {
-            return value.filter(Predicate.not(Strings::isNullOrEmpty));
-        }
-    }
-
-    private final Optional<String> name;
-    private final Optional<String> email;
-
-    @VisibleForTesting Emailer(Optional<String> name, Optional<String> email) {
-        this.name = name;
-        this.email = email;
-    }
-
-    public Optional<String> getName() {
-        return name;
-    }
-
-    public Optional<String> getEmail() {
-        return email;
-    }
-
-    @JsonIgnore
-    public MailAddress toMailAddress() {
-        Preconditions.checkArgument(email.isPresent(), "eMailer mail address should be present when sending a mail using JMAP");
-        try {
-            return new MailAddress(email.get());
-        } catch (AddressException e) {
-            LOGGER.error("Invalid mail address", email);
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o instanceof Emailer) {
-            Emailer otherEMailer = (Emailer) o;
-            return Objects.equals(name, otherEMailer.name)
-                && Objects.equals(email, otherEMailer.email);
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(name, email);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("name", name)
-            .add("email", email)
-            .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/InvocationResponse.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/InvocationResponse.java
deleted file mode 100644
index 4c1c3d2c4e..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/InvocationResponse.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import org.apache.james.jmap.methods.Method;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.base.Preconditions;
-
-public class InvocationResponse {
-
-    private final Method.Response.Name name;
-    private final ObjectNode results;
-    private final MethodCallId methodCallId;
-
-    public InvocationResponse(Method.Response.Name name, ObjectNode results, MethodCallId methodCallId) {
-        Preconditions.checkNotNull(name, "method is mandatory");
-        Preconditions.checkNotNull(results, "results is mandatory");
-        Preconditions.checkNotNull(methodCallId,  "methodCallId is mandatory");
-        this.name = name;
-        this.results = results;
-        this.methodCallId = methodCallId;
-    }
-
-    public Method.Response.Name getResponseName() {
-        return name;
-    }
-
-    public ObjectNode getResults() {
-        return results;
-    }
-
-    public MethodCallId getMethodCallId() {
-        return methodCallId;
-    }
-
-    public Object[] asProtocolSpecification() {
-        return new Object[] { getResponseName(), getResults(), getMethodCallId() };
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keyword.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keyword.java
deleted file mode 100644
index d4eb9ea52e..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keyword.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-
-import java.util.Optional;
-
-import jakarta.mail.Flags;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.common.base.CharMatcher;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableBiMap;
-import com.google.common.collect.ImmutableList;
-
-public class Keyword {
-    private static final int FLAG_NAME_MIN_LENGTH = 1;
-    private static final int FLAG_NAME_MAX_LENGTH = 255;
-    private static final CharMatcher FLAG_NAME_PATTERN = CharMatcher.inRange('a', 'z')
-            .or(CharMatcher.inRange('A', 'Z'))
-            .or(CharMatcher.inRange('0', '9'))
-            .or(CharMatcher.is('$'))
-            .or(CharMatcher.is('_'))
-            .or(CharMatcher.is('-'));
-
-    public static final Keyword DRAFT = Keyword.of("$Draft");
-    public static final Keyword SEEN = Keyword.of("$Seen");
-    public static final Keyword FLAGGED = Keyword.of("$Flagged");
-    public static final Keyword ANSWERED = Keyword.of("$Answered");
-    public static final Keyword DELETED = Keyword.of("$Deleted");
-    public static final Keyword RECENT = Keyword.of("$Recent");
-    public static final Keyword FORWARDED = Keyword.of("$Forwarded");
-    public static final Boolean FLAG_VALUE = true;
-
-    private static final ImmutableList<Keyword> NON_EXPOSED_IMAP_KEYWORDS = ImmutableList.of(Keyword.RECENT, Keyword.DELETED);
-    private static final ImmutableBiMap<Flags.Flag, Keyword> IMAP_SYSTEM_FLAGS = ImmutableBiMap.<Flags.Flag, Keyword>builder()
-        .put(Flags.Flag.DRAFT, DRAFT)
-        .put(Flags.Flag.SEEN, SEEN)
-        .put(Flags.Flag.FLAGGED, FLAGGED)
-        .put(Flags.Flag.ANSWERED, ANSWERED)
-        .put(Flags.Flag.RECENT, RECENT)
-        .put(Flags.Flag.DELETED, DELETED)
-        .build();
-    public static final String VALIDATION_MESSAGE = "Flagname must not be null or empty, must have length form 1-255, " +
-        "must not contain charater with hex from '\\u0000' to '\\u00019' or {'(' ')' '{' ']' '%' '*' '\"' '\\'} ";
-
-    public static Optional<Keyword> parse(String flagName) {
-        if (isValid(flagName)) {
-            return Optional.of(new Keyword(flagName));
-        }
-        return Optional.empty();
-    }
-
-
-    public static Keyword of(String flagName) {
-        return parse(flagName)
-            .orElseThrow(() -> new IllegalArgumentException(VALIDATION_MESSAGE));
-    }
-
-    public static Keyword fromFlag(Flags.Flag flag) {
-        return IMAP_SYSTEM_FLAGS.get(flag);
-    }
-
-    private static boolean isValid(String flagName) {
-        if (StringUtils.isBlank(flagName)) {
-            return false;
-        }
-        if (flagName.length() < FLAG_NAME_MIN_LENGTH || flagName.length() > FLAG_NAME_MAX_LENGTH) {
-            return false;
-        }
-        if (!FLAG_NAME_PATTERN.matchesAllOf(flagName)) {
-            return false;
-        }
-        return true;
-    }
-
-    private final String flagName;
-
-    public Keyword(String flagName) {
-        this.flagName = flagName;
-    }
-
-    public String getFlagName() {
-        return flagName;
-    }
-
-    public boolean isExposedImapKeyword() {
-        return !NON_EXPOSED_IMAP_KEYWORDS.contains(this);
-    }
-
-    public boolean isDraft() {
-        return DRAFT.equals(this);
-    }
-
-    public Optional<Flags.Flag> asSystemFlag() {
-        return Optional.ofNullable(IMAP_SYSTEM_FLAGS.inverse()
-            .get(this));
-    }
-
-    public Flags asFlags() {
-        return asSystemFlag()
-            .map(Flags::new)
-            .orElseGet(() -> new Flags(flagName));
-    }
-
-    @Override
-    public final boolean equals(Object other) {
-        if (other instanceof Keyword) {
-            Keyword otherKeyword = (Keyword) other;
-            return Objects.equal(flagName, otherKeyword.flagName);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hashCode(flagName);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("flagName", flagName)
-            .toString();
-    }
-
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keywords.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keywords.java
deleted file mode 100644
index 1345c6a1b7..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Keywords.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
-
-import jakarta.mail.Flags;
-
-import org.apache.james.mailbox.FlagsBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-public class Keywords {
-
-    public static final Keywords DEFAULT_VALUE = new Keywords(ImmutableSet.of());
-    private static final Logger LOGGER = LoggerFactory.getLogger(Keywords.class);
-    private static final KeywordsFactory STRICT_KEYWORDS_FACTORY = new KeywordsFactory(
-        KeywordsFactory.KeywordsValidator.THROW_ON_IMAP_NON_EXPOSED_KEYWORDS,
-        KeywordsFactory.KeywordFilter.KEEP_ALL,
-        KeywordsFactory.ToKeyword.STRICT);
-    private static final KeywordsFactory LENIENT_KEYWORDS_FACTORY = new KeywordsFactory(
-        KeywordsFactory.KeywordsValidator.IGNORE_NON_EXPOSED_IMAP_KEYWORDS,
-        KeywordsFactory.KeywordFilter.FILTER_IMAP_NON_EXPOSED_KEYWORDS,
-        KeywordsFactory.ToKeyword.LENIENT);
-
-    private FlagsBuilder combiner(FlagsBuilder firstBuilder, FlagsBuilder secondBuilder) {
-        return firstBuilder.add(secondBuilder.build());
-    }
-
-    private FlagsBuilder accumulator(FlagsBuilder accumulator, Keyword keyword) {
-        return accumulator.add(keyword.asFlags());
-    }
-
-    public static class KeywordsFactory {
-        @FunctionalInterface
-        interface KeywordsValidator {
-            KeywordsValidator THROW_ON_IMAP_NON_EXPOSED_KEYWORDS = keyword -> Preconditions.checkArgument(
-                keyword.isExposedImapKeyword(),
-                "Does not allow to update 'Deleted' or 'Recent' flag");
-
-            KeywordsValidator IGNORE_NON_EXPOSED_IMAP_KEYWORDS = keyword -> { };
-
-            void validate(Keyword keywords);
-        }
-
-        @FunctionalInterface
-        interface KeywordFilter extends Predicate<Keyword> {
-            KeywordFilter FILTER_IMAP_NON_EXPOSED_KEYWORDS = Keyword::isExposedImapKeyword;
-            KeywordFilter KEEP_ALL = keyword -> true;
-        }
-
-        @FunctionalInterface
-        interface ToKeyword {
-            ToKeyword STRICT = value -> Optional.of(Keyword.of(value));
-            ToKeyword LENIENT = value -> {
-                Optional<Keyword> result = Keyword.parse(value);
-                if (!result.isPresent()) {
-                    LOGGER.warn("Fail to parse {} flag", value);
-                }
-                return result;
-            };
-
-            Optional<Keyword> toKeyword(String value);
-
-            default Stream<Keyword> asKeywordStream(String value) {
-                return toKeyword(value).stream();
-            }
-        }
-
-        private final KeywordsValidator validator;
-        private final Predicate<Keyword> filter;
-        private final ToKeyword toKeyword;
-
-        public KeywordsFactory(KeywordsValidator validator, Predicate<Keyword> filter, ToKeyword toKeyword) {
-            this.validator = validator;
-            this.filter = filter;
-            this.toKeyword = toKeyword;
-        }
-
-        public Keywords fromSet(Set<Keyword> setKeywords) {
-            return fromStream(setKeywords.stream());
-        }
-
-        public Keywords fromStream(Stream<Keyword> keywordStream) {
-            return new Keywords(keywordStream
-                    .peek(validator::validate)
-                    .filter(filter)
-                    .collect(ImmutableSet.toImmutableSet()));
-        }
-
-        public Keywords from(Keyword... keywords) {
-            return fromStream(Arrays.stream(keywords));
-        }
-
-        public Keywords fromCollection(Collection<String> keywords) {
-            return fromStream(keywords.stream()
-                    .flatMap(toKeyword::asKeywordStream));
-        }
-
-        public Keywords fromMap(Map<String, Boolean> mapKeywords) {
-            Preconditions.checkArgument(mapKeywords.values()
-                .stream()
-                .allMatch(keywordValue -> keywordValue), "Keyword must be true");
-
-            return fromCollection(mapKeywords.keySet());
-        }
-
-        public Keywords fromFlags(Flags flags) {
-            return fromStream(Stream.concat(
-                        Stream.of(flags.getUserFlags())
-                            .flatMap(toKeyword::asKeywordStream),
-                        Stream.of(flags.getSystemFlags())
-                            .map(Keyword::fromFlag)));
-        }
-    }
-
-    /**
-     * This Keywords factory will filter out invalid keywords (containing inavlid character, being too long or being non
-     * exposed IMAP flags)
-     */
-    public static KeywordsFactory strictFactory() {
-        return STRICT_KEYWORDS_FACTORY;
-    }
-
-    /**
-     * This Keywords factory will throw upon invalid keywords (containing inavlid character, being too long or being non
-     * exposed IMAP flags)
-     *
-     * @throws IllegalArgumentException
-     */
-    public static KeywordsFactory lenientFactory() {
-        return LENIENT_KEYWORDS_FACTORY;
-    }
-
-    private final ImmutableSet<Keyword> keywords;
-
-    private Keywords(ImmutableSet<Keyword> keywords) {
-        this.keywords = keywords;
-    }
-
-    public Flags asFlags() {
-        return keywords.stream()
-            .reduce(FlagsBuilder.builder(), this::accumulator, this::combiner)
-            .build();
-    }
-
-    public Flags asFlagsWithRecentAndDeletedFrom(Flags originFlags) {
-        Flags flags = asFlags();
-        if (originFlags.contains(Flags.Flag.DELETED)) {
-            flags.add(Flags.Flag.DELETED);
-        }
-        if (originFlags.contains(Flags.Flag.RECENT)) {
-            flags.add(Flags.Flag.RECENT);
-        }
-
-        return flags;
-    }
-
-    public ImmutableMap<String, Boolean> asMap() {
-        return keywords.stream()
-            .collect(ImmutableMap.toImmutableMap(Keyword::getFlagName, keyword -> Keyword.FLAG_VALUE));
-    }
-
-    public ImmutableSet<Keyword> getKeywords() {
-        return keywords;
-    }
-
-    public boolean contains(Keyword keyword) {
-        return keywords.contains(keyword);
-    }
-
-    @Override
-    public final boolean equals(Object other) {
-        if (other instanceof Keywords) {
-            Keywords otherKeyword = (Keywords) other;
-            return Objects.equal(keywords, otherKeyword.keywords);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hashCode(keywords);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("keywords", keywords)
-            .toString();
-    }
-
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java
deleted file mode 100644
index b256e9d1ab..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Locale;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.function.Function;
-import java.util.stream.Stream;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-public class MessageProperties {
-
-    public static final ImmutableSet<MessageProperty> MANDATORY_PROPERTIES = ImmutableSet.of(MessageProperty.id);
-
-    private final Optional<ImmutableSet<MessageProperty>> messageProperties;
-    private final Optional<ImmutableSet<HeaderProperty>> headersProperties;
-
-    public MessageProperties(Optional<ImmutableSet<String>> properties) {
-        this.messageProperties = properties.map(this::toMessageProperties);
-        this.headersProperties = properties.map(this::toHeadersProperties);
-    }
-
-    private MessageProperties(Optional<ImmutableSet<MessageProperty>> messageProperties,
-                              Optional<ImmutableSet<HeaderProperty>> headersProperties) {
-        this.messageProperties = messageProperties;
-        this.headersProperties = headersProperties;
-    }
-
-    private ImmutableSet<MessageProperty> toMessageProperties(ImmutableSet<String> properties) {
-        return properties.stream().flatMap(MessageProperty::find).collect(ImmutableSet.toImmutableSet());
-    }
-
-    private ImmutableSet<HeaderProperty> toHeadersProperties(ImmutableSet<String> properties) {
-        return properties.stream().flatMap(HeaderProperty::find).collect(ImmutableSet.toImmutableSet());
-    }
-
-    public Optional<ImmutableSet<HeaderProperty>> getOptionalHeadersProperties() {
-        return headersProperties;
-    }
-
-    public Optional<ImmutableSet<MessageProperty>> getOptionalMessageProperties() {
-        return messageProperties;
-    }
-
-    public MessageProperties toOutputProperties() {
-        return this.ensureContains(MANDATORY_PROPERTIES)
-                .selectBody()
-                .overrideHeadersFilteringOnHeadersMessageProperty()
-                .ensureHeadersMessageProperty();
-    }
-
-    public ReadProfile computeReadLevel() {
-        Stream<ReadProfile> readLevels = Stream.concat(this.buildOutputMessageProperties()
-                .stream()
-                .map(MessageProperty::getReadProfile),
-            headerPropertiesReadLevel());
-
-        // If `null`, all properties will be fetched
-        // This defer from RFC-8621 behavior (not implemented here)
-        // If omitted, this defaults to: [ "partId", "blobId", "size", "name", "type", "charset", "disposition", "cid",
-        // "language", "location" ]
-        return readLevels.reduce(ReadProfile::combine)
-            .orElse(ReadProfile.Full);
-    }
-
-    public Stream<String> asFieldList() {
-        return Stream.concat(
-            messageProperties.stream()
-                .flatMap(Collection::stream)
-                .map(MessageProperty::asFieldName),
-            headersProperties.stream()
-                .flatMap(Collection::stream)
-                .map(HeaderProperty::asFieldName));
-    }
-
-    private Stream<ReadProfile> headerPropertiesReadLevel() {
-        return headersProperties.map(collection ->
-            collection.stream()
-                .map(any -> ReadProfile.Header))
-            .orElse(Stream.of());
-    }
-
-    private ImmutableSet<MessageProperty> buildOutputMessageProperties() {
-        return this.messageProperties.orElseGet(MessageProperty::allOutputProperties);
-    }
-
-    private MessageProperties usingProperties(Sets.SetView<MessageProperty> properties) {
-        return new MessageProperties(
-            Optional.of(properties.immutableCopy()),
-            headersProperties);
-    }
-
-    private MessageProperties ensureContains(ImmutableSet<MessageProperty> mandatoryFields) {
-        return usingProperties(Sets.union(buildOutputMessageProperties(), mandatoryFields));
-    }
-
-    private MessageProperties selectBody() {
-        ImmutableSet<MessageProperty> messageProperties = buildOutputMessageProperties();
-        if (messageProperties.contains(MessageProperty.body)) {
-            return usingProperties(
-                Sets.difference(
-                    Sets.union(messageProperties, ImmutableSet.of(MessageProperty.textBody)),
-                    ImmutableSet.of(MessageProperty.body)));
-        }
-        return this;
-    }
-
-    private MessageProperties ensureHeadersMessageProperty() {
-        if (headersProperties.isPresent() && !headersProperties.get().isEmpty()) {
-            return usingProperties(Sets.union(
-                buildOutputMessageProperties(),
-                ImmutableSet.of(MessageProperty.headers)));
-        }
-        return this;
-    }
-
-    private MessageProperties overrideHeadersFilteringOnHeadersMessageProperty() {
-        if (buildOutputMessageProperties().contains(MessageProperty.headers)) {
-            return new MessageProperties(messageProperties, Optional.empty());
-        }
-        return this;
-    }
-
-    private enum PropertyType {
-        INPUTONLY,
-        INPUTOUTPUT
-    }
-
-    public enum MessageProperty implements Property {
-        id("id", ReadProfile.Metadata),
-        blobId("blobId", ReadProfile.Metadata),
-        threadId("threadId", ReadProfile.Metadata),
-        mailboxIds("mailboxIds", ReadProfile.Metadata),
-        inReplyToMessageId("inReplyToMessageId", ReadProfile.Header),
-        isUnread("isUnread", ReadProfile.Metadata),
-        isFlagged("isFlagged", ReadProfile.Metadata),
-        isAnswered("isAnswered", ReadProfile.Metadata),
-        isDraft("isDraft", ReadProfile.Metadata),
-        isForwarded("isForwarded", ReadProfile.Metadata),
-        hasAttachment("hasAttachment", ReadProfile.Fast),
-        headers("headers", ReadProfile.Header),
-        from("from", ReadProfile.Header),
-        to("to", ReadProfile.Header),
-        cc("cc", ReadProfile.Header),
-        bcc("bcc", ReadProfile.Header),
-        replyTo("replyTo", ReadProfile.Header),
-        subject("subject", ReadProfile.Header),
-        date("date", ReadProfile.Header),
-        size("size", ReadProfile.Metadata),
-        preview("preview", ReadProfile.Fast),
-        textBody("textBody", ReadProfile.Full),
-        htmlBody("htmlBody", ReadProfile.Full),
-        attachments("attachments", ReadProfile.Full),
-        attachedMessages("attachedMessages", ReadProfile.Full),
-        keywords("keywords", ReadProfile.Metadata),
-        body("body", PropertyType.INPUTONLY, ReadProfile.Full);
-
-        private final String property;
-        private final PropertyType type;
-        private final ReadProfile readProfile;
-
-        MessageProperty(String property, ReadProfile readProfile) {
-            this(property, PropertyType.INPUTOUTPUT, readProfile);
-        }
-
-        MessageProperty(String property, PropertyType type, ReadProfile readProfile) {
-            this.property = property;
-            this.type = type;
-            this.readProfile = readProfile;
-        }
-
-        @Override
-        public String asFieldName() {
-            return property;
-        }
-
-        public ReadProfile getReadProfile() {
-            return readProfile;
-        }
-
-        private static final ImmutableMap<String, MessageProperty> LOOKUP_MAP = Arrays.stream(values())
-            .collect(ImmutableMap.toImmutableMap(v -> v.property, Function.identity()));
-
-        public static Stream<MessageProperty> find(String property) {
-            Preconditions.checkNotNull(property);
-            return Optional.ofNullable(LOOKUP_MAP.get(property)).stream();
-        }
-
-        public static ImmutableSet<MessageProperty> allOutputProperties() {
-            return Arrays.stream(values()).filter(MessageProperty::outputProperty).collect(ImmutableSet.toImmutableSet());
-        }
-
-        private static boolean outputProperty(MessageProperty p) {
-            switch (p.type) {
-                case INPUTONLY:
-                    return false;
-                case INPUTOUTPUT:
-                    return true;
-                default:
-                    throw new IllegalStateException();
-            }
-        }
-    }
-
-    public enum ReadProfile {
-        Metadata(0),
-        Header(1),
-        Fast(2),
-        Full(3);
-
-        public static ReadProfile combine(ReadProfile readProfile1, ReadProfile readProfile2) {
-            if (readProfile1.priority > readProfile2.priority) {
-                return readProfile1;
-            }
-            return readProfile2;
-        }
-
-        private final int priority;
-
-        ReadProfile(int priority) {
-            this.priority = priority;
-        }
-    }
-
-    public static class HeaderProperty implements Property {
-
-        public static final String HEADER_PROPERTY_PREFIX = "headers.";
-
-        public static HeaderProperty fromFieldName(String field) {
-            Preconditions.checkArgument(!isMessageHeaderProperty(field));
-            return new HeaderProperty(field.toLowerCase(Locale.US));
-        }
-
-        public static HeaderProperty valueOf(String property) {
-            Preconditions.checkArgument(isMessageHeaderProperty(property));
-            return new HeaderProperty(stripPrefix(property).toLowerCase(Locale.US));
-        }
-
-        private static String stripPrefix(String property) {
-            return property.substring(HEADER_PROPERTY_PREFIX.length());
-        }
-
-        public static boolean isMessageHeaderProperty(String property) {
-            Preconditions.checkNotNull(property);
-            return property.startsWith(HEADER_PROPERTY_PREFIX);
-        }
-
-        public static Stream<HeaderProperty> find(String property) {
-            if (isMessageHeaderProperty(property)) {
-                return Stream.of(valueOf(property));
-            } else {
-                return Stream.of();
-            }
-        }
-
-        private String fieldName;
-
-        private HeaderProperty(String fieldName) {
-            this.fieldName = fieldName;
-        }
-
-        @Override
-        public String asFieldName() {
-            return fieldName;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof HeaderProperty) {
-                HeaderProperty other = (HeaderProperty) obj;
-                return Objects.equals(this.fieldName, other.fieldName);
-            }
-            return false;
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hash(fieldName);
-        }
-
-        @Override
-        public String toString() {
-            return Objects.toString(fieldName);
-        }
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("headersProperties", headersProperties)
-            .add("messageProperties", messageProperties)
-            .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MethodCallId.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MethodCallId.java
deleted file mode 100644
index 7a0f53c859..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MethodCallId.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.Objects;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.google.common.base.Preconditions;
-
-public class MethodCallId {
-
-    public static MethodCallId of(String methodCallId) {
-        return new MethodCallId(methodCallId);
-    }
-
-    private final String id;
-
-    private MethodCallId(String id) {
-        Preconditions.checkNotNull(id);
-        Preconditions.checkArgument(!id.isEmpty());
-        this.id = id;
-    }
-
-    @JsonValue
-    public String getId() {
-        return id;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof MethodCallId) {
-            MethodCallId other = (MethodCallId) obj;
-            return Objects.equals(this.id, other.id);
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(id);
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Number.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Number.java
deleted file mode 100644
index 97c72c0617..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Number.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import java.util.Objects;
-import java.util.Optional;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-import com.google.common.math.LongMath;
-
-public class Number {
-
-    public static final Logger LOGGER = LoggerFactory.getLogger(Number.class);
-    public static final String VALIDATION_MESSAGE = "value should be positive and less than 2^53";
-
-    public interface Factory<T> {
-        T from(long value);
-    }
-
-
-    private static final int ZERO_VALUE = 0;
-    public static final long MAX_VALUE = LongMath.pow(2, 53);
-    public static final Number ZERO = new Number(ZERO_VALUE);
-
-    public static final Factory<Optional<Number>> DEFAULT_FACTORY = value -> Optional.of(value)
-        .filter(Number::isValid)
-        .map(Number::new);
-
-    public static final Factory<Number> BOUND_SANITIZING_FACTORY = value -> {
-        if (value < ZERO_VALUE) {
-            LOGGER.warn("Received a negative Number");
-            return new Number(ZERO_VALUE);
-        }
-        if (value > MAX_VALUE) {
-            LOGGER.warn("Received a too big Number");
-            return new Number(MAX_VALUE);
-        }
-        return new Number(value);
-    };
-
-    public static Number fromLong(long value) {
-        return new Number(value);
-    }
-
-    private static boolean isValid(long value) {
-        return value >= ZERO_VALUE && value <= MAX_VALUE;
-    }
-
-    private final long value;
-
-    private Number(long value) {
-        Preconditions.checkArgument(isValid(value), VALIDATION_MESSAGE);
-        this.value = value;
-    }
-
-    @JsonValue
-    public long asLong() {
-        return value;
-    }
-
-    @Override
-    public final boolean equals(Object o) {
-        if (o instanceof Number) {
-            Number number = (Number) o;
-
-            return Objects.equals(this.value, number.value);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hash(value);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("value", value)
-            .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/PreviewDTO.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/PreviewDTO.java
deleted file mode 100644
index 0d68511b01..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/PreviewDTO.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-import java.util.Objects;
-import java.util.Optional;
-
-import org.apache.james.jmap.api.model.Preview;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-
-public class PreviewDTO {
-
-    private static final String NO_BODY_AS_STRING = "(Empty)";
-
-    public static final PreviewDTO NO_BODY = PreviewDTO.of(NO_BODY_AS_STRING);
-
-    public static PreviewDTO from(Optional<Preview> preview) {
-        return preview.map(Preview::getValue)
-            .map(PreviewDTO::of)
-            .orElse(NO_BODY);
-    }
-
-    @VisibleForTesting
-    public static PreviewDTO of(String value) {
-        return new PreviewDTO(value);
-    }
-
-    private final String value;
-
-    private PreviewDTO(String value) {
-        Preconditions.checkNotNull(value);
-
-        this.value = Optional.of(value)
-            .filter(previewValue -> !previewValue.isEmpty())
-            .orElse(NO_BODY_AS_STRING);
-    }
-
-    @JsonValue
-    public String getValue() {
-        return value;
-    }
-
-    @Override
-    public final boolean equals(Object o) {
-        if (o instanceof PreviewDTO) {
-            PreviewDTO that = (PreviewDTO) o;
-
-            return Objects.equals(this.value, that.value);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hash(value);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-            .add("value", value)
-            .toString();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Property.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Property.java
deleted file mode 100644
index d4ee2f4ec2..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/Property.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-public interface Property {
-    String asFieldName();
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/mailbox/Rights.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/mailbox/Rights.java
deleted file mode 100644
index 86adc18312..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/mailbox/Rights.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.mailbox;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.function.BinaryOperator;
-import java.util.function.Predicate;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.james.core.Username;
-import org.apache.james.mailbox.model.MailboxACL;
-import org.apache.james.mailbox.model.MailboxACL.EntryKey;
-import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
-import org.apache.james.util.GuavaUtils;
-import org.apache.james.util.OptionalUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.github.fge.lambdas.Throwing;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableListMultimap;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Multimap;
-
-public class Rights {
-    @VisibleForTesting
-    static final Optional<Boolean> UNSUPPORTED = Optional.empty();
-
-    public enum Right {
-        Administer(MailboxACL.Right.Administer),
-        Expunge(MailboxACL.Right.PerformExpunge),
-        Insert(MailboxACL.Right.Insert),
-        Lookup(MailboxACL.Right.Lookup),
-        Read(MailboxACL.Right.Read),
-        Seen(MailboxACL.Right.WriteSeenFlag),
-        DeleteMessages(MailboxACL.Right.DeleteMessages),
-        Write(MailboxACL.Right.Write);
-
-        private final MailboxACL.Right right;
-
-        Right(MailboxACL.Right right) {
-            this.right = right;
-        }
-
-        @JsonValue
-        public char asCharacter() {
-            return right.asCharacter();
-        }
-
-        public MailboxACL.Right toMailboxRight() {
-            return right;
-        }
-
-        public static Optional<Right> forRight(MailboxACL.Right right) {
-            return OptionalUtils.executeIfEmpty(
-                Arrays.stream(values())
-                    .filter(jmapRight -> jmapRight.right == right)
-                    .findAny(),
-                () -> LOGGER.warn("Non handled right '{}'", right));
-        }
-
-        public static Right forChar(char c) {
-            return Arrays.stream(values())
-                .filter(right -> right.asCharacter() == c)
-                .findAny()
-                .orElseThrow(() -> new IllegalArgumentException("No matching right for '" + c + "'"));
-        }
-    }
-
-    public static class Builder {
-        private Multimap<Username, Right> rights;
-
-        public Builder() {
-            rights = ArrayListMultimap.create();
-        }
-
-        public Builder delegateTo(Username username, Right... rights) {
-            delegateTo(username, Arrays.asList(rights));
-            return this;
-        }
-
-        public Builder delegateTo(Username username, Collection<Right> rights) {
-            this.rights.putAll(username, rights);
-            return this;
-        }
-
-        public Builder combine(Builder builder) {
-            this.rights.putAll(builder.rights);
-            return this;
-        }
-
-        public Rights build() {
-            return new Rights(rights);
-        }
-    }
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    public static Rights fromACL(MailboxACL acl) {
-        return acl.getEntries()
-            .entrySet()
-            .stream()
-            .filter(entry -> isSupported(entry.getKey()))
-            .map(Rights::toRightsBuilder)
-            .reduce(builder(), Builder::combine)
-            .build();
-    }
-
-    private static Builder toRightsBuilder(Map.Entry<EntryKey, MailboxACL.Rfc4314Rights> entry) {
-        return builder().delegateTo(
-            Username.of(entry.getKey().getName()),
-            fromACL(entry.getValue()));
-    }
-
-    private static List<Right> fromACL(MailboxACL.Rfc4314Rights rights) {
-        return rights.list()
-            .stream()
-            .flatMap(right -> Right.forRight(right).stream())
-            .collect(ImmutableList.toImmutableList());
-    }
-
-    private static boolean isSupported(EntryKey key) {
-        if (key.isNegative()) {
-            LOGGER.info("Negative keys are not supported");
-            return false;
-        }
-        if (key.equals(MailboxACL.OWNER_KEY)) {
-            return false;
-        }
-        if (key.getNameType() != MailboxACL.NameType.user) {
-            LOGGER.info("{} is not supported. Only 'user' is.", key.getNameType());
-            return false;
-        }
-        return true;
-    }
-
-    public static final Rights EMPTY = new Rights(ArrayListMultimap.create());
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(Rights.class);
-
-    private final Multimap<Username, Right> rights;
-
-    @JsonCreator
-    public Rights(Map<Username, List<Right>> rights) {
-        this(GuavaUtils.toMultimap(rights));
-    }
-
-    private Rights(Multimap<Username, Right> rights) {
-        this.rights = rights;
-    }
-
-    @JsonAnyGetter
-    public Map<Username, Collection<Right>> getRights() {
-        return rights.asMap();
-    }
-
-    public Rights removeEntriesFor(Username username) {
-        return new Rights(
-            rights.asMap()
-                .entrySet()
-                .stream()
-                .filter(entry -> !entry.getKey().equals(username))
-                .flatMap(entry -> entry.getValue()
-                    .stream()
-                    .map(v -> Pair.of(entry.getKey(), v)))
-                .collect(ImmutableListMultimap.toImmutableListMultimap(Pair::getKey, Pair::getValue)));
-    }
-
-    public MailboxACL toMailboxAcl() {
-        BinaryOperator<MailboxACL> union = Throwing.binaryOperator(MailboxACL::union);
-
-        return rights.asMap()
-            .entrySet()
-            .stream()
-            .map(entry -> new MailboxACL(
-                ImmutableMap.of(
-                    EntryKey.createUserEntryKey(entry.getKey()),
-                    toMailboxAclRights(entry.getValue()))))
-            .reduce(MailboxACL.EMPTY, union);
-    }
-
-    public Optional<Boolean> mayReadItems(Username username) {
-        return containsRight(username, Right.Read);
-    }
-
-    public Optional<Boolean> mayAddItems(Username username) {
-        return containsRight(username, Right.Insert);
-    }
-
-    public Optional<Boolean> mayCreateChild(Username username) {
-        return UNSUPPORTED;
-    }
-
-    public Optional<Boolean> mayRemoveItems(Username username) {
-        return containsRight(username, Right.DeleteMessages);
-    }
-
-    public Optional<Boolean> mayRename(Username username) {
-        return UNSUPPORTED;
-    }
-
-    public Optional<Boolean> mayDelete(Username username) {
-        return UNSUPPORTED;
-    }
-
-    private Optional<Boolean> containsRight(Username username, Right right) {
-        return Optional.ofNullable(rights.get(username))
-            .filter(Predicate.not(Collection::isEmpty))
-            .map(rightList -> rightList.contains(right));
-    }
-
-    private Rfc4314Rights toMailboxAclRights(Collection<Right> rights) {
-        BinaryOperator<Rfc4314Rights> union = Throwing.binaryOperator(Rfc4314Rights::union);
-
-        return rights.stream()
-            .map(Right::toMailboxRight)
-            .map(Throwing.function(Rfc4314Rights::new))
-            .reduce(new Rfc4314Rights(), union);
-    }
-
-    @Override
-    public final boolean equals(Object o) {
-        if (o instanceof Rights) {
-            Rights that = (Rights) o;
-
-            return Objects.equals(this.rights, that.rights);
-        }
-        return false;
-    }
-
-    @Override
-    public final int hashCode() {
-        return Objects.hash(rights);
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastView.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastView.java
deleted file mode 100644
index f236a213a3..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastView.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.time.Instant;
-import java.util.Optional;
-
-import org.apache.james.jmap.api.model.Preview;
-import org.apache.james.jmap.methods.JmapResponseWriterImpl;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.model.PreviewDTO;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-
-import com.fasterxml.jackson.annotation.JsonFilter;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * This message view holds all Message properties expected to be fast.
- */
-@JsonDeserialize(builder = MessageFastView.Builder.class)
-@JsonFilter(JmapResponseWriterImpl.PROPERTIES_FILTER)
-public class MessageFastView extends MessageHeaderView {
-
-    public static MessageFastView.Builder<? extends MessageFastView.Builder> builder() {
-        return new Builder();
-    }
-
-    @JsonPOJOBuilder(withPrefix = "")
-    public static class Builder<S extends MessageFastView.Builder<S>> extends MessageHeaderView.Builder<S> {
-        protected Optional<Preview> preview;
-        protected Optional<Boolean> hasAttachment;
-
-        protected Builder() {
-            super();
-            this.preview = Optional.empty();
-            this.hasAttachment = Optional.empty();
-        }
-
-        public S preview(Preview preview) {
-            this.preview = Optional.of(preview);
-            return (S) this;
-        }
-
-        public S preview(Optional<Preview> preview) {
-            this.preview = preview;
-            return (S) this;
-        }
-
-        public S hasAttachment(boolean hasAttachment) {
-            this.hasAttachment = Optional.of(hasAttachment);
-            return (S) this;
-        }
-
-        public MessageFastView build() {
-            checkState();
-            return new MessageFastView(id, blobId, threadId, mailboxIds, Optional.ofNullable(inReplyToMessageId),
-                headers, from,
-                to.build(), cc.build(), bcc.build(), replyTo.build(), subject, date, size, PreviewDTO.from(preview),
-                keywords.orElse(Keywords.DEFAULT_VALUE), hasAttachment.get());
-        }
-
-        @Override
-        public void checkState() {
-            super.checkState();
-            Preconditions.checkState(preview != null, "'preview' is mandatory");
-            Preconditions.checkState(hasAttachment.isPresent(), "'hasAttachment' should be present");
-        }
-    }
-
-    private final PreviewDTO preview;
-    private final boolean hasAttachment;
-
-    @VisibleForTesting
-    MessageFastView(MessageId id,
-                    BlobId blobId,
-                    String threadId,
-                    ImmutableSet<MailboxId> mailboxIds,
-                    Optional<String> inReplyToMessageId,
-                    ImmutableMap<String, String> headers,
-                    Optional<Emailer> from,
-                    ImmutableList<Emailer> to,
-                    ImmutableList<Emailer> cc,
-                    ImmutableList<Emailer> bcc,
-                    ImmutableList<Emailer> replyTo,
-                    String subject,
-                    Instant date,
-                    Number size,
-                    PreviewDTO preview,
-                    Keywords keywords,
-                    boolean hasAttachment) {
-        super(id, blobId, threadId, mailboxIds, inReplyToMessageId, headers, from, to, cc, bcc, replyTo, subject, date, size, keywords);
-        this.preview = preview;
-        this.hasAttachment = hasAttachment;
-    }
-
-    public PreviewDTO getPreview() {
-        return preview;
-    }
-
-    public boolean isHasAttachment() {
-        return hasAttachment;
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastViewFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastViewFactory.java
deleted file mode 100644
index 0f521bf6e4..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFastViewFactory.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.api.projections.MessageFastViewPrecomputedProperties;
-import org.apache.james.jmap.api.projections.MessageFastViewProjection;
-import org.apache.james.jmap.methods.BlobManager;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.mime4j.dom.Message;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class MessageFastViewFactory implements MessageViewFactory<MessageFastView> {
-
-    private static class FromMessageResultAndPreview implements Helpers.FromMessageResult<MessageFastView> {
-
-        private final BlobManager blobManager;
-        private final Map<MessageId, MessageFastViewPrecomputedProperties> fastProjections;
-
-        private FromMessageResultAndPreview(BlobManager blobManager,
-                                            Map<MessageId, MessageFastViewPrecomputedProperties> fastProjections) {
-            this.blobManager = blobManager;
-            this.fastProjections = fastProjections;
-        }
-
-        @Override
-        public Mono<MessageFastView> fromMessageResults(Collection<MessageResult> messageResults) {
-            Helpers.assertOneMessageId(messageResults);
-            MessageResult firstMessageResult = messageResults.iterator().next();
-            Preconditions.checkArgument(fastProjections.containsKey(firstMessageResult.getMessageId()),
-                "FromMessageResultAndPreview usage requires a precomputed preview");
-
-            return Mono.fromCallable(() -> {
-                MessageFastViewPrecomputedProperties messageProjection = fastProjections.get(firstMessageResult.getMessageId());
-                Set<MailboxId> mailboxIds = Helpers.getMailboxIds(messageResults);
-
-                Message mimeMessage = Helpers.parse(firstMessageResult.getFullContent().getInputStream());
-
-                return instanciateFastView(messageResults, firstMessageResult, messageProjection, mailboxIds, mimeMessage);
-            });
-        }
-
-        private MessageFastView instanciateFastView(Collection<MessageResult> messageResults, MessageResult firstMessageResult, MessageFastViewPrecomputedProperties messageProjection, Set<MailboxId> mailboxIds, Message mimeMessage) {
-            return MessageFastView.builder()
-                .id(firstMessageResult.getMessageId())
-                .mailboxIds(mailboxIds)
-                .blobId(BlobId.of(firstMessageResult.getMessageId()))
-                .threadId(firstMessageResult.getMessageId().serialize())
-                .keywords(Helpers.getKeywords(messageResults))
-                .size(firstMessageResult.getSize())
-                .inReplyToMessageId(Helpers.getHeaderValue(mimeMessage, "in-reply-to"))
-                .subject(Strings.nullToEmpty(mimeMessage.getSubject()).trim())
-                .headers(Helpers.toHeaderMap(mimeMessage.getHeader()))
-                .from(Emailer.firstFromMailboxList(mimeMessage.getFrom()))
-                .to(Emailer.fromAddressList(mimeMessage.getTo()))
-                .cc(Emailer.fromAddressList(mimeMessage.getCc()))
-                .bcc(Emailer.fromAddressList(mimeMessage.getBcc()))
-                .replyTo(Emailer.fromAddressList(mimeMessage.getReplyTo()))
-                .date(Helpers.getDateFromHeaderOrInternalDateOtherwise(mimeMessage, firstMessageResult))
-                .preview(messageProjection.getPreview())
-                .hasAttachment(messageProjection.hasAttachment())
-                .build();
-        }
-    }
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(MessageFastViewFactory.class);
-
-    private final BlobManager blobManager;
-    private final MessageIdManager messageIdManager;
-    private final MessageFastViewProjection fastViewProjection;
-    private final MessageFullViewFactory messageFullViewFactory;
-
-    @Inject
-    @VisibleForTesting
-    public MessageFastViewFactory(BlobManager blobManager, MessageIdManager messageIdManager, MessageFastViewProjection fastViewProjection,
-                                  MessageFullViewFactory messageFullViewFactory) {
-        this.blobManager = blobManager;
-        this.messageIdManager = messageIdManager;
-        this.fastViewProjection = fastViewProjection;
-        this.messageFullViewFactory = messageFullViewFactory;
-    }
-
-    @Override
-    public Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) {
-        ImmutableSet<MessageId> messageIdSet = ImmutableSet.copyOf(messageIds);
-        return Mono.from(fastViewProjection.retrieve(messageIds))
-            .flatMapMany(fastProjections -> gatherMessageViews(messageIdSet, mailboxSession, fastProjections));
-    }
-
-    private Flux<MessageFastView> gatherMessageViews(Set<MessageId> messageIds, MailboxSession mailboxSession,
-                                                     Map<MessageId, MessageFastViewPrecomputedProperties> fastProjections) {
-        Set<MessageId> withProjectionEntry = fastProjections.keySet();
-        Set<MessageId> withoutProjectionEntry = Sets.difference(messageIds, withProjectionEntry);
-        return Flux.merge(
-            Helpers.toMessageViews(fetch(withProjectionEntry, FetchGroup.HEADERS, mailboxSession),
-                new FromMessageResultAndPreview(blobManager, fastProjections)),
-            Helpers.toMessageViews(fetch(withoutProjectionEntry, FetchGroup.FULL_CONTENT, mailboxSession),
-                messageFullViewFactory::fromMessageResults));
-    }
-
-    private Flux<MessageResult> fetch(Collection<MessageId> messageIds, FetchGroup fetchGroup, MailboxSession mailboxSession) {
-        if (messageIds.isEmpty()) {
-            return Flux.empty();
-        }
-        return Flux.from(messageIdManager.getMessagesReactive(messageIds, fetchGroup, mailboxSession))
-            .onErrorResume(MailboxException.class, ex -> {
-                LOGGER.error("cannot read messages {}", messageIds, ex);
-                return Flux.empty();
-            });
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullView.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullView.java
deleted file mode 100644
index 86990f08d7..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullView.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.time.Instant;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Predicate;
-
-import org.apache.james.jmap.methods.JmapResponseWriterImpl;
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.model.PreviewDTO;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-
-import com.fasterxml.jackson.annotation.JsonFilter;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-@JsonDeserialize(builder = MessageFullView.Builder.class)
-@JsonFilter(JmapResponseWriterImpl.PROPERTIES_FILTER)
-public class MessageFullView extends MessageFastView {
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    @JsonPOJOBuilder(withPrefix = "")
-    public static class Builder extends MessageFastView.Builder<MessageFullView.Builder> {
-        private Optional<String> textBody = Optional.empty();
-        private Optional<String> htmlBody = Optional.empty();
-        private final ImmutableList.Builder<Attachment> attachments;
-        private final ImmutableMap.Builder<BlobId, SubMessage> attachedMessages;
-
-        private Builder() {
-            super();
-            attachments = ImmutableList.builder();
-            attachedMessages = ImmutableMap.builder();
-        }
-
-        public Builder textBody(Optional<String> textBody) {
-            this.textBody = textBody;
-            return this;
-        }
-
-        public Builder htmlBody(Optional<String> htmlBody) {
-            this.htmlBody = htmlBody;
-            return this;
-        }
-
-        public Builder attachments(List<Attachment> attachments) {
-            this.attachments.addAll(attachments);
-            boolean hasAttachments = MessageFullView.hasAttachment(this.attachments.build());
-            return super.hasAttachment(hasAttachments);
-        }
-
-        public Builder attachedMessages(Map<BlobId, SubMessage> attachedMessages) {
-            this.attachedMessages.putAll(attachedMessages);
-            return this;
-        }
-
-        public MessageFullView build() {
-            ImmutableList<Attachment> attachments = this.attachments.build();
-            ImmutableMap<BlobId, SubMessage> attachedMessages = this.attachedMessages.build();
-            checkState(attachments, attachedMessages);
-
-            return new MessageFullView(id, blobId, threadId, mailboxIds, Optional.ofNullable(inReplyToMessageId),
-                hasAttachment.get(), headers, from,
-                to.build(), cc.build(), bcc.build(), replyTo.build(), subject, date, size, PreviewDTO.from(preview), textBody, htmlBody, attachments, attachedMessages,
-                keywords.orElse(Keywords.DEFAULT_VALUE));
-        }
-
-        private void checkState(ImmutableList<Attachment> attachments, ImmutableMap<BlobId, SubMessage> attachedMessages) {
-            super.checkState();
-            Preconditions.checkState(areAttachedMessagesKeysInAttachments(attachments, attachedMessages), "'attachedMessages' keys must be in 'attachements'");
-        }
-    }
-
-    static boolean hasAttachment(List<Attachment> attachments) {
-        return attachments.stream()
-            .anyMatch(attachment -> !attachment.isInlinedWithCid());
-    }
-
-    protected static boolean areAttachedMessagesKeysInAttachments(ImmutableList<Attachment> attachments, ImmutableMap<BlobId, SubMessage> attachedMessages) {
-        return attachedMessages.isEmpty() || attachedMessages.keySet().stream()
-                .anyMatch(inAttachments(attachments));
-    }
-
-    private static Predicate<BlobId> inAttachments(ImmutableList<Attachment> attachments) {
-        return (key) -> attachments.stream()
-            .map(Attachment::getBlobId)
-            .anyMatch(blobId -> blobId.equals(key));
-    }
-
-    private final boolean hasAttachment;
-    private final Optional<String> textBody;
-    private final Optional<String> htmlBody;
-    private final ImmutableList<Attachment> attachments;
-    private final ImmutableMap<BlobId, SubMessage> attachedMessages;
-
-    @VisibleForTesting
-    MessageFullView(MessageId id,
-                    BlobId blobId,
-                    String threadId,
-                    ImmutableSet<MailboxId> mailboxIds,
-                    Optional<String> inReplyToMessageId,
-                    boolean hasAttachment,
-                    ImmutableMap<String, String> headers,
-                    Optional<Emailer> from,
-                    ImmutableList<Emailer> to,
-                    ImmutableList<Emailer> cc,
-                    ImmutableList<Emailer> bcc,
-                    ImmutableList<Emailer> replyTo,
-                    String subject,
-                    Instant date,
-                    Number size,
-                    PreviewDTO preview,
-                    Optional<String> textBody,
-                    Optional<String> htmlBody,
-                    ImmutableList<Attachment> attachments,
-                    ImmutableMap<BlobId, SubMessage> attachedMessages,
-                    Keywords keywords) {
-        super(id, blobId, threadId, mailboxIds, inReplyToMessageId, headers, from, to, cc, bcc, replyTo, subject, date, size, preview, keywords, hasAttachment);
-        this.hasAttachment = hasAttachment;
-        this.textBody = textBody;
-        this.htmlBody = htmlBody;
-        this.attachments = attachments;
-        this.attachedMessages = attachedMessages;
-    }
-
-    public boolean isHasAttachment() {
-        return hasAttachment;
-    }
-
-    public Optional<String> getTextBody() {
-        return textBody;
-    }
-
-    public Optional<String> getHtmlBody() {
-        return htmlBody;
-    }
-
-    public ImmutableList<Attachment> getAttachments() {
-        return attachments;
-    }
-
-    public ImmutableMap<BlobId, SubMessage> getAttachedMessages() {
-        return attachedMessages;
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullViewFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullViewFactory.java
deleted file mode 100644
index 4b2860744a..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageFullViewFactory.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.time.Instant;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.function.Supplier;
-
-import jakarta.inject.Inject;
-import jakarta.mail.internet.SharedInputStream;
-
-import org.apache.james.jmap.api.model.Preview;
-import org.apache.james.jmap.api.projections.MessageFastViewPrecomputedProperties;
-import org.apache.james.jmap.api.projections.MessageFastViewProjection;
-import org.apache.james.jmap.methods.BlobManager;
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageUid;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.Cid;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageAttachmentMetadata;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.util.ReactorUtils;
-import org.apache.james.util.html.HtmlTextExtractor;
-import org.apache.james.util.mime.MessageContentExtractor;
-import org.apache.james.util.mime.MessageContentExtractor.MessageContent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Sets;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
-
-
-public class MessageFullViewFactory implements MessageViewFactory<MessageFullView> {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(MessageFullViewFactory.class);
-
-    private final BlobManager blobManager;
-    private final MessageContentExtractor messageContentExtractor;
-    private final HtmlTextExtractor htmlTextExtractor;
-    private final MessageIdManager messageIdManager;
-    private final MessageFastViewProjection fastViewProjection;
-
-    @Inject
-    public MessageFullViewFactory(BlobManager blobManager, MessageContentExtractor messageContentExtractor,
-                                  HtmlTextExtractor htmlTextExtractor, MessageIdManager messageIdManager,
-                                  MessageFastViewProjection fastViewProjection) {
-        this.blobManager = blobManager;
-        this.messageContentExtractor = messageContentExtractor;
-        this.htmlTextExtractor = htmlTextExtractor;
-        this.messageIdManager = messageIdManager;
-        this.fastViewProjection = fastViewProjection;
-    }
-
-    @Override
-    public Flux<MessageFullView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) {
-        Flux<MessageResult> messages = Flux.from(messageIdManager.getMessagesReactive(messageIds, FetchGroup.FULL_CONTENT, mailboxSession));
-        return Helpers.toMessageViews(messages, this::fromMessageResults);
-    }
-
-    public Mono<MessageFullView> fromMetaDataWithContent(MetaDataWithContent message) {
-        return Mono.fromCallable(() -> Helpers.retrieveMessage(message))
-            .flatMap(Throwing.function(mimeMessage -> fromMetaDataWithContent(message, mimeMessage)));
-    }
-
-    private Mono<MessageFullView> fromMetaDataWithContent(MetaDataWithContent message, Message mimeMessage) throws IOException {
-        MessageContent messageContent = messageContentExtractor.extract(mimeMessage);
-        Optional<String> htmlBody = messageContent.getHtmlBody();
-        Optional<String> textBody = computeTextBodyIfNeeded(messageContent);
-
-        return retrieveProjection(messageContent, message.getMessageId(),
-                () -> MessageFullView.hasAttachment(getAttachments(message.getAttachments())))
-            .map(messageProjection -> instanciateMessageFullView(message, mimeMessage, htmlBody, textBody, messageProjection));
-    }
-
-    private MessageFullView instanciateMessageFullView(MetaDataWithContent message, Message mimeMessage, Optional<String> htmlBody, Optional<String> textBody, MessageFastViewPrecomputedProperties messageProjection) {
-        return MessageFullView.builder()
-                .id(message.getMessageId())
-                .blobId(BlobId.of(message.getMessageId()))
-                .threadId(message.getMessageId().serialize())
-                .mailboxIds(message.getMailboxIds())
-                .inReplyToMessageId(Helpers.getHeaderValue(mimeMessage, "in-reply-to"))
-                .keywords(message.getKeywords())
-                .subject(Strings.nullToEmpty(mimeMessage.getSubject()).trim())
-                .headers(Helpers.toHeaderMap(mimeMessage.getHeader()))
-                .from(Emailer.firstFromMailboxList(mimeMessage.getFrom()))
-                .to(Emailer.fromAddressList(mimeMessage.getTo()))
-                .cc(Emailer.fromAddressList(mimeMessage.getCc()))
-                .bcc(Emailer.fromAddressList(mimeMessage.getBcc()))
-                .replyTo(Emailer.fromAddressList(mimeMessage.getReplyTo()))
-                .size(message.getSize())
-                .date(getDateFromHeaderOrInternalDateOtherwise(mimeMessage, message))
-                .textBody(textBody)
-                .htmlBody(htmlBody)
-                .preview(messageProjection.getPreview())
-                .attachments(getAttachments(message.getAttachments()))
-                .build();
-    }
-
-    private Mono<MessageFastViewPrecomputedProperties> retrieveProjection(MessageContent messageContent,
-                                                                    MessageId messageId, Supplier<Boolean> hasAttachments) {
-        return Mono.from(fastViewProjection.retrieve(messageId))
-            .onErrorResume(throwable -> fallBackToCompute(messageContent, hasAttachments, throwable))
-            .switchIfEmpty(computeThenStoreAsync(messageContent, messageId, hasAttachments));
-    }
-
-    private Mono<MessageFastViewPrecomputedProperties> fallBackToCompute(MessageContent messageContent,
-                                                                         Supplier<Boolean> hasAttachments,
-                                                                         Throwable throwable) {
-        LOGGER.error("Cannot retrieve the computed preview from MessageFastViewProjection", throwable);
-        return computeProjection(messageContent, hasAttachments);
-    }
-
-    private Mono<MessageFastViewPrecomputedProperties> computeThenStoreAsync(MessageContent messageContent,
-                                                                             MessageId messageId,
-                                                                             Supplier<Boolean> hasAttachments) {
-        return computeProjection(messageContent, hasAttachments)
-            .doOnNext(projection -> Mono.from(fastViewProjection.store(messageId, projection))
-                .doOnError(throwable -> LOGGER.error("Cannot store the projection to MessageFastViewProjection", throwable))
-                .subscribeOn(Schedulers.parallel())
-                .subscribe());
-    }
-
-    private Mono<MessageFastViewPrecomputedProperties> computeProjection(MessageContent messageContent, Supplier<Boolean> hasAttachments) {
-        return Mono.fromCallable(() -> mainTextContent(messageContent))
-            .handle(ReactorUtils.publishIfPresent())
-            .map(Preview::compute)
-            .defaultIfEmpty(Preview.EMPTY)
-            .map(extractedPreview -> MessageFastViewPrecomputedProperties.builder()
-                .preview(extractedPreview)
-                .hasAttachment(hasAttachments.get())
-                .build());
-    }
-
-    private Instant getDateFromHeaderOrInternalDateOtherwise(Message mimeMessage, MessageFullViewFactory.MetaDataWithContent message) {
-        return Optional.ofNullable(mimeMessage.getDate())
-            .map(Date::toInstant)
-            .orElse(message.getInternalDate());
-    }
-
-    Mono<MessageFullView> fromMessageResults(Collection<MessageResult> messageResults) {
-        try {
-            return fromMetaDataWithContent(toMetaDataWithContent(messageResults));
-        } catch (MailboxException e) {
-            return Mono.error(e);
-        }
-    }
-
-    private MetaDataWithContent toMetaDataWithContent(Collection<MessageResult> messageResults) throws MailboxException {
-        Helpers.assertOneMessageId(messageResults);
-
-        MessageResult firstMessageResult = messageResults.iterator().next();
-        Set<MailboxId> mailboxIds = Helpers.getMailboxIds(messageResults);
-        Keywords keywords = Helpers.getKeywords(messageResults);
-
-        return MetaDataWithContent.builderFromMessageResult(firstMessageResult)
-            .messageId(firstMessageResult.getMessageId())
-            .mailboxIds(mailboxIds)
-            .keywords(keywords)
-            .build();
-    }
-
-    private Optional<String> computeTextBodyIfNeeded(MessageContent messageContent) {
-        return messageContent.getTextBody()
-            .or(() -> messageContent.extractMainTextContent(htmlTextExtractor));
-    }
-
-    private Optional<String> mainTextContent(MessageContent messageContent) {
-        return messageContent.getHtmlBody()
-            .map(htmlTextExtractor::toPlainText)
-            .filter(Predicate.not(Strings::isNullOrEmpty))
-            .or(messageContent::getTextBody);
-    }
-
-    private List<Attachment> getAttachments(List<MessageAttachmentMetadata> attachments) {
-        return attachments.stream()
-                .map(this::fromMailboxAttachment)
-                .collect(ImmutableList.toImmutableList());
-    }
-
-    private Attachment fromMailboxAttachment(MessageAttachmentMetadata attachment) {
-        return Attachment.builder()
-                    .blobId(BlobId.of(attachment.getAttachmentId()))
-                    .type(attachment.getAttachment().getType())
-                    .size(attachment.getAttachment().getSize())
-                    .name(attachment.getName())
-                    .cid(attachment.getCid().map(Cid::getValue))
-                    .isInline(attachment.isInline())
-                    .build();
-    }
-
-    public static class MetaDataWithContent {
-        public static Builder builder() {
-            return new Builder();
-        }
-
-        public static Builder builderFromMessageResult(MessageResult messageResult) throws MailboxException {
-            Builder builder = builder()
-                .uid(messageResult.getUid())
-                .size(messageResult.getSize())
-                .internalDate(messageResult.getInternalDate().toInstant())
-                .attachments(messageResult.getLoadedAttachments())
-                .mailboxId(messageResult.getMailboxId());
-            try {
-                return builder.content(messageResult.getFullContent().getInputStream());
-            } catch (IOException e) {
-                throw new MailboxException("Can't get message full content: " + e.getMessage(), e);
-            }
-        }
-
-        public static class Builder {
-            private MessageUid uid;
-            private Keywords keywords;
-            private Long size;
-            private Instant internalDate;
-            private InputStream content;
-            private SharedInputStream sharedContent;
-            private List<MessageAttachmentMetadata> attachments;
-            private Set<MailboxId> mailboxIds = Sets.newHashSet();
-            private MessageId messageId;
-            private Optional<Message> message;
-
-            public Builder() {
-                this.message = Optional.empty();
-            }
-
-            public Builder uid(MessageUid uid) {
-                this.uid = uid;
-                return this;
-            }
-
-            public Builder keywords(Keywords keywords) {
-                this.keywords = keywords;
-                return this;
-            }
-
-            public Builder size(long size) {
-                this.size = size;
-                return this;
-            }
-
-            public Builder internalDate(Instant internalDate) {
-                this.internalDate = internalDate;
-                return this;
-            }
-
-            public Builder content(InputStream content) {
-                this.content = content;
-                return this;
-            }
-
-            public Builder sharedContent(SharedInputStream sharedContent) {
-                this.sharedContent = sharedContent;
-                return this;
-            }
-
-            public Builder attachments(List<MessageAttachmentMetadata> attachments) {
-                this.attachments = attachments;
-                return this;
-            }
-
-            public Builder mailboxId(MailboxId mailboxId) {
-                this.mailboxIds.add(mailboxId);
-                return this;
-            }
-
-            public Builder message(Message message) {
-                this.message = Optional.of(message);
-                return this;
-            }
-
-            public Builder mailboxIds(Set<MailboxId> mailboxIds) {
-                this.mailboxIds.addAll(mailboxIds);
-                return this;
-            }
-
-            public Builder messageId(MessageId messageId) {
-                this.messageId = messageId;
-                return this;
-            }
-
-            public MetaDataWithContent build() {
-                Preconditions.checkArgument(uid != null);
-                Preconditions.checkArgument(keywords != null);
-                Preconditions.checkArgument(size != null);
-                Preconditions.checkArgument(internalDate != null);
-                Preconditions.checkArgument(content != null ^ sharedContent != null);
-                Preconditions.checkArgument(attachments != null);
-                Preconditions.checkArgument(mailboxIds != null);
-                Preconditions.checkArgument(messageId != null);
-
-                return new MetaDataWithContent(uid, keywords, size, internalDate, content, sharedContent, attachments, mailboxIds, messageId, message);
-            }
-        }
-
-        private final MessageUid uid;
-        private final Keywords keywords;
-        private final long size;
-        private final Instant internalDate;
-        private final InputStream content;
-        private final SharedInputStream sharedContent;
-        private final List<MessageAttachmentMetadata> attachments;
-        private final Set<MailboxId> mailboxIds;
-        private final MessageId messageId;
-        private final Optional<Message> message;
-
-        private MetaDataWithContent(MessageUid uid,
-                                    Keywords keywords,
-                                    long size,
-                                    Instant internalDate,
-                                    InputStream content,
-                                    SharedInputStream sharedContent,
-                                    List<MessageAttachmentMetadata> attachments,
-                                    Set<MailboxId> mailboxIds,
-                                    MessageId messageId, Optional<Message> message) {
-            this.uid = uid;
-            this.keywords = keywords;
-            this.size = size;
-            this.internalDate = internalDate;
-            this.content = content;
-            this.sharedContent = sharedContent;
-            this.attachments = attachments;
-            this.mailboxIds = mailboxIds;
-            this.messageId = messageId;
-            this.message = message;
-        }
-
-        public Optional<Message> getMessage() {
-            return message;
-        }
-
-        public MessageUid getUid() {
-            return uid;
-        }
-
-        public Keywords getKeywords() {
-            return keywords;
-        }
-
-        public long getSize() {
-            return size;
-        }
-
-        public Instant getInternalDate() {
-            return internalDate;
-        }
-
-        public InputStream getContent() {
-            if (sharedContent != null) {
-                long begin = 0;
-                long allContent = -1;
-                return sharedContent.newStream(begin, allContent);
-            }
-            return content;
-        }
-
-        public List<MessageAttachmentMetadata> getAttachments() {
-            return attachments;
-        }
-
-        public Set<MailboxId> getMailboxIds() {
-            return mailboxIds;
-        }
-
-        public MessageId getMessageId() {
-            return messageId;
-        }
-
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderView.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderView.java
deleted file mode 100644
index 20fa3589fc..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderView.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.time.Instant;
-import java.util.List;
-import java.util.Optional;
-
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-
-import com.fasterxml.jackson.annotation.JsonFilter;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-public class MessageHeaderView extends MessageMetadataView {
-
-    public static MessageHeaderView.Builder<? extends MessageHeaderView.Builder> messageHeaderBuilder() {
-        return new Builder();
-    }
-
-    public static class Builder<S extends MessageHeaderView.Builder<S>> extends MessageMetadataView.Builder<S> {
-        protected String inReplyToMessageId;
-        protected ImmutableMap<String, String> headers;
-        protected Optional<Emailer> from;
-        protected final ImmutableList.Builder<Emailer> to;
-        protected final ImmutableList.Builder<Emailer> cc;
-        protected final ImmutableList.Builder<Emailer> bcc;
-        protected final ImmutableList.Builder<Emailer> replyTo;
-        protected String subject;
-        protected Instant date;
-
-        protected Builder() {
-            super();
-            from = Optional.empty();
-            to = ImmutableList.builder();
-            cc = ImmutableList.builder();
-            bcc = ImmutableList.builder();
-            replyTo = ImmutableList.builder();
-        }
-
-        public S inReplyToMessageId(String inReplyToMessageId) {
-            this.inReplyToMessageId = inReplyToMessageId;
-            return (S) this;
-        }
-
-        public S headers(ImmutableMap<String, String> headers) {
-            this.headers = headers;
-            return (S) this;
-        }
-
-        public S from(Emailer from) {
-            this.from = Optional.of(from);
-            return (S) this;
-        }
-
-        public S from(Optional<Emailer> from) {
-            this.from = from;
-            return (S) this;
-        }
-
-        public S to(List<Emailer> to) {
-            this.to.addAll(to);
-            return (S) this;
-        }
-
-        public S cc(List<Emailer> cc) {
-            this.cc.addAll(cc);
-            return (S) this;
-        }
-
-        public S bcc(List<Emailer> bcc) {
-            this.bcc.addAll(bcc);
-            return (S) this;
-        }
-
-        public S replyTo(List<Emailer> replyTo) {
-            this.replyTo.addAll(replyTo);
-            return (S) this;
-        }
-
-        public S subject(String subject) {
-            this.subject = subject;
-            return (S) this;
-        }
-
-        public S date(Instant date) {
-            this.date = date;
-            return (S) this;
-        }
-
-        public MessageHeaderView build() {
-            checkState();
-
-            return new MessageHeaderView(id, blobId, threadId, mailboxIds, Optional.ofNullable(inReplyToMessageId),
-                headers, from,
-                to.build(), cc.build(), bcc.build(), replyTo.build(), subject, date, size,
-                keywords.orElse(Keywords.DEFAULT_VALUE));
-        }
-
-        @Override
-        protected void checkState() {
-            super.checkState();
-            Preconditions.checkState(headers != null, "'headers' is mandatory");
-            Preconditions.checkState(date != null, "'date' is mandatory");
-        }
-    }
-
-    private final Optional<String> inReplyToMessageId;
-    @JsonFilter("headersFilter")
-    private final ImmutableMap<String, String> headers;
-    private final Optional<Emailer> from;
-    private final ImmutableList<Emailer> to;
-    private final ImmutableList<Emailer> cc;
-    private final ImmutableList<Emailer> bcc;
-    private final ImmutableList<Emailer> replyTo;
-    private final String subject;
-    private final Instant date;
-
-    @VisibleForTesting
-    MessageHeaderView(MessageId id,
-                      BlobId blobId,
-                      String threadId,
-                      ImmutableSet<MailboxId> mailboxIds,
-                      Optional<String> inReplyToMessageId,
-                      ImmutableMap<String, String> headers,
-                      Optional<Emailer> from,
-                      ImmutableList<Emailer> to,
-                      ImmutableList<Emailer> cc,
-                      ImmutableList<Emailer> bcc,
-                      ImmutableList<Emailer> replyTo,
-                      String subject,
-                      Instant date,
-                      Number size,
-                      Keywords keywords) {
-        super(id, blobId, threadId, mailboxIds, size, keywords);
-        this.inReplyToMessageId = inReplyToMessageId;
-        this.headers = headers;
-        this.from = from;
-        this.to = to;
-        this.cc = cc;
-        this.bcc = bcc;
-        this.replyTo = replyTo;
-        this.subject = subject;
-        this.date = date;
-    }
-
-    public Optional<String> getInReplyToMessageId() {
-        return inReplyToMessageId;
-    }
-
-    public ImmutableMap<String, String> getHeaders() {
-        return headers;
-    }
-
-    public Optional<Emailer> getFrom() {
-        return from;
-    }
-
-    public ImmutableList<Emailer> getTo() {
-        return to;
-    }
-
-    public ImmutableList<Emailer> getCc() {
-        return cc;
-    }
-
-    public ImmutableList<Emailer> getBcc() {
-        return bcc;
-    }
-
-    public ImmutableList<Emailer> getReplyTo() {
-        return replyTo;
-    }
-
-    public String getSubject() {
-        return subject;
-    }
-
-    public Instant getDate() {
-        return date;
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactory.java
deleted file mode 100644
index f431a4c91e..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactory.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.util.Collection;
-import java.util.List;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.methods.BlobManager;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.mime4j.dom.Message;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Strings;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class MessageHeaderViewFactory implements MessageViewFactory<MessageHeaderView> {
-    private final BlobManager blobManager;
-    private final MessageIdManager messageIdManager;
-
-    @Inject
-    @VisibleForTesting
-    public MessageHeaderViewFactory(BlobManager blobManager, MessageIdManager messageIdManager) {
-        this.blobManager = blobManager;
-        this.messageIdManager = messageIdManager;
-    }
-
-    @Override
-    public Flux<MessageHeaderView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) {
-        Flux<MessageResult> messages = Flux.from(messageIdManager.getMessagesReactive(messageIds, FetchGroup.HEADERS, mailboxSession));
-        return Helpers.toMessageViews(messages, this::fromMessageResults);
-    }
-
-    private Mono<MessageHeaderView> fromMessageResults(Collection<MessageResult> messageResults) {
-        Helpers.assertOneMessageId(messageResults);
-
-
-        return Mono.fromCallable(() -> messageResults.iterator().next())
-            .flatMap(Throwing.function(firstMessageResult -> {
-                Collection<MailboxId> mailboxIds = Helpers.getMailboxIds(messageResults);
-                Message mimeMessage = Helpers.parse(firstMessageResult.getFullContent().getInputStream());
-                return instanciateHeaderView(messageResults, firstMessageResult, mailboxIds, mimeMessage);
-            }));
-    }
-
-    private Mono<MessageHeaderView> instanciateHeaderView(Collection<MessageResult> messageResults, MessageResult firstMessageResult,
-                                                          Collection<MailboxId> mailboxIds, Message mimeMessage) {
-        return Mono.just(MessageHeaderView.messageHeaderBuilder()
-            .id(firstMessageResult.getMessageId())
-            .mailboxIds(mailboxIds)
-            .blobId(BlobId.of(firstMessageResult.getMessageId()))
-            .threadId(firstMessageResult.getMessageId().serialize())
-            .keywords(Helpers.getKeywords(messageResults))
-            .size(firstMessageResult.getSize())
-            .inReplyToMessageId(Helpers.getHeaderValue(mimeMessage, "in-reply-to"))
-            .subject(Strings.nullToEmpty(mimeMessage.getSubject()).trim())
-            .headers(Helpers.toHeaderMap(mimeMessage.getHeader()))
-            .from(Emailer.firstFromMailboxList(mimeMessage.getFrom()))
-            .to(Emailer.fromAddressList(mimeMessage.getTo()))
-            .cc(Emailer.fromAddressList(mimeMessage.getCc()))
-            .bcc(Emailer.fromAddressList(mimeMessage.getBcc()))
-            .replyTo(Emailer.fromAddressList(mimeMessage.getReplyTo()))
-            .date(Helpers.getDateFromHeaderOrInternalDateOtherwise(mimeMessage, firstMessageResult))
-            .build());
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataView.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataView.java
deleted file mode 100644
index e71508a154..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataView.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Optional;
-
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-public class MessageMetadataView implements MessageView {
-
-    public static Builder messageMetadataBuilder() {
-        return new Builder();
-    }
-
-    public static class Builder<S extends Builder<S>> {
-        protected MessageId id;
-        protected BlobId blobId;
-        protected String threadId;
-        protected ImmutableSet<MailboxId> mailboxIds;
-        protected Number size;
-        protected Optional<Keywords> keywords = Optional.empty();
-
-        public S id(MessageId id) {
-            this.id = id;
-            return (S) this;
-        }
-
-        public S blobId(BlobId blobId) {
-            this.blobId = blobId;
-            return (S) this;
-        }
-
-        public S threadId(String threadId) {
-            this.threadId = threadId;
-            return (S) this;
-        }
-
-        @JsonIgnore
-        public S mailboxId(MailboxId mailboxId) {
-            return this.fluentMailboxIds(mailboxId);
-        }
-
-        @JsonIgnore
-        public S fluentMailboxIds(MailboxId... mailboxIds) {
-            return this.mailboxIds(Arrays.asList((mailboxIds)));
-        }
-
-        public S mailboxIds(Collection<MailboxId> mailboxIds) {
-            this.mailboxIds = ImmutableSet.copyOf(mailboxIds);
-            return (S) this;
-        }
-
-        public S keywords(Keywords keywords) {
-            this.keywords = Optional.ofNullable(keywords);
-            return (S) this;
-        }
-
-        public S size(long size) {
-            this.size = Number.BOUND_SANITIZING_FACTORY.from(size);
-            return (S) this;
-        }
-
-        public MessageMetadataView build() {
-            checkState();
-
-            return new MessageMetadataView(id, blobId, threadId, mailboxIds, size, keywords.orElse(Keywords.DEFAULT_VALUE));
-        }
-
-        protected void checkState() {
-            Preconditions.checkState(id != null, "'id' is mandatory");
-            Preconditions.checkState(blobId != null, "'blobId' is mandatory");
-            Preconditions.checkState(!Strings.isNullOrEmpty(threadId), "'threadId' is mandatory");
-            Preconditions.checkState(mailboxIds != null, "'mailboxIds' is mandatory");
-            Preconditions.checkState(size != null, "'size' is mandatory");
-        }
-    }
-
-    private final MessageId id;
-    private final BlobId blobId;
-    private final String threadId;
-    private final ImmutableSet<MailboxId> mailboxIds;
-    private final Number size;
-    private final Keywords keywords;
-
-    @VisibleForTesting
-    MessageMetadataView(MessageId id, BlobId blobId, String threadId, ImmutableSet<MailboxId> mailboxIds, Number size, Keywords keywords) {
-        this.id = id;
-        this.blobId = blobId;
-        this.threadId = threadId;
-        this.mailboxIds = mailboxIds;
-        this.size = size;
-        this.keywords = keywords;
-    }
-
-    public MessageId getId() {
-        return id;
-    }
-
-    public BlobId getBlobId() {
-        return blobId;
-    }
-
-    public String getThreadId() {
-        return threadId;
-    }
-
-    public ImmutableSet<MailboxId> getMailboxIds() {
-        return mailboxIds;
-    }
-
-    public boolean isIsUnread() {
-        return !keywords.contains(Keyword.SEEN);
-    }
-
-    public boolean isIsFlagged() {
-        return keywords.contains(Keyword.FLAGGED);
-    }
-
-    public boolean isIsAnswered() {
-        return keywords.contains(Keyword.ANSWERED);
-    }
-
-    public boolean isIsDraft() {
-        return keywords.contains(Keyword.DRAFT);
-    }
-
-    public boolean isIsForwarded() {
-        return keywords.contains(Keyword.FORWARDED)
-            || keywords.contains(Keyword.of("$forwarded"));
-    }
-
-    public Number getSize() {
-        return size;
-    }
-
-    public ImmutableMap<String, Boolean> getKeywords() {
-        return keywords.asMap();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactory.java
deleted file mode 100644
index de2d8b8dbf..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.util.Collection;
-import java.util.List;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.methods.BlobManager;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-
-import com.google.common.annotations.VisibleForTesting;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class MessageMetadataViewFactory implements MessageViewFactory<MessageMetadataView> {
-
-    private final BlobManager blobManager;
-    private final MessageIdManager messageIdManager;
-
-    @Inject
-    @VisibleForTesting
-    public MessageMetadataViewFactory(BlobManager blobManager, MessageIdManager messageIdManager) {
-        this.blobManager = blobManager;
-        this.messageIdManager = messageIdManager;
-    }
-
-    @Override
-    public Flux<MessageMetadataView> fromMessageIds(List<MessageId> messageIds, MailboxSession session) {
-        Flux<MessageResult> messages = Flux.from(messageIdManager.getMessagesReactive(messageIds, FetchGroup.MINIMAL, session));
-        return Helpers.toMessageViews(messages, this::fromMessageResults);
-    }
-
-    @VisibleForTesting
-    public Mono<MessageMetadataView> fromMessageResults(Collection<MessageResult> messageResults) {
-        Helpers.assertOneMessageId(messageResults);
-
-        MessageResult firstMessageResult = messageResults.iterator().next();
-        Collection<MailboxId> mailboxIds = Helpers.getMailboxIds(messageResults);
-
-        return Mono.just(MessageMetadataView.messageMetadataBuilder()
-            .id(firstMessageResult.getMessageId())
-            .mailboxIds(mailboxIds)
-            .blobId(BlobId.of(firstMessageResult.getMessageId()))
-            .threadId(firstMessageResult.getMessageId().serialize())
-            .keywords(Helpers.getKeywords(messageResults))
-            .size(firstMessageResult.getSize())
-            .build());
-    }
-
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageView.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageView.java
deleted file mode 100644
index 62ee605768..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageView.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import org.apache.james.mailbox.model.MessageId;
-
-public interface MessageView {
-    MessageId getId();
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageViewFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageViewFactory.java
deleted file mode 100644
index f8ef0cd9e5..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MessageViewFactory.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.apache.james.util.ReactorUtils.DEFAULT_CONCURRENCY;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.time.Instant;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.utils.KeywordsCombiner;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.mime4j.codec.DecodeMonitor;
-import org.apache.james.mime4j.codec.DecoderUtil;
-import org.apache.james.mime4j.dom.Header;
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.mime4j.message.DefaultMessageBuilder;
-import org.apache.james.mime4j.stream.Field;
-import org.apache.james.mime4j.stream.MimeConfig;
-import org.apache.james.util.ReactorUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public interface MessageViewFactory<T extends MessageView> {
-
-    Logger LOGGER = LoggerFactory.getLogger(MessageViewFactory.class);
-
-    KeywordsCombiner KEYWORDS_COMBINER = new KeywordsCombiner();
-    Keywords.KeywordsFactory KEYWORDS_FACTORY = Keywords.lenientFactory();
-    String JMAP_MULTIVALUED_FIELD_DELIMITER = "\n";
-
-    Flux<T> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession);
-
-    class Helpers {
-        interface FromMessageResult<T extends MessageView> {
-            Mono<T> fromMessageResults(Collection<MessageResult> messageResults);
-        }
-
-        static void assertOneMessageId(Collection<MessageResult> messageResults) {
-            Preconditions.checkArgument(!messageResults.isEmpty(), "MessageResults cannot be empty");
-            Preconditions.checkArgument(hasOnlyOneMessageId(messageResults), "MessageResults need to share the same messageId");
-        }
-
-        private static boolean hasOnlyOneMessageId(Collection<MessageResult> messageResults) {
-            if (messageResults.size() == 1) {
-                return true;
-            }
-            return messageResults
-                .stream()
-                .map(MessageResult::getMessageId)
-                .distinct()
-                .count() == 1;
-        }
-
-        static Set<MailboxId> getMailboxIds(Collection<MessageResult> messageResults) {
-            return messageResults.stream()
-                .map(MessageResult::getMailboxId)
-                .collect(ImmutableSet.toImmutableSet());
-        }
-
-        static Keywords getKeywords(Collection<MessageResult> messageResults) {
-            return messageResults.stream()
-                .map(MessageResult::getFlags)
-                .map(KEYWORDS_FACTORY::fromFlags)
-                .reduce(KEYWORDS_COMBINER)
-                .get();
-        }
-
-        static String getHeaderValue(org.apache.james.mime4j.dom.Message message, String header) {
-            Field field = message.getHeader().getField(header);
-            if (field == null) {
-                return null;
-            }
-            return field.getBody();
-        }
-
-
-        static ImmutableMap<String, String> toHeaderMap(Header header) {
-            return header.getFieldsAsMap()
-                .entrySet()
-                .stream()
-                .collect(ImmutableMap.toImmutableMap(entry -> entry.getValue().get(0).getName(),
-                    entry -> entry.getValue().stream()
-                        .map(Field::getBody)
-                        .map(body -> DecoderUtil.decodeEncodedWords(body, DecodeMonitor.SILENT))
-                        .collect(Collectors.joining(JMAP_MULTIVALUED_FIELD_DELIMITER))));
-        }
-
-        static <T extends MessageView>  Function<Collection<MessageResult>, Mono<T>> toMessageViews(FromMessageResult<T> converter) {
-            return messageResults ->
-                converter.fromMessageResults(messageResults)
-                    .doOnEach(ReactorUtils.logOnError(e -> LOGGER.error("Can not convert MessageResults to Message for {}",
-                        messageResults.iterator().next().getMessageId().serialize(),
-                        e)))
-                    .onErrorResume(e -> Mono.empty());
-        }
-
-        static <T extends MessageView> Flux<T> toMessageViews(Flux<MessageResult> messageResults, FromMessageResult<T> converter) {
-            return messageResults
-                .groupBy(MessageResult::getMessageId)
-                .flatMap(Flux::collectList, DEFAULT_CONCURRENCY)
-                .filter(Predicate.not(List::isEmpty))
-                .flatMap(toMessageViews(converter), DEFAULT_CONCURRENCY);
-        }
-
-        static Instant getDateFromHeaderOrInternalDateOtherwise(Message mimeMessage, MessageResult message) {
-            return Optional.ofNullable(mimeMessage.getDate())
-                .map(Date::toInstant)
-                .orElse(message.getInternalDate().toInstant());
-        }
-
-        static Message retrieveMessage(MessageFullViewFactory.MetaDataWithContent metaDataWithContent) {
-            return metaDataWithContent.getMessage()
-                .orElseGet(Throwing.supplier(() ->
-                    parse(metaDataWithContent.getContent())).sneakyThrow());
-        }
-
-        static Message parse(InputStream messageContent) throws IOException {
-            DefaultMessageBuilder defaultMessageBuilder = new DefaultMessageBuilder();
-            defaultMessageBuilder.setMimeEntityConfig(MimeConfig.PERMISSIVE);
-            return defaultMessageBuilder.parseMessage(messageContent);
-        }
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MetaMessageViewFactory.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MetaMessageViewFactory.java
deleted file mode 100644
index de30921b22..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/MetaMessageViewFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import jakarta.inject.Inject;
-
-import org.apache.james.jmap.model.MessageProperties;
-
-public class MetaMessageViewFactory {
-    private final MessageFullViewFactory messageFullViewFactory;
-    private final MessageHeaderViewFactory messageHeaderViewFactory;
-    private final MessageMetadataViewFactory messageMetadataViewFactory;
-    private final MessageFastViewFactory messageFastViewFactory;
-
-    @Inject
-    public MetaMessageViewFactory(MessageFullViewFactory messageFullViewFactory, MessageHeaderViewFactory messageHeaderViewFactory,
-                                  MessageMetadataViewFactory messageMetadataViewFactory, MessageFastViewFactory messageFastViewFactory) {
-        this.messageFullViewFactory = messageFullViewFactory;
-        this.messageHeaderViewFactory = messageHeaderViewFactory;
-        this.messageMetadataViewFactory = messageMetadataViewFactory;
-        this.messageFastViewFactory = messageFastViewFactory;
-    }
-
-    public MessageViewFactory<? extends MessageView> getFactory(MessageProperties.ReadProfile readProfile) {
-        switch (readProfile) {
-            case Full:
-                return messageFullViewFactory;
-            case Header:
-                return messageHeaderViewFactory;
-            case Fast:
-                return messageFastViewFactory;
-            case Metadata:
-                return messageMetadataViewFactory;
-            default:
-                throw new IllegalArgumentException(readProfile + " is not a James JMAP draft supported view");
-        }
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/SubMessage.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/SubMessage.java
deleted file mode 100644
index 35801bdf82..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/message/view/SubMessage.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import java.time.Instant;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-@JsonDeserialize(builder = SubMessage.Builder.class)
-public class SubMessage {
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    @JsonPOJOBuilder(withPrefix = "")
-    public static class Builder {
-        private ImmutableMap<String, String> headers;
-        private Emailer from;
-        private final ImmutableList.Builder<Emailer> to;
-        private final ImmutableList.Builder<Emailer> cc;
-        private final ImmutableList.Builder<Emailer> bcc;
-        private final ImmutableList.Builder<Emailer> replyTo;
-        private String subject;
-        private Instant date;
-        private Optional<String> textBody = Optional.empty();
-        private Optional<String> htmlBody = Optional.empty();
-        private final ImmutableList.Builder<Attachment> attachments;
-        private final ImmutableMap.Builder<BlobId, SubMessage> attachedMessages;
-
-        private Builder() {
-            to = ImmutableList.builder();
-            cc = ImmutableList.builder();
-            bcc = ImmutableList.builder();
-            replyTo = ImmutableList.builder();
-            attachments = ImmutableList.builder();
-            attachedMessages = ImmutableMap.builder();
-        }
-
-        public Builder headers(ImmutableMap<String, String> headers) {
-            this.headers = headers;
-            return this;
-        }
-
-        public Builder from(Emailer from) {
-            this.from = from;
-            return this;
-        }
-
-        public Builder to(List<Emailer> to) {
-            this.to.addAll(to);
-            return this;
-        }
-
-        public Builder cc(List<Emailer> cc) {
-            this.cc.addAll(cc);
-            return this;
-        }
-
-        public Builder bcc(List<Emailer> bcc) {
-            this.bcc.addAll(bcc);
-            return this;
-        }
-
-        public Builder replyTo(List<Emailer> replyTo) {
-            this.replyTo.addAll(replyTo);
-            return this;
-        }
-
-        public Builder subject(String subject) {
-            this.subject = subject;
-            return this;
-        }
-
-        public Builder date(Instant date) {
-            this.date = date;
-            return this;
-        }
-
-        public Builder textBody(Optional<String> textBody) {
-            this.textBody = textBody;
-            return this;
-        }
-
-        public Builder htmlBody(Optional<String> htmlBody) {
-            this.htmlBody = htmlBody;
-            return this;
-        }
-
-        public Builder attachments(List<Attachment> attachments) {
-            this.attachments.addAll(attachments);
-            return this;
-        }
-
-        public Builder attachedMessages(Map<BlobId, SubMessage> attachedMessages) {
-            this.attachedMessages.putAll(attachedMessages);
-            return this;
-        }
-
-        public SubMessage build() {
-            Preconditions.checkState(headers != null, "'headers' is mandatory");
-            Preconditions.checkState(!Strings.isNullOrEmpty(subject), "'subject' is mandatory");
-            Preconditions.checkState(date != null, "'date' is mandatory");
-            ImmutableList<Attachment> attachments = this.attachments.build();
-            ImmutableMap<BlobId, SubMessage> attachedMessages = this.attachedMessages.build();
-            Preconditions.checkState(MessageFullView.areAttachedMessagesKeysInAttachments(attachments, attachedMessages), "'attachedMessages' keys must be in 'attachements'");
-            return new SubMessage(headers, Optional.ofNullable(from), to.build(), cc.build(), bcc.build(),
-                    replyTo.build(), subject, date, textBody, htmlBody,
-                    attachments, attachedMessages
-                    );
-        }
-    }
-
-    private final ImmutableMap<String, String> headers;
-    private final Optional<Emailer> from;
-    private final ImmutableList<Emailer> to;
-    private final ImmutableList<Emailer> cc;
-    private final ImmutableList<Emailer> bcc;
-    private final ImmutableList<Emailer> replyTo;
-    private final String subject;
-    private final Instant date;
-    private final Optional<String> textBody;
-    private final Optional<String> htmlBody;
-    private final ImmutableList<Attachment> attachments;
-    private final ImmutableMap<BlobId, SubMessage> attachedMessages;
-
-    @VisibleForTesting SubMessage(ImmutableMap<String, String> headers,
-                                  Optional<Emailer> from,
-                                  ImmutableList<Emailer> to,
-                                  ImmutableList<Emailer> cc,
-                                  ImmutableList<Emailer> bcc,
-                                  ImmutableList<Emailer> replyTo,
-                                  String subject,
-                                  Instant date,
-                                  Optional<String> textBody,
-                                  Optional<String> htmlBody,
-                                  ImmutableList<Attachment> attachments,
-                                  ImmutableMap<BlobId, SubMessage> attachedMessages) {
-        super();
-        this.headers = headers;
-        this.from = from;
-        this.to = to;
-        this.cc = cc;
-        this.bcc = bcc;
-        this.replyTo = replyTo;
-        this.subject = subject;
-        this.date = date;
-        this.textBody = textBody;
-        this.htmlBody = htmlBody;
-        this.attachments = attachments;
-        this.attachedMessages = attachedMessages;
-    }
-
-    public ImmutableMap<String, String> getHeaders() {
-        return headers;
-    }
-
-    public Optional<Emailer> getFrom() {
-        return from;
-    }
-
-    public ImmutableList<Emailer> getTo() {
-        return to;
-    }
-
-    public ImmutableList<Emailer> getCc() {
-        return cc;
-    }
-
-    public ImmutableList<Emailer> getBcc() {
-        return bcc;
-    }
-
-    public ImmutableList<Emailer> getReplyTo() {
-        return replyTo;
-    }
-
-    public String getSubject() {
-        return subject;
-    }
-
-    public Instant getDate() {
-        return date;
-    }
-
-    public Optional<String> getTextBody() {
-        return textBody;
-    }
-
-    public Optional<String> getHtmlBody() {
-        return htmlBody;
-    }
-
-    public ImmutableList<Attachment> getAttachments() {
-        return attachments;
-    }
-
-    public ImmutableMap<BlobId, SubMessage> getAttachedMessages() {
-        return attachedMessages;
-    }
-
-
-}
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/utils/KeywordsCombiner.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/utils/KeywordsCombiner.java
deleted file mode 100644
index fb3cd58b2e..0000000000
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/utils/KeywordsCombiner.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.utils;
-
-import java.util.List;
-import java.util.Set;
-import java.util.function.BinaryOperator;
-
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-public class KeywordsCombiner implements BinaryOperator<Keywords> {
-    private static final ImmutableList<Keyword> KEYWORD_TO_INTERSECT = ImmutableList.of(Keyword.DRAFT);
-    private static final ImmutableList<Keyword> KEYWORD_NOT_TO_UNION = KEYWORD_TO_INTERSECT;
-
-    private Keywords.KeywordsFactory keywordsFactory;
-
-    public KeywordsCombiner() {
-        this.keywordsFactory = Keywords.lenientFactory();
-    }
-
-    @Override
-    public Keywords apply(Keywords keywords, Keywords keywords2) {
-        return keywordsFactory
-            .fromSet(Sets.union(
-                        union(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_NOT_TO_UNION),
-                        intersect(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_TO_INTERSECT)));
-    }
-
-    public Set<Keyword> union(Set<Keyword> set1, Set<Keyword> set2, List<Keyword> exceptKeywords) {
-        return Sets.union(set1, set2)
-            .stream()
-            .filter(keyword -> !exceptKeywords.contains(keyword))
-            .collect(ImmutableSet.toImmutableSet());
-    }
-
-    public Set<Keyword> intersect(Set<Keyword> set1, Set<Keyword> set2, List<Keyword> forKeywords) {
-        return Sets.intersection(set1, set2)
-            .stream()
-            .filter(forKeywords::contains)
-            .collect(ImmutableSet.toImmutableSet());
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/event/ComputeMessageFastViewProjectionListenerTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/event/ComputeMessageFastViewProjectionListenerTest.java
index 3c04b9dfe6..722fcc3b73 100644
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/event/ComputeMessageFastViewProjectionListenerTest.java
+++ b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/event/ComputeMessageFastViewProjectionListenerTest.java
@@ -30,12 +30,8 @@ import static org.mockito.Mockito.verify;
 
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.time.Clock;
 import java.time.Duration;
 
-import org.apache.james.blob.api.BucketName;
-import org.apache.james.blob.api.HashBlobId;
-import org.apache.james.blob.memory.MemoryBlobStoreDAO;
 import org.apache.james.core.Username;
 import org.apache.james.events.Group;
 import org.apache.james.events.InVMEventBus;
@@ -45,16 +41,12 @@ import org.apache.james.events.delivery.InVmEventDelivery;
 import org.apache.james.jmap.api.model.Preview;
 import org.apache.james.jmap.api.projections.MessageFastViewPrecomputedProperties;
 import org.apache.james.jmap.api.projections.MessageFastViewProjection;
-import org.apache.james.jmap.methods.BlobManagerImpl;
-import org.apache.james.jmap.model.message.view.MessageFullViewFactory;
-import org.apache.james.jmap.utils.JsoupHtmlTextExtractor;
 import org.apache.james.jmap.memory.projections.MemoryMessageFastViewProjection;
-import org.apache.james.jmap.memory.upload.InMemoryUploadRepository;
+import org.apache.james.jmap.utils.JsoupHtmlTextExtractor;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MailboxSessionUtil;
 import org.apache.james.mailbox.MessageIdManager;
 import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.StringBackedAttachmentIdFactory;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
 import org.apache.james.mailbox.model.ComposedMessageId;
@@ -69,7 +61,6 @@ import org.apache.james.mailbox.store.SessionProviderImpl;
 import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.metrics.tests.RecordingMetricFactory;
 import org.apache.james.mime4j.dom.Message;
-import org.apache.james.server.blob.deduplication.DeDuplicationBlobStore;
 import org.apache.james.util.ClassLoaderUtils;
 import org.apache.james.util.html.HtmlTextExtractor;
 import org.apache.james.util.mime.MessageContentExtractor;
@@ -105,7 +96,6 @@ class ComputeMessageFastViewProjectionListenerTest {
         .build();
 
     MessageFastViewProjection messageFastViewProjection;
-    MessageFullViewFactory messageFullViewFactory;
     MailboxSession mailboxSession;
     StoreMailboxManager mailboxManager;
 
@@ -144,12 +134,6 @@ class ComputeMessageFastViewProjectionListenerTest {
         MessageContentExtractor messageContentExtractor = new MessageContentExtractor();
         HtmlTextExtractor htmlTextExtractor = new JsoupHtmlTextExtractor();
 
-        BlobManagerImpl blobManager = new BlobManagerImpl(resources.getAttachmentManager(), resources.getMessageIdManager(), resources.getMessageIdFactory(),
-            new InMemoryUploadRepository(new DeDuplicationBlobStore(new MemoryBlobStoreDAO(), BucketName.of("default"),
-                new HashBlobId.Factory()), Clock.systemUTC()),
-            new StringBackedAttachmentIdFactory());
-        messageFullViewFactory = new MessageFullViewFactory(blobManager, messageContentExtractor, htmlTextExtractor, messageIdManager, messageFastViewProjection);
-
         FakeAuthenticator authenticator = new FakeAuthenticator();
         authenticator.addUser(BOB, "12345");
 
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/json/ObjectMapperFactoryTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/json/ObjectMapperFactoryTest.java
deleted file mode 100644
index 729f401541..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/json/ObjectMapperFactoryTest.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.json;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.model.mailbox.Rights;
-import org.apache.james.mailbox.inmemory.InMemoryId;
-import org.apache.james.mailbox.inmemory.InMemoryMessageId;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mdn.action.mode.DispositionActionMode;
-import org.apache.james.mdn.sending.mode.DispositionSendingMode;
-import org.apache.james.mdn.type.DispositionType;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.google.common.collect.ImmutableMap;
-
-public class ObjectMapperFactoryTest {
-
-    private ObjectMapperFactory testee;
-
-    @Before
-    public void setup() {
-        testee = new ObjectMapperFactory(new InMemoryId.Factory(), new InMemoryMessageId.Factory());
-    }
-
-    @Test
-    public void mailboxIdShouldBeDeserializable() throws Exception {
-        String json = "{ \"mailboxId\": \"123\"}";
-        MailboxIdTestContainer expected = new MailboxIdTestContainer(InMemoryId.of(123));
-        MailboxIdTestContainer actual = testee.forParsing().readValue(json, MailboxIdTestContainer.class);
-        assertThat(actual).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void mailboxIdShouldBeSerializable() throws Exception {
-        MailboxIdTestContainer container = new MailboxIdTestContainer(InMemoryId.of(123));
-        String expectedJson = "{\"mailboxId\":\"123\"}";
-        String actual = testee.forWriting().writeValueAsString(container);
-        assertThat(actual).isEqualTo(expectedJson);
-    }
-
-    @Test
-    public void mailboxIdShouldBeDeserializableWhenKey() throws Exception {
-        String json = "{ \"map\": {\"123\": \"value\"}}";
-        MailboxIdKeyTestContainer expected = new MailboxIdKeyTestContainer(ImmutableMap.of(InMemoryId.of(123), "value"));
-        MailboxIdKeyTestContainer actual = testee.forParsing().readValue(json, MailboxIdKeyTestContainer.class);
-        assertThat(actual).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void mailboxIdShouldBeSerializableWhenKeyWithoutToString() throws Exception {
-        ObjectMapperFactory testeeWithoutToString = new ObjectMapperFactory(new KeyWithoutToString.Factory(), new InMemoryMessageId.Factory());
-        MailboxIdKeyTestContainer container = new MailboxIdKeyTestContainer(ImmutableMap.of(new KeyWithoutToString("key"), "value"));
-        String expectedJson = "{\"map\":{\"key\":\"value\"}}";
-        String actual = testeeWithoutToString.forWriting().writeValueAsString(container);
-        assertThat(actual).isEqualTo(expectedJson);
-    }
-
-    @Test
-    public void readValueShouldParseRightObject() throws Exception {
-        Rights.Right actual = testee.forParsing()
-            .readValue("\"a\"", Rights.Right.class);
-
-        assertThat(actual)
-            .isEqualTo(Rights.Right.Administer);
-    }
-
-    @Test
-    public void readValueShouldParseUsernameObject() throws Exception {
-        String username = "username";
-        Username actual = testee.forParsing()
-            .readValue("\"" + username + "\"", Username.class);
-
-        assertThat(actual)
-            .isEqualTo(Username.of(username));
-    }
-
-    @Test
-    public void readValueShouldParseActionModeWhenAutomatic() throws Exception {
-        DispositionActionMode actual = testee.forParsing()
-            .readValue("\"" + DispositionActionMode.Automatic.getValue() + "\"",
-                DispositionActionMode.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionActionMode.Automatic);
-    }
-
-    @Test
-    public void readValueShouldParseActionModeWhenManual() throws Exception {
-        DispositionActionMode actual = testee.forParsing()
-            .readValue("\"" + DispositionActionMode.Manual.getValue() + "\"",
-                DispositionActionMode.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionActionMode.Manual);
-    }
-
-    @Test
-    public void readValueShouldFailOnInvalidActionMode() {
-        assertThatThrownBy(() -> testee.forParsing()
-            .readValue("\"illegal\"",
-                DispositionActionMode.class))
-            .isInstanceOf(IllegalStateException.class)
-            .hasMessage("Unrecognized MDN Disposition action mode illegal. Should be one of [manual-action, automatic-action]");
-    }
-
-    @Test
-    public void readValueShouldParseSendingModeWhenAutomatic() throws Exception {
-        DispositionSendingMode actual = testee.forParsing()
-            .readValue("\"" + DispositionSendingMode.Automatic.getValue() + "\"",
-                DispositionSendingMode.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionSendingMode.Automatic);
-    }
-
-    @Test
-    public void readValueShouldParseSendingModeWhenManual() throws Exception {
-        DispositionSendingMode actual = testee.forParsing()
-            .readValue("\"" + DispositionSendingMode.Manual.getValue() + "\"",
-                DispositionSendingMode.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionSendingMode.Manual);
-    }
-
-    @Test
-    public void readValueShouldFailOnInvalidSendingMode() {
-        assertThatThrownBy(() -> testee.forParsing()
-            .readValue("\"illegal\"",
-                DispositionSendingMode.class))
-            .isInstanceOf(IllegalStateException.class)
-            .hasMessage("Unrecognized MDN Disposition sending mode illegal. Should be one of [MDN-sent-manually, MDN-sent-automatically]");
-    }
-
-    @Test
-    public void readValueShouldParseSendingModeWhenDeleted() throws Exception {
-        DispositionType actual = testee.forParsing()
-            .readValue("\"" + DispositionType.Deleted.getValue() + "\"",
-                DispositionType.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionType.Deleted);
-    }
-
-    @Test
-    public void readValueShouldParseSendingModeWhenDispatched() throws Exception {
-        DispositionType actual = testee.forParsing()
-            .readValue("\"" + DispositionType.Dispatched.getValue() + "\"",
-                DispositionType.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionType.Dispatched);
-    }
-
-    @Test
-    public void readValueShouldParseSendingModeWhenDisplayed() throws Exception {
-        DispositionType actual = testee.forParsing()
-            .readValue("\"" + DispositionType.Displayed.getValue() + "\"",
-                DispositionType.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionType.Displayed);
-    }
-
-    @Test
-    public void readValueShouldParseSendingModeWhenProcessed() throws Exception {
-        DispositionType actual = testee.forParsing()
-            .readValue("\"" + DispositionType.Processed.getValue() + "\"",
-                DispositionType.class);
-
-        assertThat(actual)
-            .isEqualTo(DispositionType.Processed);
-    }
-
-    @Test
-    public void readValueShouldFailOnInvalidDispositionType() {
-        assertThatThrownBy(() -> testee.forParsing()
-            .readValue("\"illegal\"",
-                DispositionType.class))
-            .isInstanceOf(IllegalStateException.class)
-            .hasMessage("Unrecognized MDN Disposition type illegal. Should be one of [deleted, dispatched, displayed, processed]");
-    }
-
-    @Test
-    public void readValueShouldParseRightsObject() throws Exception {
-        String username = "username";
-        Rights actual = testee.forParsing()
-            .readValue("{\"" + username + "\" : [\"a\", \"e\"]}", Rights.class);
-
-        assertThat(actual)
-            .isEqualTo(Rights.builder()
-                .delegateTo(Username.of(username), Rights.Right.Administer, Rights.Right.Expunge)
-                .build());
-    }
-
-    @Test
-    public void readValueShouldRejectMultiCharacterRights() {
-        assertThatThrownBy(() ->
-            testee.forParsing()
-                .readValue("\"ae\"", Rights.Right.class))
-            .isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void readValueShouldRejectUnsupportedRights() {
-        assertThatThrownBy(() ->
-            testee.forParsing()
-                .readValue("\"p\"", Rights.Right.class))
-            .isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void readValueShouldRejectUnExistingRights() {
-        assertThatThrownBy(() ->
-            testee.forParsing()
-                .readValue("\"z\"", Rights.Right.class))
-            .isInstanceOf(IllegalArgumentException.class);
-    }
-
-    public static class MailboxIdTestContainer {
-        public MailboxId mailboxId;
-
-        public MailboxIdTestContainer() {
-        }
-
-        public MailboxIdTestContainer(MailboxId mailboxId) {
-            this.mailboxId = mailboxId;
-        }
-    }
-
-    public static class MailboxIdKeyTestContainer {
-        public Map<MailboxId, String> map;
-
-        public MailboxIdKeyTestContainer() {
-        }
-
-        public MailboxIdKeyTestContainer(Map<MailboxId, String> map) {
-            this.map = map;
-        }
-    }
-
-    public static class KeyWithoutToString implements MailboxId, Serializable {
-        private String value;
-
-        public KeyWithoutToString(String value) {
-            this.value = value;
-        }
-
-        @Override
-        public String serialize() {
-            return value;
-        }
-
-        public static class Factory implements MailboxId.Factory {
-
-            @Override
-            public MailboxId fromString(String serialized) {
-                return new KeyWithoutToString(serialized);
-            }
-
-        }
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/methods/BlobManagerImplTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/methods/BlobManagerImplTest.java
deleted file mode 100644
index 85996b9e78..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/methods/BlobManagerImplTest.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.methods;
-
-import static org.apache.james.jmap.methods.BlobManagerImpl.MESSAGE_RFC822_CONTENT_TYPE;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.time.Clock;
-
-import org.apache.james.blob.api.BucketName;
-import org.apache.james.blob.api.HashBlobId;
-import org.apache.james.blob.memory.MemoryBlobStoreDAO;
-import org.apache.james.core.Username;
-import org.apache.james.jmap.exceptions.BlobNotFoundException;
-import org.apache.james.jmap.model.Blob;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.memory.upload.InMemoryUploadRepository;
-import org.apache.james.mailbox.AttachmentManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MailboxSessionUtil;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.StringBackedAttachmentIdFactory;
-import org.apache.james.mailbox.exception.AttachmentNotFoundException;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.inmemory.InMemoryMessageId;
-import org.apache.james.mailbox.model.StringBackedAttachmentId;
-import org.apache.james.mailbox.model.AttachmentMetadata;
-import org.apache.james.mailbox.model.ByteContent;
-import org.apache.james.mailbox.model.Content;
-import org.apache.james.mailbox.model.ContentType;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.mailbox.model.TestMessageId;
-import org.apache.james.server.blob.deduplication.DeDuplicationBlobStore;
-import org.assertj.core.api.SoftAssertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import com.github.fge.lambdas.Throwing;
-import com.google.common.collect.ImmutableList;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-class BlobManagerImplTest {
-    static final String ID = "abc";
-    static final StringBackedAttachmentId ATTACHMENT_ID = StringBackedAttachmentId.from(ID);
-    static final ContentType CONTENT_TYPE = ContentType.of("text/plain");
-    static final byte[] BYTES = "abc".getBytes(StandardCharsets.UTF_8);
-    static final TestMessageId MESSAGE_ID = TestMessageId.of(125);
-    static final BlobId BLOB_ID_ATTACHMENT = BlobId.of(ID);
-    static final BlobId BLOB_ID_MESSAGE = BlobId.of(MESSAGE_ID.serialize());
-    BlobManagerImpl blobManager;
-
-    AttachmentManager attachmentManager;
-    MessageIdManager messageIdManager;
-    MailboxSession session;
-
-    @BeforeEach
-    void setUp() {
-        attachmentManager = mock(AttachmentManager.class);
-        messageIdManager = mock(MessageIdManager.class);
-        session = MailboxSessionUtil.create(Username.of("user"));
-
-        blobManager = new BlobManagerImpl(attachmentManager, messageIdManager, new TestMessageId.Factory(),
-            new InMemoryUploadRepository(new DeDuplicationBlobStore(new MemoryBlobStoreDAO(), BucketName.of("default"), new HashBlobId.Factory()),
-                Clock.systemUTC()), new StringBackedAttachmentIdFactory());
-    }
-
-    @Test
-    void retrieveShouldReturnBlobWhenAttachment() throws Exception {
-        when(attachmentManager.getAttachment(ATTACHMENT_ID, session))
-            .thenReturn(AttachmentMetadata.builder()
-                .messageId(InMemoryMessageId.of(45))
-                .attachmentId(ATTACHMENT_ID)
-                .size(BYTES.length)
-                .type(CONTENT_TYPE)
-                .build());
-        when(attachmentManager.loadAttachmentContentReactive(ATTACHMENT_ID, session))
-            .thenReturn(Mono.just(new ByteArrayInputStream(BYTES)));
-
-        Blob blob = blobManager.retrieve(BLOB_ID_ATTACHMENT, session);
-
-        SoftAssertions.assertSoftly(Throwing.consumer(
-            softly -> {
-                assertThat(blob.getBlobId()).isEqualTo(BlobId.of(ATTACHMENT_ID.getId()));
-                assertThat(blob.getContentType()).isEqualTo(CONTENT_TYPE);
-                assertThat(blob.getSize()).isEqualTo(BYTES.length);
-                assertThat(blob.getStream()).hasSameContentAs(new ByteArrayInputStream(BYTES));
-            }));
-    }
-
-    @Test
-    void retrieveShouldThrowWhenNotFound() throws Exception {
-        when(attachmentManager.getAttachment(ATTACHMENT_ID, session))
-            .thenThrow(new AttachmentNotFoundException(ID));
-        when(messageIdManager.getMessage(MESSAGE_ID, FetchGroup.FULL_CONTENT, session))
-            .thenReturn(ImmutableList.of());
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_ATTACHMENT, session))
-            .isInstanceOf(BlobNotFoundException.class);
-    }
-
-    @Test
-    void retrieveShouldReturnBlobWhenMessage() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        MessageResult messageResult = mock(MessageResult.class);
-        Content content = new ByteContent(BYTES);
-        when(messageResult.getFullContent()).thenReturn(content);
-        when(messageIdManager.getMessagesReactive(any(), eq(FetchGroup.FULL_CONTENT), eq(session)))
-            .thenReturn(Flux.just(messageResult));
-
-        Blob blob = blobManager.retrieve(BLOB_ID_MESSAGE, session);
-
-        SoftAssertions.assertSoftly(Throwing.consumer(
-            softly -> {
-                assertThat(blob.getBlobId()).isEqualTo(BLOB_ID_MESSAGE);
-                assertThat(blob.getContentType()).isEqualTo(MESSAGE_RFC822_CONTENT_TYPE);
-                assertThat(blob.getSize()).isEqualTo(BYTES.length);
-                assertThat(blob.getStream()).hasSameContentAs(new ByteArrayInputStream(BYTES));
-            }));
-    }
-
-    @Test
-    void retrieveShouldThrowOnMailboxExceptionWhenRetrievingAttachment() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new MailboxException());
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_MESSAGE, session))
-            .isInstanceOf(MailboxException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnRuntimeExceptionWhenRetrievingAttachment() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new RuntimeException());
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_MESSAGE, session))
-            .isInstanceOf(RuntimeException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnRuntimeExceptionWhenRetrievingMessage() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        when(messageIdManager.getMessage(MESSAGE_ID, FetchGroup.FULL_CONTENT, session))
-            .thenThrow(new RuntimeException());
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_MESSAGE, session))
-            .isInstanceOf(RuntimeException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnMailboxExceptionWhenRetrievingMessage() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        when(messageIdManager.getMessage(MESSAGE_ID, FetchGroup.FULL_CONTENT, session))
-            .thenThrow(new MailboxException());
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_MESSAGE, session))
-            .isInstanceOf(RuntimeException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnMailboxExceptionWhenRetrievingMessageContent() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        MessageResult messageResult = mock(MessageResult.class);
-        when(messageResult.getFullContent()).thenThrow(new MailboxException());
-        when(messageIdManager.getMessage(MESSAGE_ID, FetchGroup.FULL_CONTENT, session))
-            .thenReturn(ImmutableList.of(messageResult));
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_MESSAGE, session))
-            .isInstanceOf(RuntimeException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnRuntimeExceptionWhenRetrievingMessageContent() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        MessageResult messageResult = mock(MessageResult.class);
-        when(messageResult.getFullContent()).thenThrow(new RuntimeException());
-        when(messageIdManager.getMessage(MESSAGE_ID, FetchGroup.FULL_CONTENT, session))
-            .thenReturn(ImmutableList.of(messageResult));
-
-        assertThatThrownBy(() -> blobManager.retrieve(BLOB_ID_MESSAGE, session))
-            .isInstanceOf(RuntimeException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnIOExceptionWhenRetrievingMessageContentInputStream() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        MessageResult messageResult = mock(MessageResult.class);
-        Content content = mock(Content.class);
-        when(content.getInputStream()).thenThrow(new IOException());
-        when(messageResult.getFullContent()).thenReturn(content);
-        when(messageIdManager.getMessagesReactive(any(), eq(FetchGroup.FULL_CONTENT), eq(session)))
-            .thenReturn(Flux.just(messageResult));
-
-        Blob blob = blobManager.retrieve(BLOB_ID_MESSAGE, session);
-        assertThatThrownBy(blob::getStream)
-            .isInstanceOf(IOException.class);
-    }
-
-    @Test
-    void retrieveShouldThrowOnRuntimeExceptionWhenRetrievingMessageContentInputStream() throws Exception {
-        when(attachmentManager.getAttachment(any(), any()))
-            .thenThrow(new AttachmentNotFoundException(ID));
-
-        MessageResult messageResult = mock(MessageResult.class);
-        Content content = mock(Content.class);
-        when(content.getInputStream()).thenThrow(new RuntimeException());
-        when(messageResult.getFullContent()).thenReturn(content);
-        when(messageIdManager.getMessagesReactive(any(), eq(FetchGroup.FULL_CONTENT), eq(session)))
-            .thenReturn(Flux.just(messageResult));
-
-        Blob blob = blobManager.retrieve(BLOB_ID_MESSAGE, session);
-        assertThatThrownBy(blob::getStream)
-            .isInstanceOf(RuntimeException.class);
-    }
-
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/AttachmentTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/AttachmentTest.java
deleted file mode 100644
index 834e6330b3..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/AttachmentTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.Optional;
-
-import org.apache.james.mailbox.model.ContentType;
-import org.junit.Test;
-
-public class AttachmentTest {
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenBlobIdIsNull() {
-        Attachment.builder().build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenTypeIsNull() {
-        Attachment.builder().blobId(BlobId.of("blobId")).build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenNameIsNull() {
-        Attachment.builder().blobId(BlobId.of("blobId")).type("type").build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenSizeIsNull() {
-        Attachment.builder().blobId(BlobId.of("blobId")).type("type").name("name").build();
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void buildShouldThrowWhenTypeIsEmpty() {
-        Attachment.builder().blobId(BlobId.of("blobId")).type("").name("name").size(123).build();
-    }
-
-    @Test
-    public void buildShouldWorkWhenMandatoryFieldsArePresent() {
-        Number attachmentSize = Number.fromLong(123);
-        Attachment expected = new Attachment(BlobId.of("blobId"), ContentType.of("type"), Optional.empty(), attachmentSize, Optional.empty(), false, Optional.empty(), Optional.empty());
-        Attachment tested = Attachment.builder()
-            .blobId(BlobId.of("blobId"))
-            .type("type")
-            .size(123)
-            .build();
-        assertThat(tested).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void buildShouldWorkWithAllFieldsSet() {
-        Number attachmentSize = Number.fromLong(123);
-        Optional<Number> attachmentWidth = Optional.of(Number.fromLong(456L));
-        Optional<Number> attachmentHeight = Optional.of(Number.fromLong(789L));
-        Attachment expected = new Attachment(BlobId.of("blobId"), ContentType.of("type"), Optional.of("name"), attachmentSize, Optional.of("cid"), true,
-            attachmentWidth, attachmentHeight);
-        Attachment tested = Attachment.builder()
-            .blobId(BlobId.of("blobId"))
-            .type("type")
-            .name("name")
-            .size(123)
-            .cid("cid")
-            .isInline(true)
-            .width(456)
-            .height(789)
-            .build();
-        assertThat(tested).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void isInlinedWithCidShouldReturnTrueWhenIsInlineAndHasCid() throws Exception {
-        Attachment tested = Attachment.builder()
-            .blobId(BlobId.of("blobId"))
-            .type("type")
-            .size(123)
-            .cid("cid")
-            .isInline(true)
-            .build();
-
-        assertThat(tested.isInlinedWithCid()).isTrue();
-    }
-
-    @Test
-    public void isInlinedWithCidShouldReturnFalseWhenIsNotInline() throws Exception {
-        Attachment tested = Attachment.builder()
-            .blobId(BlobId.of("blobId"))
-            .type("type")
-            .size(123)
-            .cid("cid")
-            .isInline(false)
-            .build();
-
-        assertThat(tested.isInlinedWithCid()).isFalse();
-    }
-
-    @Test
-    public void isInlinedWithCidShouldReturnFalseWhenIsInlineButNoCid() throws Exception {
-        Attachment tested = Attachment.builder()
-            .blobId(BlobId.of("blobId"))
-            .type("type")
-            .size(123)
-            .isInline(true)
-            .build();
-
-        assertThat(tested.isInlinedWithCid()).isFalse();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/BlobTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/BlobTest.java
deleted file mode 100644
index 7ff372983d..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/BlobTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-
-import org.apache.james.jmap.model.Blob.InputStreamSupplier;
-import org.apache.james.mailbox.model.ContentType;
-import org.junit.jupiter.api.Test;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-
-class BlobTest {
-    static final BlobId ID = BlobId.of("123");
-    static final ContentType CONTENT_TYPE = ContentType.of("text/plain");
-    static final InputStreamSupplier PAYLOAD = () -> new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8));
-    static final int LENGTH = 3;
-
-    @Test
-    void shouldMatchBeanContract() {
-        EqualsVerifier.forClass(Blob.class)
-            .withIgnoredFields("payload", "size")
-            .verify();
-    }
-
-    @Test
-    void buildShouldConstructValidBlob() {
-        assertThat(
-            Blob.builder()
-                .id(ID)
-                .contentType(CONTENT_TYPE)
-                .payload(PAYLOAD)
-                .size(LENGTH)
-                .build())
-            .isEqualTo(
-                new Blob(ID, PAYLOAD, CONTENT_TYPE, LENGTH));
-    }
-
-    @Test
-    void buildShouldThrowOnMissingBlobId() {
-        assertThatThrownBy(() ->
-            Blob.builder()
-                .contentType(CONTENT_TYPE)
-                .payload(PAYLOAD)
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowOnMissingContentType() {
-        assertThatThrownBy(() ->
-            Blob.builder()
-                .id(ID)
-                .payload(PAYLOAD)
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowOnMissingPayload() {
-        assertThatThrownBy(() ->
-            Blob.builder()
-                .id(ID)
-                .contentType(CONTENT_TYPE)
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/EmailerTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/EmailerTest.java
deleted file mode 100644
index ba3b6d2201..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/EmailerTest.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.Optional;
-
-import org.apache.james.mime4j.dom.address.AddressList;
-import org.apache.james.mime4j.dom.address.Mailbox;
-import org.apache.james.mime4j.dom.address.MailboxList;
-import org.junit.Test;
-
-public class EmailerTest {
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenNameIsNull() {
-        Emailer.builder().build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenEmailIsNull() {
-        Emailer.builder().build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenNameIsEmpty() {
-        Emailer.builder().name("").email("email@domain").build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenEmailIsEmpty() {
-        Emailer.builder().name("name").email("").build();
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void buildShouldThrowWhenEmailWithoutArobase() {
-        Emailer.builder().name("name").email("email.without.arobase").build();
-    }
-
-    @Test
-    public void buildShouldWork() {
-        Emailer expected = new Emailer(Optional.of("name"), Optional.of("user@domain"));
-        Emailer emailer = Emailer.builder()
-            .name("name")
-            .email("user@domain")
-            .build();
-        assertThat(emailer).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void buildInvalidAllowedShouldConsiderNullValuesAsInvalid() {
-        Emailer expected = new Emailer(Optional.empty(), Optional.empty());
-
-        Emailer actual = Emailer.builder()
-            .allowInvalid()
-            .build();
-
-        assertThat(actual).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void buildInvalidAllowedShouldConsiderEmptyValuesAsInvalid() {
-        Emailer expected = new Emailer(Optional.empty(), Optional.empty());
-
-        Emailer actual = Emailer.builder()
-            .name("")
-            .email("")
-            .allowInvalid()
-            .build();
-
-        assertThat(actual).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void buildInvalidAllowedShouldDeclareInvalidAddressesAsInvalid() {
-        Emailer expected = new Emailer(Optional.empty(), Optional.of("invalidAddress"));
-
-        Emailer actual = Emailer.builder()
-            .email("invalidAddress")
-            .allowInvalid()
-            .build();
-
-        assertThat(actual).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void buildInvalidAllowedShouldWork() {
-        String name = "bob";
-        String address = "me@apache.org";
-        Emailer expected = new Emailer(Optional.of(name), Optional.of(address));
-
-        Emailer actual = Emailer.builder()
-            .name(name)
-            .email(address)
-            .allowInvalid()
-            .build();
-
-        assertThat(actual).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    public void fromAddressListShouldReturnEmptyWhenNullAddress() {
-        assertThat(Emailer.fromAddressList(null))
-            .isEmpty();
-    }
-
-    @Test
-    public void fromAddressListShouldReturnListOfEmailersContainingAddresses() {
-        assertThat(Emailer.fromAddressList(new AddressList(
-                new Mailbox("user1", "james.org"),
-                new Mailbox("user2", "james.org"))))
-            .containsExactly(
-                Emailer.builder()
-                    .name("user1@james.org")
-                    .email("user1@james.org")
-                    .build(),
-                Emailer.builder()
-                    .name("user2@james.org")
-                    .email("user2@james.org")
-                    .build());
-    }
-
-    @Test
-    public void fromAddressListShouldReturnListOfEmailersContainingAddressesWithNames() {
-        assertThat(Emailer.fromAddressList(new AddressList(
-                new Mailbox("myInbox", "user1", "james.org"),
-                new Mailbox("hisInbox", "user2", "james.org"))))
-            .containsExactly(
-                Emailer.builder()
-                    .name("myInbox")
-                    .email("user1@james.org")
-                    .build(),
-                Emailer.builder()
-                    .name("hisInbox")
-                    .email("user2@james.org")
-                    .build());
-    }
-
-    @Test
-    public void firstFromMailboxListShouldReturnEmptyWhenNullMailboxList() {
-        assertThat(Emailer.firstFromMailboxList(null))
-            .isEmpty();
-    }
-
-    @Test
-    public void firstFromMailboxListShouldReturnTheFirstAddressInList() {
-        assertThat(Emailer.firstFromMailboxList(new MailboxList(
-                new Mailbox("user1Inbox", "user1", "james.org"),
-                new Mailbox("user2Inbox", "user2", "james.org"))))
-            .contains(Emailer.builder()
-                .name("user1Inbox")
-                .email("user1@james.org")
-                .build());
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordTest.java
deleted file mode 100644
index c3ba0b1f4c..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordTest.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatCode;
-
-import java.util.Optional;
-
-import jakarta.mail.Flags;
-
-import org.apache.commons.lang3.StringUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-
-public class KeywordTest {
-    private static final int FLAG_NAME_MAX_LENTH = 255;
-    private static final String ANY_KEYWORD = "AnyKeyword";
-
-    @Rule
-    public ExpectedException expectedException = ExpectedException.none();
-
-    @Test
-    public void shouldRespectBeanContract() {
-        EqualsVerifier.forClass(Keyword.class).verify();
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameLengthLessThanMinLength() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameLengthMoreThanMaxLength() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of(StringUtils.repeat("a", FLAG_NAME_MAX_LENTH + 1));
-    }
-
-    @Test
-    public void keywordShouldCreateNewOneWhenFlagNameLengthEqualsMaxLength() {
-        String maxLengthFlagName = StringUtils.repeat("a", FLAG_NAME_MAX_LENTH);
-        Keyword keyword = Keyword.of(maxLengthFlagName);
-
-        assertThat(keyword.getFlagName()).isEqualTo(maxLengthFlagName);
-    }
-
-    @Test
-    public void keywordShouldCreateNewOneWhenFlagNameLengthEqualsMinLength() {
-        String minLengthFlagName = "a";
-        Keyword keyword = Keyword.of(minLengthFlagName);
-
-        assertThat(keyword.getFlagName()).isEqualTo(minLengthFlagName);
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsPercentageCharacter() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a%");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsLeftBracket() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a[");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsRightBracket() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a]");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsLeftBrace() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a{");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsSlash() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a\\");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsStar() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a*");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsQuote() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a\"");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsOpeningParenthesis() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a(");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsClosingParenthesis() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a)");
-    }
-
-    @Test
-    public void keywordShouldThrowWhenFlagNameContainsSpaceCharacter() {
-        expectedException.expect(IllegalArgumentException.class);
-        Keyword.of("a b");
-    }
-
-    @Test
-    public void isNotNonExposedImapKeywordShouldReturnFalseWhenDeleted() {
-        assertThat(Keyword.DELETED.isExposedImapKeyword()).isFalse();
-    }
-
-    @Test
-    public void isNotNonExposedImapKeywordShouldReturnFalseWhenRecent() {
-        assertThat(Keyword.RECENT.isExposedImapKeyword()).isFalse();
-    }
-
-    @Test
-    public void isNotNonExposedImapKeywordShouldReturnTrueWhenOtherSystemFlag() {
-        assertThat(Keyword.DRAFT.isExposedImapKeyword()).isTrue();
-    }
-
-    @Test
-    public void isNotNonExposedImapKeywordShouldReturnTrueWhenAnyUserFlag() {
-        Keyword keyword = Keyword.of(ANY_KEYWORD);
-        assertThat(keyword.isExposedImapKeyword()).isTrue();
-    }
-
-    @Test
-    public void isDraftShouldReturnTrueWhenDraft() {
-        assertThat(Keyword.DRAFT.isDraft()).isTrue();
-    }
-
-    @Test
-    public void isDraftShouldReturnFalseWhenNonDraft() {
-        assertThat(Keyword.DELETED.isDraft()).isFalse();
-    }
-
-    @Test
-    public void asSystemFlagShouldReturnSystemFlag() {
-        assertThat(Keyword.of("$Draft").asSystemFlag())
-            .isEqualTo(Optional.of(Flags.Flag.DRAFT));
-    }
-
-    @Test
-    public void asSystemFlagShouldReturnEmptyWhenNonSystemFlag() {
-        assertThat(Keyword.of(ANY_KEYWORD).asSystemFlag().isPresent())
-            .isFalse();
-    }
-
-    @Test
-    public void asFlagsShouldReturnFlagsWhenSystemFlag() {
-        assertThat(Keyword.DELETED.asFlags())
-            .isEqualTo(new Flags(Flags.Flag.DELETED));
-    }
-
-    @Test
-    public void asFlagsShouldReturnFlagsWhenUserFlag() {
-        Keyword keyword = Keyword.of(ANY_KEYWORD);
-        assertThat(keyword.asFlags())
-            .isEqualTo(new Flags(ANY_KEYWORD));
-    }
-
-    @Test
-    public void asFlagsShouldReturnFlagsWhenUserFlagContainsUnderscore() {
-        String userFlag = "$has_cal";
-        Keyword keyword = Keyword.of(userFlag);
-        assertThat(keyword.asFlags())
-            .isEqualTo(new Flags(userFlag));
-    }
-
-    @Test
-    public void hyphenMinusShouldBeAllowedInKeyword() {
-        String userFlag = "aa-bb";
-
-        assertThatCode(() -> Keyword.of(userFlag))
-            .doesNotThrowAnyException();
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordsTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
deleted file mode 100644
index e7cad67611..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import java.util.Map;
-
-import jakarta.mail.Flags;
-import jakarta.mail.Flags.Flag;
-
-import org.apache.james.mailbox.FlagsBuilder;
-import org.junit.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-
-public class KeywordsTest {
-    public static final String ANY_KEYWORD = "AnyKeyword";
-
-    @Test
-    public void shouldRespectBeanContract() {
-        EqualsVerifier.forClass(Keywords.class).verify();
-    }
-
-    @Test
-    public void fromMapShouldThrowWhenWrongKeywordValue() {
-        assertThatThrownBy(() -> Keywords.lenientFactory()
-            .fromMap(ImmutableMap.of(ANY_KEYWORD, false)))
-            .isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void fromMapShouldReturnKeywordsFromMapStringAndBoolean() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromMap(ImmutableMap.of(ANY_KEYWORD, Keyword.FLAG_VALUE));
-
-        assertThat(keywords.getKeywords())
-            .containsOnly(Keyword.of(ANY_KEYWORD));
-    }
-
-    @Test
-    public void fromFlagsShouldReturnKeywordsFromAllFlag() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromFlags(new Flags(Flags.Flag.ANSWERED));
-
-        assertThat(keywords.getKeywords())
-            .containsOnly(Keyword.ANSWERED);
-    }
-
-    @Test
-    public void fromSetShouldReturnKeywordsFromSetOfKeywords() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromSet(ImmutableSet.of(Keyword.ANSWERED));
-
-        assertThat(keywords.getKeywords())
-            .containsOnly(Keyword.ANSWERED);
-    }
-
-    @Test
-    public void asFlagsShouldBuildFlagsFromKeywords() {
-        assertThat(Keywords.lenientFactory()
-                .fromSet(ImmutableSet.of(Keyword.ANSWERED))
-                .asFlags())
-            .isEqualTo(new Flags(Flags.Flag.ANSWERED));
-    }
-
-    @Test
-    public void asFlagsWithRecentAndDeletedFromShouldBuildFlagsFromKeywordsAndRecentOriginFlags() {
-        Flags originFlags = FlagsBuilder.builder()
-            .add(Flag.RECENT, Flag.DRAFT)
-            .build();
-
-        Flags expectedFlags = FlagsBuilder.builder()
-            .add(Flag.ANSWERED, Flag.RECENT)
-            .build();
-
-        assertThat(Keywords.lenientFactory()
-                .fromSet(ImmutableSet.of(Keyword.ANSWERED))
-                .asFlagsWithRecentAndDeletedFrom(originFlags))
-            .isEqualTo(expectedFlags);
-    }
-
-    @Test
-    public void asFlagsWithRecentAndDeletedFromShouldBuildFlagsFromKeywordsWithDeletedAndRecentOriginFlags() {
-        Flags originFlags = FlagsBuilder.builder()
-            .add(Flag.RECENT, Flag.DELETED, Flag.DRAFT)
-            .build();
-
-        Flags expectedFlags = FlagsBuilder.builder()
-            .add(Flag.ANSWERED, Flag.RECENT, Flag.DELETED)
-            .build();
-
-        assertThat(Keywords.lenientFactory()
-                .fromSet(ImmutableSet.of(Keyword.ANSWERED))
-                .asFlagsWithRecentAndDeletedFrom(originFlags))
-            .isEqualTo(expectedFlags);
-    }
-
-    @Test
-    public void asMapShouldReturnEmptyWhenEmptyMapOfStringAndBoolean() {
-        assertThat(Keywords.lenientFactory()
-                .fromSet(ImmutableSet.of())
-                .asMap())
-            .isEmpty();
-    }
-
-    @Test
-    public void asMapShouldReturnMapOfStringAndBoolean() {
-        Map<String, Boolean> expectedMap = ImmutableMap.of("$Answered", Keyword.FLAG_VALUE);
-        assertThat(Keywords.lenientFactory()
-                .fromSet(ImmutableSet.of(Keyword.ANSWERED))
-                .asMap())
-            .isEqualTo(expectedMap);
-    }
-
-    @Test
-    public void throwWhenUnsupportedKeywordShouldThrowWhenHaveUnsupportedKeywords() {
-        assertThatThrownBy(() ->
-            Keywords.strictFactory()
-                .fromSet(ImmutableSet.of(Keyword.DRAFT, Keyword.DELETED)))
-            .isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void throwWhenUnsupportedKeywordShouldNotThrowWhenHaveDraft() {
-        Keywords keywords = Keywords.strictFactory()
-            .fromSet(ImmutableSet.of(Keyword.ANSWERED, Keyword.DRAFT));
-
-        assertThat(keywords.getKeywords())
-            .containsOnly(Keyword.ANSWERED, Keyword.DRAFT);
-    }
-
-    @Test
-    public void filterUnsupportedShouldFilter() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromSet(ImmutableSet.of(Keyword.ANSWERED, Keyword.DELETED, Keyword.RECENT, Keyword.DRAFT));
-
-        assertThat(keywords.getKeywords())
-            .containsOnly(Keyword.ANSWERED, Keyword.DRAFT);
-    }
-
-    @Test
-    public void containsShouldReturnTrueWhenKeywordsContainKeyword() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromSet(ImmutableSet.of(Keyword.SEEN));
-
-        assertThat(keywords.contains(Keyword.SEEN)).isTrue();
-    }
-
-    @Test
-    public void containsShouldReturnFalseWhenKeywordsDoNotContainKeyword() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromSet(ImmutableSet.of());
-
-        assertThat(keywords.contains(Keyword.SEEN)).isFalse();
-    }
-
-    @Test
-    public void fromListShouldReturnKeywordsFromListOfStrings() {
-        Keywords keywords = Keywords.lenientFactory()
-            .fromCollection(ImmutableList.of("$Answered", "$Flagged"));
-
-        assertThat(keywords.getKeywords())
-            .containsOnly(Keyword.ANSWERED, Keyword.FLAGGED);
-    }
-
-    @Test
-    public void fromListShouldNotThrowOnInvalidKeywordForLenientFactory() {
-        assertThat(Keywords.lenientFactory()
-            .fromCollection(ImmutableList.of("in&valid")))
-            .isEqualTo(Keywords.DEFAULT_VALUE);
-    }
-
-    @Test
-    public void fromMapShouldNotThrowOnInvalidKeywordForLenientFactory() {
-        assertThat(Keywords.lenientFactory()
-            .fromMap(ImmutableMap.of("in&valid", true)))
-            .isEqualTo(Keywords.DEFAULT_VALUE);
-    }
-
-    @Test
-    public void fromFlagsShouldNotThrowOnInvalidKeywordForLenientFactory() {
-        assertThat(Keywords.lenientFactory()
-            .fromFlags(new Flags("in&valid")))
-            .isEqualTo(Keywords.DEFAULT_VALUE);
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/MethodCallIdTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/MethodCallIdTest.java
deleted file mode 100644
index f3bff8f7ed..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/MethodCallIdTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import org.junit.Test;
-
-public class MethodCallIdTest {
-
-    @Test
-    public void nullInputShouldThrow() {
-        assertThatThrownBy(() -> MethodCallId.of(null)).isInstanceOf(NullPointerException.class);
-    }
-
-    @Test
-    public void emptyInputShouldThrow() {
-        assertThatThrownBy(() -> MethodCallId.of("")).isInstanceOf(IllegalArgumentException.class);
-    }
-
-
-    @Test
-    public void validInputShouldCreateMethodCallId() {
-        MethodCallId testee = MethodCallId.of("valid");
-        assertThat(testee).isNotNull();
-        assertThat(testee.getId()).isEqualTo("valid");
-    }
-
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/PreviewDTOTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/PreviewDTOTest.java
deleted file mode 100644
index 486cf4ca0a..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/PreviewDTOTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.Optional;
-
-import org.apache.james.jmap.api.model.Preview;
-import org.junit.jupiter.api.Test;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-
-class PreviewDTOTest {
-
-    private static final String EMPTY_PREVIEW = "(Empty)";
-    private static final String SAMPLE_PREVIEW_VALUE = "hello bob!";
-
-    @Test
-    void shouldMatchBeanContract() {
-        EqualsVerifier.forClass(PreviewDTO.class)
-            .verify();
-    }
-
-    @Test
-    void fromShouldReturnPreviewWithTheValue() {
-        assertThat(PreviewDTO.from(Optional.of(Preview.from(SAMPLE_PREVIEW_VALUE))))
-            .isEqualTo(PreviewDTO.of(SAMPLE_PREVIEW_VALUE));
-    }
-
-    @Test
-    void fromShouldReturnNoBodyWhenNoPreview() {
-        assertThat(PreviewDTO.from(Optional.empty()))
-            .isEqualTo(PreviewDTO.of(EMPTY_PREVIEW));
-    }
-
-    @Test
-    void fromShouldReturnNoBodyWhenPreviewOfEmptyString() {
-        assertThat(PreviewDTO.from(Optional.of(Preview.from(""))))
-            .isEqualTo(PreviewDTO.of(EMPTY_PREVIEW));
-    }
-
-    @Test
-    void ofShouldReturnPreviewWithTheValue() {
-        assertThat(PreviewDTO.of(SAMPLE_PREVIEW_VALUE))
-            .isEqualTo(PreviewDTO.of(SAMPLE_PREVIEW_VALUE));
-    }
-
-    @Test
-    void ofShouldReturnNoBodyWhenPreviewOfEmptyString() {
-        assertThat(PreviewDTO.of(""))
-            .isEqualTo(PreviewDTO.of(EMPTY_PREVIEW));
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/mailbox/RightsTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/mailbox/RightsTest.java
deleted file mode 100644
index f6ad7e4c35..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/mailbox/RightsTest.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.mailbox;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.model.mailbox.Rights.Right;
-import org.apache.james.mailbox.model.MailboxACL;
-import org.apache.james.mailbox.model.MailboxACL.Entry;
-import org.apache.james.mailbox.model.MailboxACL.EntryKey;
-import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
-import org.junit.Test;
-
-import com.google.common.collect.ImmutableMap;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-
-public class RightsTest {
-
-    public static final boolean NEGATIVE = true;
-    public static final Username USERNAME = Username.of("user");
-    public static final Username OTHER_USERNAME = Username.of("otherUser");
-
-    @Test
-    public void rightsShouldMatchBeanContract() {
-        EqualsVerifier.forClass(Rights.class)
-            .verify();
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenA() {
-        assertThat(Right.forChar('a'))
-            .isEqualTo(Right.Administer);
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenE() {
-        assertThat(Right.forChar('e'))
-            .isEqualTo(Right.Expunge);
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenI() {
-        assertThat(Right.forChar('i'))
-            .isEqualTo(Right.Insert);
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenL() {
-        assertThat(Right.forChar('l'))
-            .isEqualTo(Right.Lookup);
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenR() {
-        assertThat(Right.forChar('r'))
-            .isEqualTo(Right.Read);
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenW() {
-        assertThat(Right.forChar('w'))
-            .isEqualTo(Right.Write);
-    }
-
-    @Test
-    public void forCharShouldReturnRightWhenT() {
-        assertThat(Right.forChar('t'))
-            .isEqualTo(Right.DeleteMessages);
-    }
-
-    @Test
-    public void forCharShouldThrowOnUnsupportedRight() {
-        assertThatThrownBy(() -> Right.forChar('k'))
-            .isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void fromACLShouldFilterOutGroups() throws Exception {
-        MailboxACL acl = new MailboxACL(ImmutableMap.of(
-            EntryKey.createGroupEntryKey("group"), Rfc4314Rights.fromSerializedRfc4314Rights("aet")));
-
-        assertThat(Rights.fromACL(acl))
-            .isEqualTo(Rights.EMPTY);
-    }
-
-    @Test
-    public void fromACLShouldFilterNegatedUsers() throws Exception {
-        MailboxACL acl = new MailboxACL(ImmutableMap.of(
-            EntryKey.createUserEntryKey(USERNAME, NEGATIVE), Rfc4314Rights.fromSerializedRfc4314Rights("aet")));
-
-        assertThat(Rights.fromACL(acl))
-            .isEqualTo(Rights.EMPTY);
-    }
-
-    @Test
-    public void fromACLShouldAcceptUsers() throws Exception {
-        MailboxACL acl = new MailboxACL(ImmutableMap.of(
-            EntryKey.createUserEntryKey(USERNAME), Rfc4314Rights.fromSerializedRfc4314Rights("aet")));
-
-        assertThat(Rights.fromACL(acl))
-            .isEqualTo(Rights.builder()
-                .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.DeleteMessages)
-                .build());
-    }
-
-    @Test
-    public void fromACLShouldFilterOutUnknownRights() throws Exception {
-        MailboxACL acl = new MailboxACL(ImmutableMap.of(
-            EntryKey.createUserEntryKey(USERNAME), Rfc4314Rights.fromSerializedRfc4314Rights("aetpk")));
-
-        assertThat(Rights.fromACL(acl))
-            .isEqualTo(Rights.builder()
-                .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.DeleteMessages)
-                .build());
-    }
-
-    @Test
-    public void toMailboxAclShouldReturnEmptyAclWhenEmpty() {
-        Rights rights = Rights.EMPTY;
-
-        assertThat(rights.toMailboxAcl())
-            .isEqualTo(new MailboxACL());
-    }
-
-    @Test
-    public void toMailboxAclShouldReturnAclConversion() throws Exception {
-        String user1 = "user1";
-        String user2 = "user2";
-        Rights rights = Rights.builder()
-            .delegateTo(Username.of(user1), Right.Administer, Right.DeleteMessages)
-            .delegateTo(Username.of(user2), Right.Expunge, Right.Lookup)
-            .build();
-
-        assertThat(rights.toMailboxAcl())
-            .isEqualTo(new MailboxACL(
-                new Entry(user1, MailboxACL.Right.Administer, MailboxACL.Right.DeleteMessages),
-                new Entry(user2, MailboxACL.Right.PerformExpunge, MailboxACL.Right.Lookup)));
-    }
-
-    @Test
-    public void removeEntriesForShouldNotModifyEmptyRights() {
-        assertThat(Rights.EMPTY.removeEntriesFor(USERNAME))
-            .isEqualTo(Rights.EMPTY);
-    }
-
-    @Test
-    public void removeEntriesForShouldRemoveUsernameEntryWhenPresent() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Lookup)
-            .build();
-        assertThat(rights.removeEntriesFor(USERNAME))
-            .isEqualTo(Rights.EMPTY);
-    }
-
-    @Test
-    public void removeEntriesForShouldOnlyRemoveSpecifiedUsername() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Lookup)
-            .delegateTo(OTHER_USERNAME, Right.Lookup)
-            .build();
-
-        Rights expected = Rights.builder()
-            .delegateTo(OTHER_USERNAME, Right.Lookup)
-            .build();
-
-        assertThat(rights.removeEntriesFor(USERNAME))
-            .isEqualTo(expected);
-    }
-
-    @Test
-    public void mayAddItemsShouldReturnEmptyWhenNoUserRights() {
-        assertThat(Rights.EMPTY.mayAddItems(USERNAME))
-            .isEmpty();
-    }
-
-    @Test
-    public void mayCreateChildShouldReturnUnsupportedWhenNoUserRights() {
-        assertThat(Rights.EMPTY.mayCreateChild(USERNAME))
-            .isEqualTo(Rights.UNSUPPORTED);
-    }
-
-    @Test
-    public void mayDeleteShouldReturnUnsupportedWhenNoUserRights() {
-        assertThat(Rights.EMPTY.mayDelete(USERNAME))
-            .isEqualTo(Rights.UNSUPPORTED);
-    }
-
-    @Test
-    public void mayReadItemsShouldReturnEmptyWhenNoUserRights() {
-        assertThat(Rights.EMPTY.mayReadItems(USERNAME))
-            .isEmpty();
-    }
-
-    @Test
-    public void mayRemoveItemsShouldReturnEmptyWhenNoUserRights() {
-        assertThat(Rights.EMPTY.mayRemoveItems(USERNAME))
-            .isEmpty();
-    }
-
-    @Test
-    public void mayRenameShouldReturnEmptyWhenNoUserRights() {
-        assertThat(Rights.EMPTY.mayRename(USERNAME))
-            .isEmpty();
-    }
-
-    @Test
-    public void mayAddItemsShouldReturnFalseWhenNoInsertRights() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.Lookup,
-                Right.DeleteMessages, Right.Read, Right.Seen, Right.Write)
-            .build();
-
-        assertThat(rights.mayAddItems(USERNAME))
-            .contains(false);
-    }
-
-    @Test
-    public void mayCreateChildShouldReturnUnsupportedWhenFullRights() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.Lookup, Right.Insert,
-                Right.DeleteMessages, Right.Read, Right.Seen, Right.Write)
-            .build();
-
-        assertThat(rights.mayCreateChild(USERNAME))
-            .isEqualTo(Rights.UNSUPPORTED);
-    }
-
-    @Test
-    public void mayDeleteShouldReturnUnsupportedWhenFullRights() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.Lookup, Right.Insert,
-                Right.DeleteMessages, Right.Read, Right.Seen, Right.Write)
-            .build();
-
-        assertThat(rights.mayDelete(USERNAME))
-            .isEqualTo(Rights.UNSUPPORTED);
-    }
-
-    @Test
-    public void mayReadItemsShouldReturnFalseWhenNoReadRights() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.Lookup, Right.Insert,
-                Right.DeleteMessages, Right.Seen, Right.Write)
-            .build();
-
-        assertThat(rights.mayReadItems(USERNAME))
-            .contains(false);
-    }
-
-    @Test
-    public void mayRemoveItemsShouldReturnFalseWhenNoDeleteMessagesRights() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.Lookup, Right.Insert,
-                Right.Read, Right.Seen, Right.Write)
-            .build();
-
-        assertThat(rights.mayRemoveItems(USERNAME))
-            .contains(false);
-    }
-
-    @Test
-    public void mayRenameShouldReturnFalseWhenNoWriteRights() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Administer, Right.Expunge, Right.Lookup, Right.Insert,
-                Right.DeleteMessages, Right.Read, Right.Seen)
-            .build();
-
-        assertThat(rights.mayRename(USERNAME))
-            .isEqualTo(Rights.UNSUPPORTED);
-    }
-
-    @Test
-    public void mayAddItemsShouldReturnTrueWhenInsertRight() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Insert)
-            .build();
-
-        assertThat(rights.mayAddItems(USERNAME))
-            .contains(true);
-    }
-
-    @Test
-    public void mayReadItemsShouldReturnTrueWhenReadRight() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Read)
-            .build();
-
-        assertThat(rights.mayReadItems(USERNAME))
-            .contains(true);
-    }
-
-    @Test
-    public void mayRemoveItemsShouldReturnTrueWhenDeleteMessagesRight() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.DeleteMessages)
-            .build();
-
-        assertThat(rights.mayRemoveItems(USERNAME))
-            .contains(true);
-    }
-
-    @Test
-    public void mayRenameShouldReturnTrueWhenWriteRight() {
-        Rights rights = Rights.builder()
-            .delegateTo(USERNAME, Right.Write)
-            .build();
-
-        assertThat(rights.mayRename(USERNAME))
-            .isEqualTo(Rights.UNSUPPORTED);
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/BlobIdTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/BlobIdTest.java
deleted file mode 100644
index 20c49f4fd9..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/BlobIdTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import org.apache.james.jmap.model.BlobId;
-import org.junit.Test;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-
-public class BlobIdTest {
-
-    @Test
-    public void shouldNotAllowEmptyString() {
-        assertThatThrownBy(() -> BlobId.of("")).isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void shouldNotAllowNullInput() {
-        assertThatThrownBy(() -> BlobId.of((String) null)).isInstanceOf(IllegalArgumentException.class);
-    }
-
-    @Test
-    public void shouldCreateInstanceWhenSimpleString() {
-        assertThat(BlobId.of("simple string")).extracting(BlobId::getRawValue).isEqualTo("simple string");
-    }
-
-    @Test
-    public void shouldRespectJavaBeanContract() {
-        EqualsVerifier.forClass(BlobId.class).verify();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFastViewFactoryTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFastViewFactoryTest.java
deleted file mode 100644
index 95b916924b..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFastViewFactoryTest.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.ALICE_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.HEADERS_MAP;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.JACK_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.JACOB_EMAIL;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-
-import java.time.Clock;
-import java.util.List;
-import java.util.Optional;
-
-import jakarta.mail.Flags;
-
-import org.apache.james.blob.api.BucketName;
-import org.apache.james.blob.api.HashBlobId;
-import org.apache.james.blob.memory.MemoryBlobStoreDAO;
-import org.apache.james.jmap.api.model.Preview;
-import org.apache.james.jmap.api.projections.MessageFastViewPrecomputedProperties;
-import org.apache.james.jmap.methods.BlobManagerImpl;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.model.PreviewDTO;
-import org.apache.james.jmap.utils.JsoupHtmlTextExtractor;
-import org.apache.james.jmap.memory.projections.MemoryMessageFastViewProjection;
-import org.apache.james.jmap.memory.upload.InMemoryUploadRepository;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.StringBackedAttachmentIdFactory;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
-import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.metrics.tests.RecordingMetricFactory;
-import org.apache.james.server.blob.deduplication.DeDuplicationBlobStore;
-import org.apache.james.util.ClassLoaderUtils;
-import org.apache.james.util.html.HtmlTextExtractor;
-import org.apache.james.util.mime.MessageContentExtractor;
-import org.assertj.core.api.SoftAssertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableList;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-class MessageFastViewFactoryTest {
-
-    private static final String PREVIEW_1_STRING = "preview 1";
-    private static final Preview PREVIEW_1 = Preview.from(PREVIEW_1_STRING);
-    private static final String PREVIEW_3_STRING = "preview 3";
-    private static final Preview PREVIEW_3 = Preview.from(PREVIEW_3_STRING);
-    private static final String PREVIEW_4_STRING = "preview 4";
-    private static final Preview PREVIEW_4 = Preview.from(PREVIEW_4_STRING);
-    private static final String DEFAULT_PREVIEW_STRING = "blabla bloblo";
-    private static final MessageFastViewPrecomputedProperties PROJECTION_1 = MessageFastViewPrecomputedProperties
-        .builder()
-        .preview(PREVIEW_1)
-        .hasAttachment()
-        .build();
-    private static final MessageFastViewPrecomputedProperties PROJECTION_3 = MessageFastViewPrecomputedProperties
-        .builder()
-        .preview(PREVIEW_3)
-        .noAttachments()
-        .build();
-    private static final MessageFastViewPrecomputedProperties PROJECTION_4 = MessageFastViewPrecomputedProperties
-        .builder()
-        .preview(PREVIEW_4)
-        .noAttachments()
-        .build();
-
-    private MessageIdManager messageIdManager;
-    private MailboxSession session;
-    private MessageManager bobInbox;
-    private ComposedMessageId previewComputedMessage1;
-    private ComposedMessageId missingPreviewComputedMessage1;
-    private ComposedMessageId previewComputedMessage2;
-    private ComposedMessageId previewComputedMessage3;
-    private MessageFastViewFactory messageFastViewFactory;
-    private MemoryMessageFastViewProjection fastViewProjection;
-    private BlobManagerImpl blobManager;
-    private MessageFullViewFactory messageFullViewFactory;
-
-    @BeforeEach
-    void setUp() throws Exception {
-        HtmlTextExtractor htmlTextExtractor = new JsoupHtmlTextExtractor();
-
-        MessageContentExtractor messageContentExtractor = new MessageContentExtractor();
-
-        InMemoryIntegrationResources resources = InMemoryIntegrationResources.defaultResources();
-        messageIdManager = spy(resources.getMessageIdManager());
-        InMemoryMailboxManager mailboxManager = resources.getMailboxManager();
-
-        session = mailboxManager.createSystemSession(BOB);
-        MailboxId bobInboxId = mailboxManager.createMailbox(MailboxPath.inbox(session), session).get();
-
-        bobInbox = mailboxManager.getMailbox(bobInboxId, session);
-
-        previewComputedMessage1 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build(ClassLoaderUtils.getSystemResourceAsSharedStream("fullMessage.eml")),
-            session).getId();
-        missingPreviewComputedMessage1 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build(ClassLoaderUtils.getSystemResourceAsSharedStream("fullMessage.eml")),
-            session).getId();
-        previewComputedMessage2 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build(ClassLoaderUtils.getSystemResourceAsSharedStream("fullMessage.eml")),
-            session).getId();
-        previewComputedMessage3 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build(ClassLoaderUtils.getSystemResourceAsSharedStream("fullMessage.eml")),
-            session).getId();
-
-        fastViewProjection = new MemoryMessageFastViewProjection(new RecordingMetricFactory());
-
-        Mono.from(fastViewProjection.store(previewComputedMessage1.getMessageId(), PROJECTION_1))
-            .block();
-        Mono.from(fastViewProjection.store(previewComputedMessage2.getMessageId(), PROJECTION_3))
-            .block();
-        Mono.from(fastViewProjection.store(previewComputedMessage3.getMessageId(), PROJECTION_4))
-            .block();
-
-        blobManager = new BlobManagerImpl(resources.getAttachmentManager(), resources.getMessageIdManager(), resources.getMessageIdFactory(),
-            new InMemoryUploadRepository(new DeDuplicationBlobStore(new MemoryBlobStoreDAO(), BucketName.of("default"), new HashBlobId.Factory()),
-                Clock.systemUTC()), new StringBackedAttachmentIdFactory());
-        messageFullViewFactory = new MessageFullViewFactory(blobManager, messageContentExtractor, htmlTextExtractor, messageIdManager,
-            new MemoryMessageFastViewProjection(new RecordingMetricFactory()));
-        messageFastViewFactory = new MessageFastViewFactory(blobManager, messageIdManager, fastViewProjection, messageFullViewFactory);
-    }
-
-    @Test
-    void fromMessageIdsShouldReturnAMessageWithComputedFastProperties() throws Exception {
-        MessageFastView actual = messageFastViewFactory.fromMessageIds(ImmutableList.of(previewComputedMessage1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-            softly.assertThat(actual.getId()).isEqualTo(previewComputedMessage1.getMessageId());
-            softly.assertThat(actual.getMailboxIds()).containsExactly(bobInbox.getId());
-            softly.assertThat(actual.getThreadId()).isEqualTo(previewComputedMessage1.getMessageId().serialize());
-            softly.assertThat(actual.getSize()).isEqualTo(Number.fromLong(2255));
-            softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN).asMap());
-            softly.assertThat(actual.getBlobId()).isEqualTo(BlobId.of(previewComputedMessage1.getMessageId().serialize()));
-            softly.assertThat(actual.getInReplyToMessageId()).isEqualTo(Optional.of(BOB.asString()));
-            softly.assertThat(actual.getHeaders()).isEqualTo(HEADERS_MAP);
-            softly.assertThat(actual.getFrom()).isEqualTo(Optional.of(ALICE_EMAIL));
-            softly.assertThat(actual.getTo()).isEqualTo(ImmutableList.of(BOB_EMAIL));
-            softly.assertThat(actual.getCc()).isEqualTo(ImmutableList.of(JACK_EMAIL, JACOB_EMAIL));
-            softly.assertThat(actual.getBcc()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getReplyTo()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getSubject()).isEqualTo("Full message");
-            softly.assertThat(actual.getDate()).isEqualTo("2016-06-07T14:23:37Z");
-
-            softly.assertThat(actual.isHasAttachment()).isTrue();
-            softly.assertThat(actual.getPreview()).isEqualTo(PreviewDTO.of(PREVIEW_1_STRING));
-        });
-    }
-
-    @Test
-    void fromMessageIdsShouldReturnAMessageWithPropertiesComputedFromFullMessageWhenNotPreComputed() throws Exception {
-        MessageFastView actual = messageFastViewFactory.fromMessageIds(ImmutableList.of(missingPreviewComputedMessage1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-            softly.assertThat(actual.getId()).isEqualTo(missingPreviewComputedMessage1.getMessageId());
-            softly.assertThat(actual.getMailboxIds()).containsExactly(bobInbox.getId());
-            softly.assertThat(actual.getThreadId()).isEqualTo(missingPreviewComputedMessage1.getMessageId().serialize());
-            softly.assertThat(actual.getSize()).isEqualTo(Number.fromLong(2255));
-            softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN).asMap());
-            softly.assertThat(actual.getBlobId()).isEqualTo(BlobId.of(missingPreviewComputedMessage1.getMessageId().serialize()));
-            softly.assertThat(actual.getInReplyToMessageId()).isEqualTo(Optional.of(BOB.asString()));
-            softly.assertThat(actual.getHeaders()).isEqualTo(HEADERS_MAP);
-            softly.assertThat(actual.getFrom()).isEqualTo(Optional.of(ALICE_EMAIL));
-            softly.assertThat(actual.getTo()).isEqualTo(ImmutableList.of(BOB_EMAIL));
-            softly.assertThat(actual.getCc()).isEqualTo(ImmutableList.of(JACK_EMAIL, JACOB_EMAIL));
-            softly.assertThat(actual.getBcc()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getReplyTo()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getSubject()).isEqualTo("Full message");
-            softly.assertThat(actual.getDate()).isEqualTo("2016-06-07T14:23:37Z");
-
-            softly.assertThat(actual.isHasAttachment()).isTrue();
-            softly.assertThat(actual.getPreview()).isEqualTo(PreviewDTO.of(DEFAULT_PREVIEW_STRING));
-        });
-    }
-
-    @Test
-    void fromMessageIdsShouldReturnMessagesWithPreviews() throws Exception {
-        List<MessageFastView> actual = messageFastViewFactory
-            .fromMessageIds(ImmutableList.of(
-                    previewComputedMessage2.getMessageId(),
-                    previewComputedMessage3.getMessageId(),
-                    missingPreviewComputedMessage1.getMessageId(),
-                    previewComputedMessage1.getMessageId()),
-                session).collectList().block();
-
-        assertThat(actual)
-            .hasSize(4)
-            .extracting(MessageFastView::getPreview)
-            .containsOnly(
-                PreviewDTO.of(PREVIEW_3_STRING),
-                PreviewDTO.of(PREVIEW_4_STRING),
-                PreviewDTO.of(DEFAULT_PREVIEW_STRING),
-                PreviewDTO.of(PREVIEW_1_STRING));
-    }
-
-    @Test
-    void fromMessageIdsShouldKeepProcessingEvenWhenFetchingFail() {
-        doReturn(Flux.error(new MailboxException("mock exception")))
-            .doCallRealMethod()
-            .when(messageIdManager).getMessagesReactive(any(), any(), any());
-
-        List<MessageFastView> actual = messageFastViewFactory
-            .fromMessageIds(ImmutableList.of(
-                    missingPreviewComputedMessage1.getMessageId(),
-                    previewComputedMessage1.getMessageId()),
-                session)
-            .collectList().block();
-
-
-        assertThat(actual)
-            .hasSize(1)
-            .extracting(MessageFastView::getId)
-            .containsAnyOf(missingPreviewComputedMessage1.getMessageId(), previewComputedMessage1.getMessageId());
-    }
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewFactoryTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewFactoryTest.java
deleted file mode 100644
index 6d94a5aa04..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewFactoryTest.java
+++ /dev/null
@@ -1,951 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.ALICE_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.HEADERS_MAP;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.JACK_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.JACOB_EMAIL;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Awaitility.await;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-import java.time.Clock;
-import java.time.Duration;
-import java.time.Instant;
-import java.util.List;
-import java.util.Optional;
-
-import jakarta.mail.Flags;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.james.blob.api.BucketName;
-import org.apache.james.blob.api.HashBlobId;
-import org.apache.james.blob.memory.MemoryBlobStoreDAO;
-import org.apache.james.jmap.api.model.Preview;
-import org.apache.james.jmap.api.projections.MessageFastViewPrecomputedProperties;
-import org.apache.james.jmap.methods.BlobManagerImpl;
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.model.PreviewDTO;
-import org.apache.james.jmap.model.message.view.MessageFullViewFactory.MetaDataWithContent;
-import org.apache.james.jmap.utils.JsoupHtmlTextExtractor;
-import org.apache.james.jmap.memory.projections.MemoryMessageFastViewProjection;
-import org.apache.james.jmap.memory.upload.InMemoryUploadRepository;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.MessageUid;
-import org.apache.james.mailbox.StringBackedAttachmentIdFactory;
-import org.apache.james.mailbox.inmemory.InMemoryId;
-import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
-import org.apache.james.mailbox.inmemory.InMemoryMessageId;
-import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
-import org.apache.james.mailbox.model.AttachmentMetadata;
-import org.apache.james.mailbox.model.Cid;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.FetchGroup;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MessageAttachmentMetadata;
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.model.MessageRange;
-import org.apache.james.mailbox.model.MessageResult;
-import org.apache.james.mailbox.model.StringBackedAttachmentId;
-import org.apache.james.mailbox.model.TestMessageId;
-import org.apache.james.metrics.tests.RecordingMetricFactory;
-import org.apache.james.server.blob.deduplication.DeDuplicationBlobStore;
-import org.apache.james.util.ClassLoaderUtils;
-import org.apache.james.util.html.HtmlTextExtractor;
-import org.apache.james.util.mime.MessageContentExtractor;
-import org.assertj.core.api.SoftAssertions;
-import org.awaitility.core.ConditionFactory;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Nested;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-import reactor.core.publisher.Mono;
-
-class MessageFullViewFactoryTest {
-    private static final String FORWARDED = "forwarded";
-    private static final InMemoryId MAILBOX_ID = InMemoryId.of(18L);
-    private static final Instant INTERNAL_DATE = Instant.parse("2012-02-03T14:30:42Z");
-    private static final String DEFAULT_PREVIEW_AS_STRING = "blabla bloblo";
-    private static final Preview DEFAULT_PREVIEW = Preview.from(DEFAULT_PREVIEW_AS_STRING);
-    private static final ConditionFactory AWAIT_CONDITION = await()
-            .timeout(Duration.ofSeconds(5));
-
-    private MessageIdManager messageIdManager;
-    private MailboxSession session;
-    private MessageManager bobInbox;
-    private MessageManager bobMailbox;
-    private ComposedMessageId message1;
-    private MessageFullViewFactory messageFullViewFactory;
-    private MemoryMessageFastViewProjection fastViewProjection;
-
-    @BeforeEach
-    void setUp() throws Exception {
-        MessageContentExtractor messageContentExtractor = new MessageContentExtractor();
-        HtmlTextExtractor htmlTextExtractor = new JsoupHtmlTextExtractor();
-
-        InMemoryIntegrationResources resources = InMemoryIntegrationResources.defaultResources();
-        messageIdManager = resources.getMessageIdManager();
-        InMemoryMailboxManager mailboxManager = resources.getMailboxManager();
-
-        session = mailboxManager.createSystemSession(BOB);
-        MailboxId bobInboxId = mailboxManager.createMailbox(MailboxPath.inbox(session), session).get();
-        MailboxId bobMailboxId = mailboxManager.createMailbox(MailboxPath.forUser(BOB, "anotherMailbox"), session).get();
-
-        bobInbox = mailboxManager.getMailbox(bobInboxId, session);
-        bobMailbox = mailboxManager.getMailbox(bobMailboxId, session);
-
-        message1 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build(ClassLoaderUtils.getSystemResourceAsSharedStream("fullMessage.eml")),
-            session).getId();
-
-        fastViewProjection = spy(new MemoryMessageFastViewProjection(new RecordingMetricFactory()));
-        BlobManagerImpl blobManager = new BlobManagerImpl(resources.getAttachmentManager(), resources.getMessageIdManager(), resources.getMessageIdFactory(),
-            new InMemoryUploadRepository(new DeDuplicationBlobStore(new MemoryBlobStoreDAO(),
-                BucketName.of("default"), new HashBlobId.Factory()), Clock.systemUTC()),
-            new StringBackedAttachmentIdFactory());
-        messageFullViewFactory = new MessageFullViewFactory(blobManager, messageContentExtractor, htmlTextExtractor,
-            messageIdManager,
-            fastViewProjection);
-    }
-
-    @Test
-    void fromMessageResultsShouldReturnCorrectView() throws Exception {
-        MessageFullView actual = messageFullViewFactory.fromMessageIds(ImmutableList.of(message1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-            softly.assertThat(actual.getId()).isEqualTo(message1.getMessageId());
-            softly.assertThat(actual.getMailboxIds()).containsExactly(bobInbox.getId());
-            softly.assertThat(actual.getThreadId()).isEqualTo(message1.getMessageId().serialize());
-            softly.assertThat(actual.getSize()).isEqualTo(Number.fromLong(2255));
-            softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN).asMap());
-            softly.assertThat(actual.getBlobId()).isEqualTo(BlobId.of(message1.getMessageId().serialize()));
-            softly.assertThat(actual.getInReplyToMessageId()).isEqualTo(Optional.of(BOB.asString()));
-            softly.assertThat(actual.getHeaders()).isEqualTo(HEADERS_MAP);
-            softly.assertThat(actual.getFrom()).isEqualTo(Optional.of(ALICE_EMAIL));
-            softly.assertThat(actual.getTo()).isEqualTo(ImmutableList.of(BOB_EMAIL));
-            softly.assertThat(actual.getCc()).isEqualTo(ImmutableList.of(JACK_EMAIL, JACOB_EMAIL));
-            softly.assertThat(actual.getBcc()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getReplyTo()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getSubject()).isEqualTo("Full message");
-            softly.assertThat(actual.getDate()).isEqualTo("2016-06-07T14:23:37Z");
-            softly.assertThat(actual.isHasAttachment()).isEqualTo(true);
-            softly.assertThat(actual.getPreview()).isEqualTo(PreviewDTO.of("blabla bloblo"));
-            softly.assertThat(actual.getTextBody()).isEqualTo(Optional.of("/blabla/\n*bloblo*\n"));
-            softly.assertThat(actual.getHtmlBody()).isEqualTo(Optional.of("<i>blabla</i>\n<b>bloblo</b>\n"));
-            softly.assertThat(actual.getAttachments()).hasSize(1);
-            softly.assertThat(actual.getAttachedMessages()).hasSize(0);
-        });
-    }
-
-    @Test
-    void fromMessageResultsShouldCombineKeywords() throws Exception {
-        messageIdManager.setInMailboxes(message1.getMessageId(), ImmutableList.of(bobInbox.getId(), bobMailbox.getId()), session);
-        bobMailbox.setFlags(new Flags(Flags.Flag.FLAGGED), MessageManager.FlagsUpdateMode.REPLACE, MessageRange.all(), session);
-
-        MessageFullView actual = messageFullViewFactory.fromMessageIds(ImmutableList.of(message1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-            softly.assertThat(actual.getId()).isEqualTo(message1.getMessageId());
-            softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN, Keyword.FLAGGED).asMap());
-        });
-    }
-
-    @Test
-    void emptyMailShouldBeLoadedIntoMessage() throws Exception {
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-                .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-                .size(0)
-                .internalDate(INTERNAL_DATE)
-                .content(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee)
-            .extracting(MessageFullView::getPreview, MessageFullView::getSize, MessageFullView::getSubject, MessageFullView::getHeaders, MessageFullView::getDate)
-            .containsExactly(PreviewDTO.of(""), Number.ZERO, "", ImmutableMap.of(), INTERNAL_DATE);
-    }
-
-    @Test
-    void flagsShouldBeSetIntoMessage() throws Exception {
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-                .keywords(Keywords.strictFactory().from(Keyword.ANSWERED, Keyword.FLAGGED, Keyword.DRAFT, Keyword.FORWARDED))
-                .size(0)
-                .internalDate(INTERNAL_DATE)
-                .content(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee)
-            .extracting(MessageFullView::isIsUnread, MessageFullView::isIsFlagged, MessageFullView::isIsAnswered, MessageFullView::isIsDraft, MessageFullView::isIsForwarded)
-            .containsExactly(true, true, true, true, true);
-    }
-
-    @Test
-    void headersShouldBeSetIntoMessage() throws Exception {
-        Keywords keywords = Keywords.strictFactory().from(Keyword.SEEN);
-        String headers = "From: user <us...@domain>\n"
-                + "Subject: test subject\n"
-                + "To: user1 <us...@domain>, user2 <us...@domain>\n"
-                + "Cc: usercc <us...@domain>\n"
-                + "Bcc: userbcc <us...@domain>\n"
-                + "Reply-To: \"user to reply to\" <us...@domain>\n"
-                + "In-Reply-To: <SN...@phx.gbl>\n"
-                + "Date: Tue, 14 Jul 2015 12:30:42 +0000\n"
-                + "Other-header: other header value";
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-                .keywords(keywords)
-                .size(headers.length())
-                .internalDate(INTERNAL_DATE)
-                .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-
-        Emailer user = Emailer.builder().name("user").email("user@domain").build();
-        Emailer user1 = Emailer.builder().name("user1").email("user1@domain").build();
-        Emailer user2 = Emailer.builder().name("user2").email("user2@domain").build();
-        Emailer usercc = Emailer.builder().name("usercc").email("usercc@domain").build();
-        Emailer userbcc = Emailer.builder().name("userbcc").email("userbcc@domain").build();
-        Emailer userRT = Emailer.builder().name("user to reply to").email("user.reply.to@domain").build();
-        ImmutableMap<String, String> headersMap = ImmutableMap.<String, String>builder()
-                .put("Cc", "usercc <us...@domain>")
-                .put("Bcc", "userbcc <us...@domain>")
-                .put("Subject", "test subject")
-                .put("From", "user <us...@domain>")
-                .put("To", "user1 <us...@domain>, user2 <us...@domain>")
-                .put("Reply-To", "\"user to reply to\" <us...@domain>")
-                .put("In-Reply-To", "<SN...@phx.gbl>")
-                .put("Other-header", "other header value")
-                .put("Date", "Tue, 14 Jul 2015 12:30:42 +0000")
-                .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        MessageFullView expected = MessageFullView.builder()
-                .id(TestMessageId.of(2))
-                .blobId(BlobId.of("2"))
-                .threadId("2")
-                .mailboxId(MAILBOX_ID)
-                .inReplyToMessageId("<SN...@phx.gbl>")
-                .headers(headersMap)
-                .from(user)
-                .to(ImmutableList.of(user1, user2))
-                .cc(ImmutableList.of(usercc))
-                .bcc(ImmutableList.of(userbcc))
-                .replyTo(ImmutableList.of(userRT))
-                .subject("test subject")
-                .date(Instant.parse("2015-07-14T12:30:42.000Z"))
-                .size(headers.length())
-                .preview(Preview.from("(Empty)"))
-                .textBody(Optional.of(""))
-                .htmlBody(Optional.empty())
-                .keywords(keywords)
-                .hasAttachment(false)
-                .build();
-        assertThat(testee).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    void headersShouldBeUnfoldedAndDecoded() throws Exception {
-        Keywords keywords = Keywords.strictFactory().from(Keyword.SEEN);
-        String headers = "From: user <us...@domain>\n"
-            + "Subject: test subject\n"
-            + "To: user1 <us...@domain>,\r\n"
-            + " user2 <us...@domain>\n"
-            + "Cc: =?UTF-8?Q?Beno=c3=aet_TELLIER?= <te...@linagora.com>";
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(keywords)
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-
-        Emailer user = Emailer.builder().name("user").email("user@domain").build();
-        Emailer user1 = Emailer.builder().name("user1").email("user1@domain").build();
-        Emailer user2 = Emailer.builder().name("user2").email("user2@domain").build();
-        Emailer usercc = Emailer.builder().name("Benoît TELLIER").email("tellier@linagora.com").build();
-        ImmutableMap<String, String> headersMap = ImmutableMap.<String, String>builder()
-            .put("Cc", "Benoît TELLIER <te...@linagora.com>")
-            .put("Subject", "test subject")
-            .put("From", "user <us...@domain>")
-            .put("To", "user1 <us...@domain>, user2 <us...@domain>")
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        MessageFullView expected = MessageFullView.builder()
-            .id(TestMessageId.of(2))
-            .blobId(BlobId.of("2"))
-            .threadId("2")
-            .mailboxId(MAILBOX_ID)
-            .headers(headersMap)
-            .from(user)
-            .to(ImmutableList.of(user1, user2))
-            .cc(ImmutableList.of(usercc))
-            .subject("test subject")
-            .date(Instant.parse("2012-02-03T14:30:42.000Z"))
-            .size(headers.length())
-            .preview(Preview.from("(Empty)"))
-            .textBody(Optional.of(""))
-            .htmlBody(Optional.empty())
-            .keywords(keywords)
-            .hasAttachment(false)
-            .build();
-
-        assertThat(testee).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    void multivaluedHeadersShouldBeSeparatedByLineFeed() throws Exception {
-        Keywords keywords = Keywords.strictFactory().from(Keyword.SEEN);
-        String headers = "From: user <us...@domain>\n"
-            + "Subject: test subject\n"
-            + "Multi-header: first value\n"
-            + "To: user1 <us...@domain>\n"
-            + "Multi-header: second value\n";
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(keywords)
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-
-        Emailer user = Emailer.builder().name("user").email("user@domain").build();
-        Emailer user1 = Emailer.builder().name("user1").email("user1@domain").build();
-        ImmutableMap<String, String> headersMap = ImmutableMap.<String, String>builder()
-            .put("From", "user <us...@domain>")
-            .put("Subject", "test subject")
-            .put("Multi-header", "first value\nsecond value")
-            .put("To", "user1 <us...@domain>")
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        MessageFullView expected = MessageFullView.builder()
-            .id(TestMessageId.of(2))
-            .blobId(BlobId.of("2"))
-            .threadId("2")
-            .mailboxId(MAILBOX_ID)
-            .headers(headersMap)
-            .from(user)
-            .to(ImmutableList.of(user1))
-            .subject("test subject")
-            .date(Instant.parse("2012-02-03T14:30:42.000Z"))
-            .size(headers.length())
-            .preview(Preview.from("(Empty)"))
-            .textBody(Optional.of(""))
-            .htmlBody(Optional.empty())
-            .keywords(keywords)
-            .hasAttachment(false)
-            .build();
-
-        assertThat(testee).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    void textBodyShouldBeSetIntoMessage() throws Exception {
-        Keywords keywords = Keywords.strictFactory().from(Keyword.SEEN);
-        String headers = "Subject: test subject\n";
-        String body = "Mail body";
-        String mail = headers + "\n" + body;
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-                .keywords(keywords)
-                .size(mail.length())
-                .internalDate(INTERNAL_DATE)
-                .content(new ByteArrayInputStream(mail.getBytes(StandardCharsets.UTF_8)))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee.getTextBody()).hasValue("Mail body");
-    }
-
-    @Test
-    void textBodyShouldNotOverrideWhenItIsThere() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("Subject\n"
-            + "MIME-Version: 1.0\n"
-            + "Content-Type: multipart/alternative;\n"
-            + "\tboundary=\"----=_Part_370449_1340169331.1489506420401\"\n"
-            + "\n"
-            + "------=_Part_370449_1340169331.1489506420401\n"
-            + "Content-Type: text/plain; charset=UTF-8\n"
-            + "Content-Transfer-Encoding: 7bit\n"
-            + "\n"
-            + "My plain message\n"
-            + "------=_Part_370449_1340169331.1489506420401\n"
-            + "Content-Type: text/html; charset=UTF-8\n"
-            + "Content-Transfer-Encoding: 7bit\n"
-            + "\n"
-            + "<a>The </a> <strong>HTML</strong> message"
-        ).getBytes(StandardCharsets.UTF_8));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .internalDate(INTERNAL_DATE)
-            .size(1000)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getTextBody())
-            .isPresent()
-            .isEqualTo(Optional.of("My plain message"));
-    }
-
-    @Test
-    void previewShouldBeLimitedTo256Length() throws Exception {
-        String headers = "Subject: test subject\n";
-        String body300 = "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-                + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-                + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999";
-        PreviewDTO expectedPreview = PreviewDTO.of("0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-                + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-                + "00000000001111111111222222222233333333334444444444555555");
-        assertThat(body300.length()).isEqualTo(300);
-        assertThat(expectedPreview.getValue().length()).isEqualTo(256);
-        String mail = headers + "\n" + body300;
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-                .size(mail.length())
-                .internalDate(INTERNAL_DATE)
-                .content(new ByteArrayInputStream(mail.getBytes(StandardCharsets.UTF_8)))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee.getPreview())
-            .isEqualTo(expectedPreview);
-    }
-
-    @Test
-    void attachmentsShouldBeEmptyWhenNone() throws Exception {
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-                .size(0)
-                .internalDate(INTERNAL_DATE)
-                .content(ClassLoader.getSystemResourceAsStream("spamMail.eml"))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee.getAttachments()).isEmpty();
-    }
-
-    @Test
-    void attachmentsShouldBeRetrievedWhenSome() throws Exception {
-        String payload = "payload";
-        BlobId blodId = BlobId.of("id1");
-        String type = "content";
-        Attachment expectedAttachment = Attachment.builder()
-                .blobId(blodId)
-                .size(payload.length())
-                .type(type)
-                .cid("cid")
-                .isInline(true)
-                .build();
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-                .size(0)
-                .internalDate(INTERNAL_DATE)
-                .content(ClassLoader.getSystemResourceAsStream("spamMail.eml"))
-                .attachments(ImmutableList.of(MessageAttachmentMetadata.builder()
-                        .attachment(AttachmentMetadata.builder()
-                                .messageId(InMemoryMessageId.of(46))
-                                .attachmentId(StringBackedAttachmentId.from(blodId.getRawValue()))
-                                .size(payload.length())
-                                .type(type)
-                                .build())
-                        .cid(Cid.from("cid"))
-                        .isInline(true)
-                        .build()))
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getAttachments()).hasSize(1);
-        assertThat(testee.getAttachments().get(0)).isEqualToComparingFieldByField(expectedAttachment);
-    }
-
-    @Test
-    void invalidAddressesShouldBeAllowed() throws Exception {
-        String headers = "From: user <userdomain>\n"
-            + "To: user1 <user1domain>, user2 <user2domain>\n"
-            + "Cc: usercc <userccdomain>\n"
-            + "Bcc: userbcc <userbccdomain>\n"
-            + "Subject: test subject\n";
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(new TestMessageId.Factory().generate())
-            .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        Emailer user = Emailer.builder().name("user").email("userdomain").allowInvalid().build();
-        Emailer user1 = Emailer.builder().name("user1").email("user1domain").allowInvalid().build();
-        Emailer user2 = Emailer.builder().name("user2").email("user2domain").allowInvalid().build();
-        Emailer usercc = Emailer.builder().name("usercc").email("userccdomain").allowInvalid().build();
-        Emailer userbcc = Emailer.builder().name("userbcc").email("userbccdomain").allowInvalid().build();
-
-        assertThat(testee.getFrom()).contains(user);
-        assertThat(testee.getTo()).contains(user1, user2);
-        assertThat(testee.getCc()).contains(usercc);
-        assertThat(testee.getBcc()).contains(userbcc);
-    }
-
-    @Test
-    void messageWithoutFromShouldHaveEmptyFromField() throws Exception {
-        String headers = "To: user <us...@domain>\n"
-            + "Subject: test subject\n";
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(new TestMessageId.Factory().generate())
-            .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getFrom()).isEmpty();
-    }
-
-    @Test
-    void dateFromHeaderShouldBeUsedIfPresent() throws Exception {
-        String headers = "From: user <userdomain>\n"
-            + "To: user1 <user1domain>, user2 <user2domain>\n"
-            + "Cc: usercc <userccdomain>\n"
-            + "Bcc: userbcc <userbccdomain>\n"
-            + "Date: Wed, 17 May 2017 14:18:52 +0300\n"
-            + "Subject: test subject\n";
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(new TestMessageId.Factory().generate())
-            .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getDate())
-            .isEqualTo(Instant.parse("2017-05-17T11:18:52.000Z"));
-    }
-
-    @Test
-    void dateFromHeaderShouldUseCurrentCenturyWhenNone() throws Exception {
-        String headers = "From: user <userdomain>\n"
-            + "To: user1 <user1domain>, user2 <user2domain>\n"
-            + "Cc: usercc <userccdomain>\n"
-            + "Bcc: userbcc <userbccdomain>\n"
-            + "Date: Wed, 17 May 17 14:18:52 +0300\n"
-            + "Subject: test subject\n";
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(new TestMessageId.Factory().generate())
-            .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getDate())
-            .isEqualTo(Instant.parse("2017-05-17T11:18:52.000Z"));
-    }
-
-    @Test
-    void internalDateShouldBeUsedIfNoDateInHeaders() throws Exception {
-        String headers = "From: user <userdomain>\n"
-            + "To: user1 <user1domain>, user2 <user2domain>\n"
-            + "Cc: usercc <userccdomain>\n"
-            + "Bcc: userbcc <userbccdomain>\n"
-            + "Subject: test subject\n";
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(headers.length())
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream(headers.getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(new TestMessageId.Factory().generate())
-            .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getDate()).isEqualTo(INTERNAL_DATE);
-    }
-
-    @Test
-    void mailWithBigLinesShouldBeLoadedIntoMessage() throws Exception {
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-                .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-                .size(1010)
-                .internalDate(INTERNAL_DATE)
-                .content(new ByteArrayInputStream((StringUtils.repeat("0123456789", 101).getBytes(StandardCharsets.UTF_8))))
-                .attachments(ImmutableList.of())
-                .mailboxId(MAILBOX_ID)
-                .messageId(TestMessageId.of(2))
-                .build();
-
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee)
-            .extracting(MessageFullView::getPreview, MessageFullView::getSize, MessageFullView::getSubject, MessageFullView::getHeaders, MessageFullView::getDate)
-            .containsExactly(PreviewDTO.of(""), Number.fromLong(1010L), "", ImmutableMap.of(), INTERNAL_DATE);
-    }
-
-    @Test
-    void textBodyShouldBeSetIntoMessageInCaseOfHtmlBody() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("CContent-Type: text/html\r\n"
-            + "Subject: message 1 subject\r\n"
-            + "\r\n"
-            + "my <b>HTML</b> message").getBytes(StandardCharsets.UTF_8));
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getPreview())
-            .isEqualTo(PreviewDTO.of("my HTML message"));
-        assertThat(testee.getTextBody()).hasValue("my HTML message");
-        assertThat(testee.getHtmlBody()).hasValue("my <b>HTML</b> message");
-    }
-
-    @Test
-    void textBodyShouldBeEmptyInCaseOfEmptyHtmlBodyAndEmptyTextBody() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("CContent-Type: text/html\r\n"
-            + "Subject: message 1 subject\r\n").getBytes(StandardCharsets.UTF_8));
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getPreview()).isEqualTo(PreviewDTO.of(""));
-        assertThat(testee.getHtmlBody()).contains("");
-        assertThat(testee.getTextBody()).isEmpty();
-    }
-
-    @Test
-    void previewBodyShouldReturnTruncatedStringWithoutHtmlTagWhenHtmlBodyContainTags() throws Exception {
-        String body = "This is a <b>HTML</b> mail containing <u>underlined part</u>, <i>italic part</i> and <u><i>underlined AND italic part</i></u>9999999999"
-            + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-            + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-            + "000000000011111111112222222222333333333344444444445555555";
-        String expected = "This is a HTML mail containing underlined part, italic part and underlined AND italic part9999999999"
-            + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-            + "00000000001111111111222222222233333333334444444444555555";
-
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("CContent-Type: text/html\r\n"
-            + "Subject: message 1 subject\r\n"
-            + "\r\n"
-            + body).getBytes(StandardCharsets.UTF_8));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getPreview())
-            .isEqualTo(PreviewDTO.of(expected));
-    }
-
-    @Test
-    void previewBodyShouldReturnTextBodyWhenNoHtmlBody() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("CContent-Type: text/plain\r\n"
-            + "Subject: message 1 subject\r\n"
-            + "\r\n"
-            + "My plain text").getBytes(StandardCharsets.UTF_8));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee.getPreview())
-            .isEqualTo(PreviewDTO.of("My plain text"));
-    }
-
-    @Test
-    void previewBodyShouldReturnStringEmptyWhenNoHtmlBodyAndNoTextBody() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("Subject: message 1 subject\r\n").getBytes(StandardCharsets.UTF_8));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee)
-            .extracting(MessageFullView::getPreview, MessageFullView::getHtmlBody, MessageFullView::getTextBody)
-            .containsExactly(PreviewDTO.of(""), Optional.empty(), Optional.of(""));
-    }
-
-    @Test
-    void previewBodyShouldReturnStringEmptyWhenNoMeaningHtmlBodyAndNoTextBody() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("CContent-Type: text/html\r\n"
-            + "Subject: message 1 subject\r\n"
-            + "\r\n"
-            + "<html><body></body></html>").getBytes(StandardCharsets.UTF_8));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee)
-            .extracting(MessageFullView::getPreview, MessageFullView::getHtmlBody, MessageFullView::getTextBody)
-            .containsExactly(PreviewDTO.of(""), Optional.of("<html><body></body></html>"), Optional.empty());
-    }
-
-    @Test
-    void previewBodyShouldReturnTextBodyWhenNoMeaningHtmlBodyAndTextBody() throws Exception {
-        ByteArrayInputStream messageContent = new ByteArrayInputStream(("Subject\n"
-            + "MIME-Version: 1.0\n"
-            + "Content-Type: multipart/alternative;\n"
-            + "\tboundary=\"----=_Part_370449_1340169331.1489506420401\"\n"
-            + "\n"
-            + "------=_Part_370449_1340169331.1489506420401\n"
-            + "Content-Type: text/plain; charset=UTF-8\n"
-            + "Content-Transfer-Encoding: 7bit\n"
-            + "\n"
-            + "My plain message\n"
-            + "------=_Part_370449_1340169331.1489506420401\n"
-            + "Content-Type: text/html; charset=UTF-8\n"
-            + "Content-Transfer-Encoding: 7bit\n"
-            + "\n"
-            + "<html></html>"
-        ).getBytes(StandardCharsets.UTF_8));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(Keywords.strictFactory().from(Keyword.SEEN))
-            .size(messageContent.read())
-            .internalDate(INTERNAL_DATE)
-            .content(messageContent)
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-
-        assertThat(testee)
-            .extracting(MessageFullView::getPreview, MessageFullView::getHtmlBody, MessageFullView::getTextBody)
-            .containsExactly(PreviewDTO.of("My plain message"), Optional.of("<html></html>"), Optional.of("My plain message"));
-    }
-
-    @Test
-    void keywordShouldBeSetIntoMessage() throws Exception {
-        Keywords keywords = Keywords.strictFactory().from(Keyword.SEEN, Keyword.DRAFT);
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(keywords)
-            .size(0)
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee.getKeywords()).containsAllEntriesOf(keywords.asMap());
-    }
-
-    @Test
-    void keywordWithUserFlagShouldBeSetIntoMessage() throws Exception {
-        Keywords keywords = Keywords.strictFactory().from(Keyword.ANSWERED, Keyword.of(FORWARDED));
-
-        MetaDataWithContent testMail = MetaDataWithContent.builder()
-            .uid(MessageUid.of(2))
-            .keywords(keywords)
-            .size(0)
-            .internalDate(INTERNAL_DATE)
-            .content(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)))
-            .attachments(ImmutableList.of())
-            .mailboxId(MAILBOX_ID)
-            .messageId(TestMessageId.of(2))
-            .build();
-        MessageFullView testee = messageFullViewFactory.fromMetaDataWithContent(testMail).block();
-        assertThat(testee.getKeywords()).containsAllEntriesOf(keywords.asMap());
-    }
-
-    @Nested
-    class WithProjectionInvolvedTest {
-
-        @Test
-        void fromMessageResultsShouldComputeWhenProjectionReturnEmpty() throws Exception {
-            List<MessageResult> messages = messageIdManager
-                .getMessages(ImmutableList.of(message1.getMessageId()), FetchGroup.FULL_CONTENT, session);
-            messageFullViewFactory.fromMessageResults(messages).block();
-
-            AWAIT_CONDITION.untilAsserted(() ->
-                assertThat(fastViewProjection.retrieve(message1.getMessageId()).blockOptional())
-                    .isPresent()
-                    .get()
-                    .extracting(MessageFastViewPrecomputedProperties::getPreview)
-                    .isEqualTo(DEFAULT_PREVIEW));
-        }
-
-        @Test
-        void fromMessageResultsShouldUseReturnedPreviewFromProjections() throws Exception {
-            String preview = "my pre computed preview";
-            Mono.from(fastViewProjection.store(message1.getMessageId(), MessageFastViewPrecomputedProperties.builder()
-                    .preview(Preview.from(preview))
-                    .hasAttachment(false)
-                    .build()))
-                .block();
-
-            List<MessageResult> messages = messageIdManager
-                .getMessages(ImmutableList.of(message1.getMessageId()), FetchGroup.FULL_CONTENT, session);
-
-            assertThat(messageFullViewFactory.fromMessageResults(messages).block())
-                .extracting(MessageFullView::getPreview)
-                .isEqualTo(PreviewDTO.of(preview));
-        }
-
-        @Test
-        void fromMessageResultsShouldFallbackToComputeWhenProjectionRetrievingError() throws Exception {
-            doReturn(Mono.error(new RuntimeException("mock exception")))
-                .when(fastViewProjection).retrieve(any(MessageId.class));
-
-            List<MessageResult> messages = messageIdManager
-                .getMessages(ImmutableList.of(message1.getMessageId()), FetchGroup.FULL_CONTENT, session);
-
-            assertThat(messageFullViewFactory.fromMessageResults(messages).block())
-                .extracting(MessageFullView::getPreview)
-                .isEqualTo(PreviewDTO.of(DEFAULT_PREVIEW_AS_STRING));
-        }
-
-        @Test
-        void fromMessageResultsShouldNotBeAffectedByProjectionStoringError() throws Exception {
-            doReturn(Mono.error(new RuntimeException("mock exception")))
-                .when(fastViewProjection).store(any(), any());
-
-            List<MessageResult> messages = messageIdManager
-                .getMessages(ImmutableList.of(message1.getMessageId()), FetchGroup.FULL_CONTENT, session);
-
-            assertThat(messageFullViewFactory.fromMessageResults(messages).block())
-                .extracting(MessageFullView::getPreview)
-                .isEqualTo(PreviewDTO.of(DEFAULT_PREVIEW_AS_STRING));
-        }
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewTest.java
deleted file mode 100644
index 52e4621241..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageFullViewTest.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import java.time.Instant;
-import java.util.Optional;
-
-import org.apache.james.jmap.api.model.Preview;
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.model.PreviewDTO;
-import org.apache.james.mailbox.inmemory.InMemoryId;
-import org.apache.james.mailbox.model.TestMessageId;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-class MessageFullViewTest {
-
-    private static final Preview PREVIEW = Preview.from("preview");
-    private static final PreviewDTO PREVIEW_DTO = PreviewDTO.of(PREVIEW.getValue());
-
-    @Test
-    void buildShouldThrowWhenIdIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder().build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenBlobIdIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenThreadIdIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenThreadIdIsEmpty() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("")
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenMailboxIdsIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenHeadersIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .fluentMailboxIds()
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenSubjectIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .fluentMailboxIds()
-                .headers(ImmutableMap.of())
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenSubjectIsEmpty() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .fluentMailboxIds()
-                .headers(ImmutableMap.of())
-                .subject("")
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenSizeIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .fluentMailboxIds()
-                .headers(ImmutableMap.of())
-                .subject("subject")
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenDateIsNull() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .fluentMailboxIds()
-                .headers(ImmutableMap.of())
-                .subject("subject")
-                .size(123)
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldNotThrowWhenPreviewIsNotPresent() {
-        assertThatCode(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .fluentMailboxIds()
-                    .headers(ImmutableMap.of())
-                .subject("subject")
-                .size(123)
-                .date(Instant.now())
-                .hasAttachment(false)
-                .build())
-            .doesNotThrowAnyException();
-    }
-
-    @Test
-    void buildShouldWorkWhenMandatoryFieldsArePresent() {
-        Instant currentDate = Instant.now();
-        Number messageSize = Number.fromLong(123);
-
-        MessageFullView expected = new MessageFullView(TestMessageId.of(1), BlobId.of("blobId"), "threadId",
-            ImmutableSet.of(InMemoryId.of(456)), Optional.empty(), false, ImmutableMap.of("key", "value"),
-            Optional.empty(), ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), ImmutableList.of(),
-            "subject", currentDate, messageSize, PREVIEW_DTO, Optional.empty(), Optional.empty(),
-            ImmutableList.of(), ImmutableMap.of(), Keywords.DEFAULT_VALUE);
-
-        MessageFullView tested = MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .mailboxId(InMemoryId.of(456))
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .size(123)
-                .date(currentDate)
-                .preview(PREVIEW)
-                .hasAttachment(false)
-                .build();
-        assertThat(tested).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    void buildShouldThrowWhenAttachedMessageIsNotMatchingAttachments() {
-        Attachment simpleAttachment = Attachment.builder().blobId(BlobId.of("blobId")).type("type").name("name").size(123).build();
-        ImmutableList<Attachment> attachments = ImmutableList.of(simpleAttachment);
-
-        SubMessage simpleMessage = SubMessage.builder()
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .date(Instant.now())
-                .build();
-
-        ImmutableMap<BlobId, SubMessage> attachedMessages = ImmutableMap.of(BlobId.of("differentBlobId"), simpleMessage);
-
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .mailboxId(InMemoryId.of(456))
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .size(123)
-                .date(Instant.now())
-                .preview(PREVIEW)
-                .attachments(attachments)
-                .attachedMessages(attachedMessages)
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldWorkWhenAllFieldsArePresent() {
-        Emailer from = Emailer.builder().name("from").email("from@domain").build();
-        ImmutableList<Emailer> to = ImmutableList.of(Emailer.builder().name("to").email("to@domain").build());
-        ImmutableList<Emailer> cc = ImmutableList.of(Emailer.builder().name("cc").email("cc@domain").build());
-        ImmutableList<Emailer> bcc = ImmutableList.of(Emailer.builder().name("bcc").email("bcc@domain").build());
-        ImmutableList<Emailer> replyTo = ImmutableList.of(Emailer.builder().name("replyTo").email("replyTo@domain").build());
-        Instant currentDate = Instant.now();
-        Attachment simpleAttachment = Attachment.builder().blobId(BlobId.of("blobId")).type("type").name("name").size(123).build();
-        ImmutableList<Attachment> attachments = ImmutableList.of(simpleAttachment);
-
-        SubMessage simpleMessage = SubMessage.builder()
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .date(currentDate)
-                .build();
-
-        ImmutableMap<BlobId, SubMessage> attachedMessages = ImmutableMap.of(BlobId.of("blobId"), simpleMessage);
-
-        Keywords keywords = Keywords.strictFactory()
-            .from(Keyword.DRAFT, Keyword.ANSWERED, Keyword.FLAGGED);
-
-        Number messageSize = Number.fromLong(123);
-        MessageFullView expected = new MessageFullView(
-            TestMessageId.of(1),
-            BlobId.of("blobId"),
-            "threadId",
-            ImmutableSet.of(InMemoryId.of(456)),
-            Optional.of("inReplyToMessageId"),
-            true,
-            ImmutableMap.of("key", "value"),
-            Optional.of(from),
-            to,
-            cc,
-            bcc,
-            replyTo,
-            "subject",
-            currentDate,
-            messageSize,
-            PREVIEW_DTO,
-            Optional.of("textBody"),
-            Optional.of("htmlBody"),
-            attachments,
-            attachedMessages,
-            keywords);
-
-        MessageFullView tested = MessageFullView.builder()
-            .id(TestMessageId.of(1))
-            .blobId(BlobId.of("blobId"))
-            .threadId("threadId")
-            .mailboxId(InMemoryId.of(456))
-            .inReplyToMessageId("inReplyToMessageId")
-            .keywords(keywords)
-            .headers(ImmutableMap.of("key", "value"))
-            .from(from)
-            .to(to)
-            .cc(cc)
-            .bcc(bcc)
-            .replyTo(replyTo)
-            .subject("subject")
-            .date(currentDate)
-            .size(123)
-            .preview(PREVIEW)
-            .textBody(Optional.of("textBody"))
-            .htmlBody(Optional.of("htmlBody"))
-            .attachments(attachments)
-            .attachedMessages(attachedMessages)
-            .build();
-
-        assertThat(tested).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    void buildShouldThrowWhenOneAttachedMessageIsNotInAttachments() {
-        assertThatThrownBy(() -> MessageFullView.builder()
-                .id(TestMessageId.of(1))
-                .blobId(BlobId.of("blobId"))
-                .threadId("threadId")
-                .mailboxId(InMemoryId.of(456))
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .size(1)
-                .date(Instant.now())
-                .preview(PREVIEW)
-                .attachedMessages(ImmutableMap.of(BlobId.of("key"), SubMessage.builder()
-                        .headers(ImmutableMap.of("key", "value"))
-                        .subject("subject")
-                        .date(Instant.now())
-                        .build()))
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldNotThrowWhenOneAttachedMessageIsInAttachments() {
-        MessageFullView.builder()
-            .id(TestMessageId.of(1))
-            .blobId(BlobId.of("blobId"))
-            .threadId("threadId")
-            .mailboxId(InMemoryId.of(456))
-            .headers(ImmutableMap.of("key", "value"))
-            .subject("subject")
-            .size(1)
-            .date(Instant.now())
-            .preview(PREVIEW)
-            .attachments(ImmutableList.of(Attachment.builder()
-                    .blobId(BlobId.of("key"))
-                    .size(1)
-                    .type("type")
-                    .build()))
-            .attachedMessages(ImmutableMap.of(BlobId.of("key"), SubMessage.builder()
-                    .headers(ImmutableMap.of("key", "value"))
-                    .subject("subject")
-                    .date(Instant.now())
-                    .build()))
-            .build();
-    }
-
-    @Test
-    void hasAttachmentShouldReturnFalseWhenNoAttachment() {
-        MessageFullView message = MessageFullView.builder()
-            .id(TestMessageId.of(1))
-            .blobId(BlobId.of("blobId"))
-            .threadId("threadId")
-            .mailboxId(InMemoryId.of(456))
-            .headers(ImmutableMap.of("key", "value"))
-            .subject("subject")
-            .size(1)
-            .date(Instant.now())
-            .preview(PREVIEW)
-            .attachments(ImmutableList.of())
-            .build();
-
-        assertThat(message.isHasAttachment()).isFalse();
-    }
-
-    @Test
-    void hasAttachmentShouldReturnFalseWhenAllAttachmentsAreInline() {
-        MessageFullView message = MessageFullView.builder()
-            .id(TestMessageId.of(1))
-            .blobId(BlobId.of("blobId"))
-            .threadId("threadId")
-            .mailboxId(InMemoryId.of(456))
-            .headers(ImmutableMap.of("key", "value"))
-            .subject("subject")
-            .size(1)
-            .date(Instant.now())
-            .preview(PREVIEW)
-            .attachments(ImmutableList.of(
-                    Attachment.builder()
-                        .blobId(BlobId.of("key"))
-                        .size(1)
-                        .type("type")
-                        .cid("cid1")
-                        .isInline(true)
-                        .build(),
-                    Attachment.builder()
-                        .blobId(BlobId.of("key2"))
-                        .size(2)
-                        .type("type2")
-                        .cid("cid2")
-                        .isInline(true)
-                        .build()))
-            .build();
-
-        assertThat(message.isHasAttachment()).isFalse();
-    }
-
-    @Test
-    void hasAttachmentShouldReturnTrueWhenOneAttachmentIsNotInline() {
-        MessageFullView message = MessageFullView.builder()
-            .id(TestMessageId.of(1))
-            .blobId(BlobId.of("blobId"))
-            .threadId("threadId")
-            .mailboxId(InMemoryId.of(456))
-            .headers(ImmutableMap.of("key", "value"))
-            .subject("subject")
-            .size(1)
-            .date(Instant.now())
-            .preview(PREVIEW)
-            .attachments(ImmutableList.of(
-                    Attachment.builder()
-                        .blobId(BlobId.of("key"))
-                        .size(1)
-                        .type("type")
-                        .cid("cid1")
-                        .isInline(true)
-                        .build(),
-                    Attachment.builder()
-                        .blobId(BlobId.of("key2"))
-                        .size(2)
-                        .type("type2")
-                        .isInline(false)
-                        .build(),
-                    Attachment.builder()
-                        .blobId(BlobId.of("key3"))
-                        .size(3)
-                        .type("type3")
-                        .cid("c")
-                        .isInline(true)
-                        .build()))
-            .build();
-
-        assertThat(message.isHasAttachment()).isTrue();
-    }
-
-    @Test
-    void hasAttachmentShouldReturnTrueWhenAllAttachmentsAreNotInline() {
-        MessageFullView message = MessageFullView.builder()
-            .id(TestMessageId.of(1))
-            .blobId(BlobId.of("blobId"))
-            .threadId("threadId")
-            .mailboxId(InMemoryId.of(456))
-            .headers(ImmutableMap.of("key", "value"))
-            .subject("subject")
-            .size(1)
-            .date(Instant.now())
-            .preview(PREVIEW)
-            .attachments(ImmutableList.of(
-                    Attachment.builder()
-                        .blobId(BlobId.of("key"))
-                        .size(1)
-                        .type("type")
-                        .isInline(false)
-                        .build(),
-                    Attachment.builder()
-                        .blobId(BlobId.of("key2"))
-                        .size(2)
-                        .type("type2")
-                        .isInline(false)
-                        .build(),
-                    Attachment.builder()
-                        .blobId(BlobId.of("key3"))
-                        .size(3)
-                        .type("type3")
-                        .isInline(false)
-                        .build()))
-            .build();
-
-        assertThat(message.isHasAttachment()).isTrue();
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactoryTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactoryTest.java
deleted file mode 100644
index 4fa81fe33d..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageHeaderViewFactoryTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.ALICE_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.HEADERS_MAP;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.JACK_EMAIL;
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.JACOB_EMAIL;
-
-import java.time.Clock;
-import java.util.Optional;
-
-import jakarta.mail.Flags;
-
-import org.apache.james.blob.api.BucketName;
-import org.apache.james.blob.api.HashBlobId;
-import org.apache.james.blob.memory.MemoryBlobStoreDAO;
-import org.apache.james.jmap.methods.BlobManagerImpl;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.memory.upload.InMemoryUploadRepository;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.StringBackedAttachmentIdFactory;
-import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
-import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MessageRange;
-import org.apache.james.server.blob.deduplication.DeDuplicationBlobStore;
-import org.apache.james.util.ClassLoaderUtils;
-import org.assertj.core.api.SoftAssertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableList;
-
-class MessageHeaderViewFactoryTest {
-    private MessageIdManager messageIdManager;
-    private MessageHeaderViewFactory testee;
-    private MailboxSession session;
-    private MessageManager bobInbox;
-    private MessageManager bobMailbox;
-    private ComposedMessageId message1;
-
-    @BeforeEach
-    void setUp() throws Exception {
-        InMemoryIntegrationResources resources = InMemoryIntegrationResources.defaultResources();
-        messageIdManager = resources.getMessageIdManager();
-        InMemoryMailboxManager mailboxManager = resources.getMailboxManager();
-
-        session = mailboxManager.createSystemSession(BOB);
-        MailboxId bobInboxId = mailboxManager.createMailbox(MailboxPath.inbox(session), session).get();
-        MailboxId bobMailboxId = mailboxManager.createMailbox(MailboxPath.forUser(BOB, "anotherMailbox"), session).get();
-
-        bobInbox = mailboxManager.getMailbox(bobInboxId, session);
-        bobMailbox = mailboxManager.getMailbox(bobMailboxId, session);
-
-        message1 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build(ClassLoaderUtils.getSystemResourceAsSharedStream("fullMessage.eml")),
-            session).getId();
-        BlobManagerImpl blobManager = new BlobManagerImpl(resources.getAttachmentManager(), resources.getMessageIdManager(), resources.getMessageIdFactory(),
-            new InMemoryUploadRepository(new DeDuplicationBlobStore(new MemoryBlobStoreDAO(), BucketName.of("default"), new HashBlobId.Factory()),
-                Clock.systemUTC()),
-            new StringBackedAttachmentIdFactory());
-
-        testee = new MessageHeaderViewFactory(blobManager, messageIdManager);
-    }
-
-    @Test
-    void fromMessageResultsShouldReturnCorrectView() throws Exception {
-        MessageHeaderView actual = testee.fromMessageIds(ImmutableList.of(message1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-            softly.assertThat(actual.getId()).isEqualTo(message1.getMessageId());
-            softly.assertThat(actual.getMailboxIds()).containsExactly(bobInbox.getId());
-            softly.assertThat(actual.getThreadId()).isEqualTo(message1.getMessageId().serialize());
-            softly.assertThat(actual.getSize()).isEqualTo(Number.fromLong(2255));
-            softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN).asMap());
-            softly.assertThat(actual.getBlobId()).isEqualTo(BlobId.of(message1.getMessageId().serialize()));
-            softly.assertThat(actual.getInReplyToMessageId()).isEqualTo(Optional.of(BOB.asString()));
-            softly.assertThat(actual.getHeaders()).isEqualTo(HEADERS_MAP);
-            softly.assertThat(actual.getFrom()).isEqualTo(Optional.of(ALICE_EMAIL));
-            softly.assertThat(actual.getTo()).isEqualTo(ImmutableList.of(BOB_EMAIL));
-            softly.assertThat(actual.getCc()).isEqualTo(ImmutableList.of(JACK_EMAIL, JACOB_EMAIL));
-            softly.assertThat(actual.getBcc()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getReplyTo()).isEqualTo(ImmutableList.of(ALICE_EMAIL));
-            softly.assertThat(actual.getSubject()).isEqualTo("Full message");
-            softly.assertThat(actual.getDate()).isEqualTo("2016-06-07T14:23:37Z");
-        });
-    }
-
-    @Test
-    void fromMessageResultsShouldCombineKeywords() throws Exception {
-        messageIdManager.setInMailboxes(message1.getMessageId(), ImmutableList.of(bobInbox.getId(), bobMailbox.getId()), session);
-        bobMailbox.setFlags(new Flags(Flags.Flag.FLAGGED), MessageManager.FlagsUpdateMode.REPLACE, MessageRange.all(), session);
-
-        MessageHeaderView actual = testee.fromMessageIds(ImmutableList.of(message1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-            softly.assertThat(actual.getId()).isEqualTo(message1.getMessageId());
-            softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN, Keyword.FLAGGED).asMap());
-        });
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactoryTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactoryTest.java
deleted file mode 100644
index 234192b7f4..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageMetadataViewFactoryTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.apache.james.jmap.model.message.view.MessageViewFixture.BOB;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.time.Clock;
-
-import jakarta.mail.Flags;
-
-import org.apache.james.blob.api.BucketName;
-import org.apache.james.blob.api.HashBlobId;
-import org.apache.james.blob.memory.MemoryBlobStoreDAO;
-import org.apache.james.jmap.methods.BlobManagerImpl;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.jmap.model.Number;
-import org.apache.james.jmap.memory.upload.InMemoryUploadRepository;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.StringBackedAttachmentIdFactory;
-import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
-import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
-import org.apache.james.mailbox.model.ComposedMessageId;
-import org.apache.james.mailbox.model.MailboxId;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MessageRange;
-import org.apache.james.server.blob.deduplication.DeDuplicationBlobStore;
-import org.assertj.core.api.SoftAssertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableList;
-
-class MessageMetadataViewFactoryTest {
-    private MessageIdManager messageIdManager;
-    private MessageMetadataViewFactory testee;
-    private MailboxSession session;
-    private MessageManager bobInbox;
-    private MessageManager bobMailbox;
-    private ComposedMessageId message1;
-
-    @BeforeEach
-    void setUp() throws Exception {
-        InMemoryIntegrationResources resources = InMemoryIntegrationResources.defaultResources();
-        messageIdManager = resources.getMessageIdManager();
-        InMemoryMailboxManager mailboxManager = resources.getMailboxManager();
-
-        session = mailboxManager.createSystemSession(BOB);
-        MailboxId bobInboxId = mailboxManager.createMailbox(MailboxPath.inbox(session), session).get();
-        MailboxId bobMailboxId = mailboxManager.createMailbox(MailboxPath.forUser(BOB, "anotherMailbox"), session).get();
-
-        bobInbox = mailboxManager.getMailbox(bobInboxId, session);
-        bobMailbox = mailboxManager.getMailbox(bobMailboxId, session);
-
-        message1 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags(Flags.Flag.SEEN))
-                .build("header: value\r\n\r\nbody"),
-            session).getId();
-
-        BlobManagerImpl blobManager = new BlobManagerImpl(resources.getAttachmentManager(), resources.getMessageIdManager(), resources.getMessageIdFactory(),
-            new InMemoryUploadRepository(new DeDuplicationBlobStore(new MemoryBlobStoreDAO(), BucketName.of("default"), new HashBlobId.Factory()),
-                Clock.systemUTC()),
-            new StringBackedAttachmentIdFactory());
-        testee = new MessageMetadataViewFactory(blobManager, messageIdManager);
-    }
-
-    @Test
-    void fromMessageResultsShouldReturnCorrectView() throws Exception {
-        MessageMetadataView actual = testee.fromMessageIds(ImmutableList.of(message1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-           softly.assertThat(actual.getId()).isEqualTo(message1.getMessageId());
-           softly.assertThat(actual.getMailboxIds()).containsExactly(bobInbox.getId());
-           softly.assertThat(actual.getThreadId()).isEqualTo(message1.getMessageId().serialize());
-           softly.assertThat(actual.getSize()).isEqualTo(Number.fromLong(21));
-           softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN).asMap());
-           softly.assertThat(actual.getBlobId()).isEqualTo(BlobId.of(message1.getMessageId().serialize()));
-        });
-    }
-
-    @Test
-    void forwardedShouldBeReturnTrueWhenLowerCase() throws Exception {
-        ComposedMessageId message2 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags("$forwarded"))
-                .build("header: value\r\n\r\nbody"),
-            session).getId();
-
-        MessageMetadataView actual = testee.fromMessageIds(ImmutableList.of(message2.getMessageId()), session).collectList().block().get(0);
-        assertThat(actual.isIsForwarded()).isTrue();
-    }
-
-    @Test
-    void isForwardedShouldReturnTrueWhenUpperCase() throws Exception {
-        ComposedMessageId message2 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
-                .withFlags(new Flags("$Forwarded"))
-                .build("header: value\r\n\r\nbody"),
-            session).getId();
-
-        MessageMetadataView actual = testee.fromMessageIds(ImmutableList.of(message2.getMessageId()), session).collectList().block().get(0);
-        assertThat(actual.isIsForwarded()).isTrue();
-    }
-
-    @Test
-    void fromMessageResultsShouldCombineKeywords() throws Exception {
-        messageIdManager.setInMailboxes(message1.getMessageId(), ImmutableList.of(bobInbox.getId(), bobMailbox.getId()), session);
-        bobMailbox.setFlags(new Flags(Flags.Flag.FLAGGED), MessageManager.FlagsUpdateMode.REPLACE, MessageRange.all(), session);
-
-        MessageMetadataView actual = testee.fromMessageIds(ImmutableList.of(message1.getMessageId()), session).collectList().block().get(0);
-        SoftAssertions.assertSoftly(softly -> {
-           softly.assertThat(actual.getId()).isEqualTo(message1.getMessageId());
-           softly.assertThat(actual.getKeywords()).isEqualTo(Keywords.strictFactory().from(Keyword.SEEN, Keyword.FLAGGED).asMap());
-        });
-    }
-
-}
\ No newline at end of file
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageViewFixture.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageViewFixture.java
deleted file mode 100644
index befa2cfb51..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/MessageViewFixture.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import org.apache.james.core.Username;
-import org.apache.james.jmap.model.Emailer;
-
-import com.google.common.collect.ImmutableMap;
-
-public interface MessageViewFixture {
-    Username BOB = Username.of("bob@local");
-
-    Emailer BOB_EMAIL = Emailer.builder().name(BOB.getLocalPart()).email(BOB.asString()).build();
-    Emailer ALICE_EMAIL = Emailer.builder().name("alice").email("alice@local").build();
-    Emailer JACK_EMAIL = Emailer.builder().name("jack").email("jack@local").build();
-    Emailer JACOB_EMAIL = Emailer.builder().name("jacob").email("jacob@local").build();
-
-    ImmutableMap<String, String> HEADERS_MAP = ImmutableMap.<String, String>builder()
-        .put("Content-Type", "multipart/mixed; boundary=\"------------7AF1D14DE1DFA16229726B54\"")
-        .put("Date", "Tue, 7 Jun 2016 16:23:37 +0200")
-        .put("From", "alice <al...@local>")
-        .put("To", "bob <bo...@local>")
-        .put("Subject", "Full message")
-        .put("Mime-Version", "1.0")
-        .put("Message-ID", "<1c...@open-paas.org>")
-        .put("Cc", "jack <ja...@local>, jacob <ja...@local>")
-        .put("Bcc", "alice <al...@local>")
-        .put("Reply-to", "alice <al...@local>")
-        .put("In-reply-to", "bob@local")
-        .build();
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/SubMessageTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/SubMessageTest.java
deleted file mode 100644
index 478106faee..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/model/message/view/SubMessageTest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.model.message.view;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import java.time.Instant;
-import java.util.Optional;
-
-import org.apache.james.jmap.model.Attachment;
-import org.apache.james.jmap.model.BlobId;
-import org.apache.james.jmap.model.Emailer;
-import org.junit.jupiter.api.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-class SubMessageTest {
-
-    private static final Optional<String> DEFAULT_TEXT_BODY = Optional.of("textBody");
-    private static final Optional<String> DEFAULT_HTML_BODY = Optional.of("htmlBody");
-
-    @Test
-    void buildShouldThrowWhenHeadersIsNull() {
-        assertThatThrownBy(() -> SubMessage.builder().build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenSubjectIsNull() {
-        assertThatThrownBy(() -> SubMessage.builder()
-                .headers(ImmutableMap.of())
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenSubjectIsEmpty() {
-        assertThatThrownBy(() -> SubMessage.builder()
-                .headers(ImmutableMap.of())
-                .subject("")
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldThrowWhenDateIsNull() {
-        assertThatThrownBy(() -> SubMessage.builder()
-                .headers(ImmutableMap.of())
-                .subject("subject")
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldWorkWhenMandatoryFieldsArePresent() {
-        Instant currentDate = Instant.now();
-
-        SubMessage expected = new SubMessage(ImmutableMap.of("key", "value"), Optional.empty(),
-            ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), "subject",
-            currentDate, Optional.empty(), Optional.empty(), ImmutableList.of(), ImmutableMap.of());
-
-        SubMessage tested = SubMessage.builder()
-            .headers(ImmutableMap.of("key", "value"))
-            .subject("subject")
-            .date(currentDate)
-            .build();
-
-        assertThat(tested).isEqualToComparingFieldByField(expected);
-    }
-
-    @Test
-    void buildShouldThrowWhenAttachedMessageIsNotMatchingAttachments() {
-        Attachment simpleAttachment = Attachment.builder().blobId(BlobId.of("blobId")).type("type").name("name").size(123).build();
-        ImmutableList<Attachment> attachments = ImmutableList.of(simpleAttachment);
-
-        SubMessage simpleMessage = SubMessage.builder()
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .date(Instant.now())
-                .build();
-
-        ImmutableMap<BlobId, SubMessage> attachedMessages = ImmutableMap.of(BlobId.of("differentBlobId"), simpleMessage);
-
-        assertThatThrownBy(() -> SubMessage.builder()
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .date(Instant.now())
-                .attachments(attachments)
-                .attachedMessages(attachedMessages)
-                .build())
-            .isInstanceOf(IllegalStateException.class);
-    }
-
-    @Test
-    void buildShouldWorkWhenAllFieldsArePresent() {
-        Emailer from = Emailer.builder().name("from").email("from@domain").build();
-        ImmutableList<Emailer> to = ImmutableList.of(Emailer.builder().name("to").email("to@domain").build());
-        ImmutableList<Emailer> cc = ImmutableList.of(Emailer.builder().name("cc").email("cc@domain").build());
-        ImmutableList<Emailer> bcc = ImmutableList.of(Emailer.builder().name("bcc").email("bcc@domain").build());
-        ImmutableList<Emailer> replyTo = ImmutableList.of(Emailer.builder().name("replyTo").email("replyTo@domain").build());
-        Instant currentDate = Instant.now();
-        Attachment simpleAttachment = Attachment.builder().blobId(BlobId.of("blobId")).type("type").name("name").size(123).build();
-        ImmutableList<Attachment> attachments = ImmutableList.of(simpleAttachment);
-
-        SubMessage simpleMessage = SubMessage.builder()
-                .headers(ImmutableMap.of("key", "value"))
-                .subject("subject")
-                .date(currentDate)
-                .build();
-
-        ImmutableMap<BlobId, SubMessage> attachedMessages = ImmutableMap.of(BlobId.of("blobId"), simpleMessage);
-
-        SubMessage expected = new SubMessage(
-                ImmutableMap.of("key", "value"),
-                Optional.of(from),
-                to,
-                cc,
-                bcc,
-                replyTo,
-                "subject",
-                currentDate,
-                DEFAULT_TEXT_BODY,
-                DEFAULT_HTML_BODY,
-                attachments,
-                attachedMessages);
-
-        SubMessage tested = SubMessage.builder()
-            .headers(ImmutableMap.of("key", "value"))
-            .from(from)
-            .to(to)
-            .cc(cc)
-            .bcc(bcc)
-            .replyTo(replyTo)
-            .subject("subject")
-            .date(currentDate)
-            .textBody(DEFAULT_TEXT_BODY)
-            .htmlBody(DEFAULT_HTML_BODY)
-            .attachments(attachments)
-            .attachedMessages(attachedMessages)
-            .build();
-
-        assertThat(tested).isEqualToComparingFieldByField(expected);
-    }
-}
diff --git a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
deleted file mode 100644
index 8113f91104..0000000000
--- a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james.jmap.utils;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import org.apache.james.jmap.model.Keyword;
-import org.apache.james.jmap.model.Keywords;
-import org.apache.james.util.CommutativityChecker;
-import org.junit.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-public class KeywordsCombinerTest {
-
-    public static final Keywords.KeywordsFactory KEYWORDS_FACTORY = Keywords.lenientFactory();
-
-    @Test
-    public void applyShouldUnionSeenKeyword() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        assertThat(keywordsCombiner.apply(
-            Keywords.DEFAULT_VALUE,
-            KEYWORDS_FACTORY.from(Keyword.SEEN)))
-            .isEqualTo(KEYWORDS_FACTORY.from(Keyword.SEEN));
-    }
-
-    @Test
-    public void applyShouldUnionAnsweredKeyword() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        assertThat(keywordsCombiner.apply(
-            Keywords.DEFAULT_VALUE,
-            KEYWORDS_FACTORY.from(Keyword.ANSWERED)))
-            .isEqualTo(KEYWORDS_FACTORY.from(Keyword.ANSWERED));
-    }
-
-    @Test
-    public void applyShouldUnionFlaggedKeyword() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        assertThat(keywordsCombiner.apply(
-            Keywords.DEFAULT_VALUE,
-            KEYWORDS_FACTORY.from(Keyword.FLAGGED)))
-            .isEqualTo(KEYWORDS_FACTORY.from(Keyword.FLAGGED));
-    }
-
-    @Test
-    public void applyShouldIntersectDraftKeyword() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        assertThat(keywordsCombiner.apply(
-            Keywords.DEFAULT_VALUE,
-            KEYWORDS_FACTORY.from(Keyword.DRAFT)))
-            .isEqualTo(Keywords.DEFAULT_VALUE);
-    }
-
-    @Test
-    public void applyShouldUnionCustomKeyword() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        Keyword customKeyword = Keyword.of("$Any");
-        assertThat(keywordsCombiner.apply(
-            Keywords.DEFAULT_VALUE,
-            KEYWORDS_FACTORY.from(customKeyword)))
-            .isEqualTo(KEYWORDS_FACTORY.from(customKeyword));
-    }
-
-    @Test
-    public void applyShouldAcceptEmptyAsAZeroValue() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        assertThat(keywordsCombiner.apply(
-            Keywords.DEFAULT_VALUE,
-            Keywords.DEFAULT_VALUE))
-            .isEqualTo(Keywords.DEFAULT_VALUE);
-    }
-
-    @Test
-    public void applyShouldUnionDifferentFlags() {
-        KeywordsCombiner keywordsCombiner = new KeywordsCombiner();
-
-        assertThat(keywordsCombiner.apply(
-            KEYWORDS_FACTORY.from(Keyword.FLAGGED),
-            KEYWORDS_FACTORY.from(Keyword.ANSWERED)))
-            .isEqualTo(KEYWORDS_FACTORY.from(Keyword.FLAGGED, Keyword.ANSWERED));
-    }
-
-    @Test
-    public void keywordsCombinerShouldBeCommutative() {
-        Keywords allKeyword = KEYWORDS_FACTORY.from(Keyword.ANSWERED,
-            Keyword.DELETED,
-            Keyword.DRAFT,
-            Keyword.FLAGGED,
-            Keyword.SEEN,
-            Keyword.of("$Forwarded"),
-            Keyword.of("$Any"));
-
-        ImmutableSet<Keywords> values = ImmutableSet.of(
-            KEYWORDS_FACTORY.from(Keyword.ANSWERED),
-            KEYWORDS_FACTORY.from(Keyword.DELETED),
-            KEYWORDS_FACTORY.from(Keyword.DRAFT),
-            KEYWORDS_FACTORY.from(Keyword.FLAGGED),
-            KEYWORDS_FACTORY.from(Keyword.SEEN),
-            KEYWORDS_FACTORY.from(),
-            KEYWORDS_FACTORY.from(Keyword.of("$Forwarded")),
-            KEYWORDS_FACTORY.from(Keyword.of("$Any")),
-            allKeyword);
-
-        assertThat(
-            new CommutativityChecker<>(values, new KeywordsCombiner())
-                .findNonCommutativeInput())
-            .isEmpty();
-    }
-}
\ No newline at end of file


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


(james-project) 07/10: JAMES-4025 Drop Jmap draft - update document

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

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

commit e63edfa809cefd6599c6f5b1001ffefaf72315f9
Author: vttran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    JAMES-4025 Drop Jmap draft - update document
---
 examples/oidc/james/jmap.properties                |  4 ---
 .../sample-configuration/jmap.properties           |  4 ---
 .../modules/ROOT/pages/architecture/index.adoc     |  4 ---
 .../ROOT/pages/benchmark/james-benchmark.adoc      |  1 -
 .../docs/modules/ROOT/pages/configure/jmap.adoc    | 15 ++--------
 .../sample-configuration/jmap.properties           |  4 ---
 .../sample-configuration/jmap.properties           |  4 ---
 .../apache/james/jmap/model/MessageProperties.java |  2 +-
 src/site/xdoc/server/config-jmap.xml               | 32 ++++------------------
 9 files changed, 9 insertions(+), 61 deletions(-)

diff --git a/examples/oidc/james/jmap.properties b/examples/oidc/james/jmap.properties
index f3d8a16b46..4755a08a60 100644
--- a/examples/oidc/james/jmap.properties
+++ b/examples/oidc/james/jmap.properties
@@ -23,10 +23,6 @@ tls.secret=james72laBalle
 # This enables a higher resilience, but the projection needs to be correctly populated. False by default.
 # view.email.query.enabled=true
 
-# If you want to specify authentication strategies for Jmap draft version
-# For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
-# authentication.strategy.draft=AccessTokenAuthenticationStrategy,JWTAuthenticationStrategy,QueryParameterAccessTokenAuthenticationStrategy
-
 # If you want to specify authentication strategies for Jmap rfc-8621 version
 # For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
 authentication.strategy.rfc8621=BasicAuthenticationStrategy,XUserAuthenticationStrategy
\ No newline at end of file
diff --git a/server/apps/cassandra-app/sample-configuration/jmap.properties b/server/apps/cassandra-app/sample-configuration/jmap.properties
index f794c05ebe..80a254da40 100644
--- a/server/apps/cassandra-app/sample-configuration/jmap.properties
+++ b/server/apps/cassandra-app/sample-configuration/jmap.properties
@@ -23,10 +23,6 @@ tls.secret=james72laBalle
 # This enables a higher resilience, but the projection needs to be correctly populated. False by default.
 # view.email.query.enabled=true
 
-# If you want to specify authentication strategies for Jmap draft version
-# For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
-# authentication.strategy.draft=AccessTokenAuthenticationStrategy,JWTAuthenticationStrategy,QueryParameterAccessTokenAuthenticationStrategy
-
 # If you want to specify authentication strategies for Jmap rfc-8621 version
 # For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
 # authentication.strategy.rfc8621=JWTAuthenticationStrategy,BasicAuthenticationStrategy
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/architecture/index.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/architecture/index.adoc
index c26d12e963..2ed47728f0 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/architecture/index.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/architecture/index.adoc
@@ -38,10 +38,6 @@ The following protocols should be considered experimental:
 * *JMAP* (RFC-8620 &RFC-8621 specifications and known limitations of the James implementation are defined link:https://github.com/apache/james-project/tree/master/server/protocols/jmap-rfc-8621/doc[here])
 * *ManagedSieve*
 
-The following protocols should be considered deprecated:
-
-* *JMAP-draft* (draft specification as defined link:https://github.com/apache/james-project/tree/master/server/protocols/jmap-draft/doc[here])
-
 Read more on xref:architecture/implemented-standards.adoc[implemented standards].
 
 == Topology
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc
index 839c4296e7..21f1bb210b 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/benchmark/james-benchmark.adoc
@@ -88,7 +88,6 @@ We did provide a lot of simulations in `org.apache.james.gatling.simulation` pat
 Some symbolic simulations we often use:
 
 * IMAP: `org.apache.james.gatling.simulation.imap.PlatformValidationSimulation`
-* JMAP draft: `org.apache.james.gatling.simulation.jmap.draft.PlatformValidationSimulation`
 * JMAP rfc8621: `org.apache.james.gatling.simulation.jmap.rfc8621.PushPlatformValidationSimulation`
 
 === Base performance result
diff --git a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
index a1775ae4e5..9d7611ba13 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
@@ -37,7 +37,7 @@ Defaults to an empty list.
 | Optional. URL for JMAP WebSocket route. Default value: ws://localhost
 
 | email.send.max.size
-| Optional. Configuration max size for message created in both JMAP Draft amd RFC-8621.
+| Optional. Configuration max size for message created in RFC-8621.
 Default value: None. Supported units are B (bytes) K (KB) M (MB) G (GB).
 
 | max.size.attachments.per.mail
@@ -62,13 +62,6 @@ This enables a higher resilience, but the projection needs to be correctly popul
 | user.provisioning.enabled
 | Optional boolean. Defaults to true. Governs whether authenticated users that do not exist locally should be created in the users repository.
 
-
-| authentication.strategy.draft
-| Optional List[String] with delimiter `,` . Specify which authentication strategies system admin want to use for JMAP draft server.
-The implicit package name is `org.apache.james.jmap.http`. If you have a custom authentication strategy outside this package, you have to specify its FQDN.
-If no authentication strategy is specified, JMAP draft server will fallback to default strategies:
-`AccessTokenAuthenticationStrategy`, `JWTAuthenticationStrategy`, `QueryParameterAccessTokenAuthenticationStrategy`
-
 | authentication.strategy.rfc8621
 | Optional List[String] with delimiter `,` . Specify which authentication strategies system admin want to use for JMAP RFC-8621 server.
 The implicit package name is `org.apache.james.jmap.http`. If you have a custom authentication strategy outside this package, you have to specify its FQDN.
@@ -76,10 +69,8 @@ If no authentication strategy is specified, JMAP RFC-8621 server will fallback t
 `JWTAuthenticationStrategy`, `BasicAuthenticationStrategy`.
 
 | jmap.version.default
-| Optional string. Defaults to draft. Allowed values: draft, rfc-8621.
+| Optional string. Defaults to `rfc-8621`. Allowed values: rfc-8621
 Which version of the JMAP protocol should be served when none supplied in the Accept header.
-Defaults to draft for legacy reasons (avoid breaking changes) but setting the value to
-rfc-8621 allow compatibility with other third party apps.
 
 | dynamic.jmap.prefix.resolution.enabled
 | Optional boolean. Defaults to false. Supported Jmap session endpoint returns dynamic prefix in response.
@@ -169,8 +160,6 @@ Contributions enhancing support are furthermore welcomed.
 
 The list of tested JMAP clients are:
 
- - [OpenPaaS](https://open-paas.org/) is actively using the draft version of the JMAP implementation. Migration to
- RFC-8621 is planned.
  - Experiments had been run on top of [LTT.RS](https://github.com/iNPUTmice/lttrs-android). Version in the Accept
  headers needs to be explicitly set to `rfc-8621`. [Read more](https://github.com/linagora/james-project/pull/4089).
 
diff --git a/server/apps/distributed-app/sample-configuration/jmap.properties b/server/apps/distributed-app/sample-configuration/jmap.properties
index d703857a20..73fb3f9abb 100644
--- a/server/apps/distributed-app/sample-configuration/jmap.properties
+++ b/server/apps/distributed-app/sample-configuration/jmap.properties
@@ -26,10 +26,6 @@ tls.secret=james72laBalle
 # This enables a higher resilience, but the projection needs to be correctly populated. False by default.
 # view.email.query.enabled=true
 
-# If you want to specify authentication strategies for Jmap draft version
-# For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
-# authentication.strategy.draft=AccessTokenAuthenticationStrategy,JWTAuthenticationStrategy,QueryParameterAccessTokenAuthenticationStrategy
-
 # If you want to specify authentication strategies for Jmap rfc-8621 version
 # For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
 # authentication.strategy.rfc8621=JWTAuthenticationStrategy,BasicAuthenticationStrategy
diff --git a/server/apps/memory-app/sample-configuration/jmap.properties b/server/apps/memory-app/sample-configuration/jmap.properties
index f8b06115ef..72e279e419 100644
--- a/server/apps/memory-app/sample-configuration/jmap.properties
+++ b/server/apps/memory-app/sample-configuration/jmap.properties
@@ -24,10 +24,6 @@ delay.sends.enabled=true
 # This enables a higher resilience, but the projection needs to be correctly populated. False by default.
 # view.email.query.enabled=true
 
-# If you want to specify authentication strategies for Jmap draft version
-# For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
-# authentication.strategy.draft=AccessTokenAuthenticationStrategy,JWTAuthenticationStrategy,QueryParameterAccessTokenAuthenticationStrategy
-
 # If you want to specify authentication strategies for Jmap rfc-8621 version
 # For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
 # authentication.strategy.rfc8621=JWTAuthenticationStrategy,BasicAuthenticationStrategy
diff --git a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java
index d5a7c0d57f..b256e9d1ab 100644
--- a/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java
+++ b/server/protocols/jmap-rfc-8621/src/main/java/org/apache/james/jmap/model/MessageProperties.java
@@ -80,7 +80,7 @@ public class MessageProperties {
                 .map(MessageProperty::getReadProfile),
             headerPropertiesReadLevel());
 
-        // If `null`, all properties will be fetched (JMAP Draft)
+        // If `null`, all properties will be fetched
         // This defer from RFC-8621 behavior (not implemented here)
         // If omitted, this defaults to: [ "partId", "blobId", "size", "name", "type", "charset", "disposition", "cid",
         // "language", "location" ]
diff --git a/src/site/xdoc/server/config-jmap.xml b/src/site/xdoc/server/config-jmap.xml
index 7043f0200e..e8b70e6294 100644
--- a/src/site/xdoc/server/config-jmap.xml
+++ b/src/site/xdoc/server/config-jmap.xml
@@ -75,7 +75,7 @@
                     <dd>Default value: 200M. Supported units are B (bytes) K (KB) M (MB) G (GB).</dd>
 
                     <dt><strong>email.send.max.size</strong></dt>
-                    <dd>Optional. Configuration max size for message created in both JMAP Draft amd RFC-8621.</dd>
+                    <dd>Optional. Configuration max size for message created in RFC-8621.</dd>
                     <dd>Default value: None. Supported units are B (bytes) K (KB) M (MB) G (GB).</dd>
 
                     <dt><strong>max.size.attachments.per.mail</strong></dt>
@@ -96,14 +96,6 @@
                     <dd>Governs whether authenticated users that do not exist locally should be created in the users repository.
                     </dd>
 
-                    <dt><strong>authentication.strategy.draft</strong></dt>
-                    <dd>List[String] with delimiter ",". Defaults to AccessTokenAuthenticationStrategy,JWTAuthenticationStrategy,
-                        QueryParameterAccessTokenAuthenticationStrategy.</dd>
-                    <dd>Specify which authentication strategies system admin want to use for JMAP draft server.
-                        The implicit package name is "org.apache.james.jmap.http". If you have a custom authentication strategy outside this package, you have to specify its FQDN.
-                        If no authentication strategy is specified, JMAP draft server will fallback to default strategies:
-                    AccessTokenAuthenticationStrategy, JWTAuthenticationStrategy, QueryParameterAccessTokenAuthenticationStrategy.</dd>
-
                     <dt><strong>authentication.strategy.rfc8621</strong></dt>
                     <dd>List[String] with delimiter ",". Defaults to JWTAuthenticationStrategy,BasicAuthenticationStrategy.</dd>
                     <dd>Specify which authentication strategies system admin want to use for JMAP RFC-8621 server.
@@ -112,10 +104,8 @@
                     JWTAuthenticationStrategy, BasicAuthenticationStrategy.</dd>
 
                     <dt><strong>jmap.version.default</strong></dt>
-                    <dd>Optional string. Defaults to draft. Allowed values: draft, rfc-8621.</dd>
-                    <dd>Which version of the JMAP protocol should be served when none supplied in the Accept header.
-                    Defaults to draft for legacy reasons (avoid breaking changes) but setting the value to
-                    rfc-8621 allow compatibility with other third party apps.</dd>
+                    <dd>Optional string. Defaults to rfc-8621. Allowed values: rfc-8621</dd>
+                    <dd>Which version of the JMAP protocol should be served when none supplied in the Accept header.</dd>
 
                     <dt><strong>dynamic.jmap.prefix.resolution.enabled</strong></dt>
                     <dd>Optional boolean. Defaults to false. Supported Jmap session endpoint returns dynamic prefix in response.
@@ -169,22 +159,14 @@
                     <a href="https://www.krakend.io/">Krackend</a> API gateway, but usage of similar technologies is definitely doable.</p>
             </subsection>
 
-            <subsection name="JMAP-draft vs JMAP-RFC-8621">
-                <p>James had been supporting an implementation based on an early specification of JMAP, what we call here
-                <em>JMAP-draft</em> version. But the protocol went under a lot of changes until its finalization as an
-                official RFC.</p>
-
+            <subsection name="JMAP-RFC-8621">
                 <p>The finalized version of JMAP regarding the core specifications [<a href="https://tools.ietf.org/html/rfc8620">RFC-8620</a>]
                 and the mail specifications [<a href="https://tools.ietf.org/html/rfc8621">RFC-8621</a>] are being
-                currently implemented in James (<em>JMAP-RFC-8621</em> version). It's supposed to replace at term the
-                <em>JMAP-draft</em> version.</p>
+                currently implemented in James (<em>JMAP-RFC-8621</em> version).</p>
 
-                <p>Meanwhile, both versions will be available. The version by default will be <em>JMAP-draft</em> during
-                the time it takes to implement the new version. If you want to use a specific version for a request,
-                you will need to add an extra <em>jmapVersion</em> field in your <b>Accept</b> header of your JMAP request:</p>
+                <p>You need to add an extra <em>jmapVersion</em> field in your <b>Accept</b> header of your JMAP request:</p>
 
                 <ul>
-                    <li><b>JMAP-draft</b>: <em>Accept: application/json; jmapVersion=draft</em></li>
                     <li><b>JMAP-RFC-8621</b>: <em>Accept: application/json; jmapVersion=rfc-8621</em></li>
                 </ul>
             </subsection>
@@ -202,8 +184,6 @@
                 <p>Contributions enhancing support are furthermore welcomed.</p>
 
                 <ul>The list of tested JMAP clients are:
-                    <li><a href="https://open-paas.org/">OpenPaaS</a> is actively using the draft version of the JMAP implementation. Migration to
-                    RFC-8621 is planned.</li>
                     <li>Experiments had been run on top of <a href="https://github.com/iNPUTmice/lttrs-android">LTT.RS</a>. Version in the Accept
                         headers needs to be explicitly set to `rfc-8621`. <a href="https://github.com/linagora/james-project/pull/4089">Read more</a>.</li>
                 </ul>


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


(james-project) 01/10: [GUICE BINDING] Eager load FilteringManagement to avoid Guice circle dependency error

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

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

commit 2da2e8eb380089d247bc4114f9910a5c97a6db1e
Author: Tung Tran <vt...@linagora.com>
AuthorDate: Sun Apr 14 09:52:02 2024 +0700

    [GUICE BINDING] Eager load FilteringManagement to avoid Guice circle dependency error
---
 .../main/java/org/apache/james/modules/data/CassandraJmapModule.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java b/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
index 4c83ac4950..c651368c4f 100644
--- a/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
+++ b/server/container/guice/cassandra/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
@@ -126,12 +126,13 @@ public class CassandraJmapModule extends AbstractModule {
         deleteUserDataTaskSteps.addBinding().to(FiltersDeleteUserDataTaskStep.class);
         deleteUserDataTaskSteps.addBinding().to(IdentityUserDeletionTaskStep.class);
         deleteUserDataTaskSteps.addBinding().to(PushDeleteUserDataTaskStep.class);
+        bind(FilteringManagement.class).to(EventSourcingFilteringManagement.class).asEagerSingleton();
     }
 
     @Singleton
     @Provides
-    FilteringManagement provideFilteringManagement(EventStore eventStore, CassandraFilteringProjection cassandraFilteringProjection,
-                                                   PropertiesProvider propertiesProvider) throws ConfigurationException {
+    EventSourcingFilteringManagement provideFilteringManagement(EventStore eventStore, CassandraFilteringProjection cassandraFilteringProjection,
+                                                                PropertiesProvider propertiesProvider) throws ConfigurationException {
         if (cassandraFilterProjectionActivated(propertiesProvider)) {
             return new EventSourcingFilteringManagement(eventStore, cassandraFilteringProjection);
         } else {


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