From 23fd9e58265c41c2e3e3788701cae1212dbe3b72 Mon Sep 17 00:00:00 2001 From: Rene Cordier Date: Thu, 22 Feb 2024 15:33:17 +0700 Subject: [PATCH 1/3] Update James SHA-1 --- james-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/james-project b/james-project index 9254c46d4b..1bf699dc92 160000 --- a/james-project +++ b/james-project @@ -1 +1 @@ -Subproject commit 9254c46d4bbc65553184369b434ca7e4d863acfb +Subproject commit 1bf699dc92c2cc7b86f1f5a6ef81d42ffeb7091a From 962afe8d52365de5641d2a2ba4533cef44a01ac6 Mon Sep 17 00:00:00 2001 From: Rene Cordier Date: Fri, 1 Mar 2024 16:34:55 +0700 Subject: [PATCH 2/3] Update javax.mail to jakarta.mail --- .../tmail/james/app/DistributedServer.java | 2 +- .../jmap/jmap-integration-tests-common/pom.xml | 18 ++++++++++++++---- .../RspamdScannerIntegrationContract.java | 4 ++-- .../CleanupIntegrationContract.java | 3 +-- .../InboxArchivalIntegrationContract.java | 3 +-- ...amdFeedMessageRouteIntegrationContract.java | 3 +-- .../OSEmailAddressContactSearchEngine.java | 2 +- .../james/jmap/method/EmailSendMethod.scala | 4 ++-- .../jmap/model/EmailSubmissionHelper.scala | 6 +++--- .../encrypted/EncryptedMessageManager.scala | 2 +- .../tmail/mailets/ContactsCollection.scala | 2 +- .../tmail/mailets/TMailMailboxAppender.scala | 2 +- .../mailets/TMailMailboxAppenderTest.scala | 4 ++-- .../webadmin/EmailAddressContactRoutes.java | 2 +- .../archival/InboxArchivalTaskTest.java | 4 ++-- .../webadmin/cleanup/CleanupServiceTest.java | 3 +-- 16 files changed, 35 insertions(+), 29 deletions(-) diff --git a/tmail-backend/apps/distributed/src/main/java/com/linagora/tmail/james/app/DistributedServer.java b/tmail-backend/apps/distributed/src/main/java/com/linagora/tmail/james/app/DistributedServer.java index 494a793c36..7078f7e67e 100644 --- a/tmail-backend/apps/distributed/src/main/java/com/linagora/tmail/james/app/DistributedServer.java +++ b/tmail-backend/apps/distributed/src/main/java/com/linagora/tmail/james/app/DistributedServer.java @@ -9,7 +9,6 @@ import java.util.Set; import javax.inject.Named; -import javax.mail.Flags; import org.apache.commons.configuration2.ex.ConfigurationException; import org.apache.commons.lang3.NotImplementedException; @@ -173,6 +172,7 @@ import com.linagora.tmail.webadmin.archival.InboxArchivalTaskModule; import com.linagora.tmail.webadmin.cleanup.MailboxesCleanupModule; +import jakarta.mail.Flags; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/tmail-backend/integration-tests/jmap/jmap-integration-tests-common/pom.xml b/tmail-backend/integration-tests/jmap/jmap-integration-tests-common/pom.xml index 6013ac5b4e..2245ce3d2b 100644 --- a/tmail-backend/integration-tests/jmap/jmap-integration-tests-common/pom.xml +++ b/tmail-backend/integration-tests/jmap/jmap-integration-tests-common/pom.xml @@ -49,10 +49,20 @@ ${james.groupId} jmap-rfc-8621-integration-tests-common - - net.javacrumbs.json-unit - json-unit - + + net.javacrumbs.json-unit + json-unit + + + org.mock-server + mockserver-netty + + + com.sun.mail + mailapi + + + org.mockito mockito-core diff --git a/tmail-backend/integration-tests/rspamd/rspamd-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdScannerIntegrationContract.java b/tmail-backend/integration-tests/rspamd/rspamd-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdScannerIntegrationContract.java index 1df91f9a46..84675c18be 100644 --- a/tmail-backend/integration-tests/rspamd/rspamd-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdScannerIntegrationContract.java +++ b/tmail-backend/integration-tests/rspamd/rspamd-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdScannerIntegrationContract.java @@ -6,8 +6,6 @@ import java.io.IOException; import java.time.Duration; -import javax.mail.internet.MimeMessage; - import org.apache.james.GuiceJamesServer; import org.apache.james.core.Domain; import org.apache.james.core.Username; @@ -27,6 +25,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import jakarta.mail.internet.MimeMessage; + public abstract class RspamdScannerIntegrationContract { protected static final Domain DOMAIN = Domain.of("example.com"); protected static final Username BOB = Username.fromLocalPartWithDomain("bob", DOMAIN); diff --git a/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/CleanupIntegrationContract.java b/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/CleanupIntegrationContract.java index a746467081..71e4b064f3 100644 --- a/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/CleanupIntegrationContract.java +++ b/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/CleanupIntegrationContract.java @@ -10,8 +10,6 @@ import java.util.Date; import java.util.Map; -import javax.mail.Flags; - import org.apache.james.GuiceJamesServer; import org.apache.james.core.Domain; import org.apache.james.core.Username; @@ -34,6 +32,7 @@ import com.linagora.tmail.james.jmap.settings.JmapSettings; import io.restassured.RestAssured; +import jakarta.mail.Flags; public abstract class CleanupIntegrationContract { diff --git a/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/InboxArchivalIntegrationContract.java b/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/InboxArchivalIntegrationContract.java index dff1ddfbcb..966daba59e 100644 --- a/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/InboxArchivalIntegrationContract.java +++ b/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/InboxArchivalIntegrationContract.java @@ -10,8 +10,6 @@ import java.util.Date; import java.util.Map; -import javax.mail.Flags; - import org.apache.james.GuiceJamesServer; import org.apache.james.core.Domain; import org.apache.james.core.Username; @@ -30,6 +28,7 @@ import com.linagora.tmail.james.common.probe.JmapSettingsProbe; import io.restassured.RestAssured; +import jakarta.mail.Flags; public abstract class InboxArchivalIntegrationContract { protected static final Domain DOMAIN = Domain.of("domain.tld"); diff --git a/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdFeedMessageRouteIntegrationContract.java b/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdFeedMessageRouteIntegrationContract.java index 77584af588..57841e9975 100644 --- a/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdFeedMessageRouteIntegrationContract.java +++ b/tmail-backend/integration-tests/webadmin/webadmin-integration-tests-common/src/main/java/com/linagora/tmail/integration/RspamdFeedMessageRouteIntegrationContract.java @@ -8,8 +8,6 @@ import java.io.ByteArrayInputStream; import java.util.Date; -import javax.mail.Flags; - import org.apache.james.GuiceJamesServer; import org.apache.james.core.Domain; import org.apache.james.core.Username; @@ -24,6 +22,7 @@ import org.junit.jupiter.api.Test; import io.restassured.RestAssured; +import jakarta.mail.Flags; public abstract class RspamdFeedMessageRouteIntegrationContract { protected static final Domain DOMAIN = Domain.of("domain.tld"); diff --git a/tmail-backend/jmap/extensions-opensearch/src/main/java/com/linagora/tmail/james/jmap/OSEmailAddressContactSearchEngine.java b/tmail-backend/jmap/extensions-opensearch/src/main/java/com/linagora/tmail/james/jmap/OSEmailAddressContactSearchEngine.java index 3c657e255a..6c87bbf8dc 100644 --- a/tmail-backend/jmap/extensions-opensearch/src/main/java/com/linagora/tmail/james/jmap/OSEmailAddressContactSearchEngine.java +++ b/tmail-backend/jmap/extensions-opensearch/src/main/java/com/linagora/tmail/james/jmap/OSEmailAddressContactSearchEngine.java @@ -12,7 +12,6 @@ import java.util.UUID; import javax.inject.Inject; -import javax.mail.internet.AddressException; import org.apache.james.backends.opensearch.DocumentId; import org.apache.james.backends.opensearch.OpenSearchIndexer; @@ -47,6 +46,7 @@ import com.linagora.tmail.james.jmap.dto.DomainContactDocument; import com.linagora.tmail.james.jmap.dto.UserContactDocument; +import jakarta.mail.internet.AddressException; import reactor.core.publisher.Mono; public class OSEmailAddressContactSearchEngine implements EmailAddressContactSearchEngine { diff --git a/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/method/EmailSendMethod.scala b/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/method/EmailSendMethod.scala index 6fa1cdc720..6d55cdfc6e 100644 --- a/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/method/EmailSendMethod.scala +++ b/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/method/EmailSendMethod.scala @@ -10,10 +10,10 @@ import com.linagora.tmail.james.jmap.method.CapabilityIdentifier.LINAGORA_PGP import com.linagora.tmail.james.jmap.model.EmailSubmissionHelper.resolveEnvelope import com.linagora.tmail.james.jmap.model.{EmailSendCreationId, EmailSendCreationRequest, EmailSendCreationRequestInvalidException, EmailSendCreationResponse, EmailSendRequest, EmailSendResults, EmailSetCreationFailure, EmailSetCreationResult, EmailSetCreationSuccess, EmailSubmissionCreationRequest, MimeMessageSourceImpl} import eu.timepit.refined.auto._ +import jakarta.mail.Flags +import jakarta.mail.internet.{InternetAddress, MimeMessage} import javax.annotation.PreDestroy import javax.inject.Inject -import javax.mail.Flags -import javax.mail.internet.{InternetAddress, MimeMessage} import org.apache.james.core.{MailAddress, Username} import org.apache.james.jmap.JMAPConfiguration import org.apache.james.jmap.api.model.Size diff --git a/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/model/EmailSubmissionHelper.scala b/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/model/EmailSubmissionHelper.scala index 83b151311d..dbe14623fa 100644 --- a/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/model/EmailSubmissionHelper.scala +++ b/tmail-backend/jmap/extensions/src/main/scala/com/linagora/tmail/james/jmap/model/EmailSubmissionHelper.scala @@ -1,9 +1,9 @@ package com.linagora.tmail.james.jmap.model import cats.implicits.toTraverseOps -import javax.mail.Address -import javax.mail.Message.RecipientType -import javax.mail.internet.{InternetAddress, MimeMessage} +import jakarta.mail.Address +import jakarta.mail.Message.RecipientType +import jakarta.mail.internet.{InternetAddress, MimeMessage} import org.apache.james.core.MailAddress import org.apache.james.jmap.mail.{EmailSubmissionAddress, Envelope} diff --git a/tmail-backend/mailbox/encrypted/api/src/main/scala/com/linagora/tmail/encrypted/EncryptedMessageManager.scala b/tmail-backend/mailbox/encrypted/api/src/main/scala/com/linagora/tmail/encrypted/EncryptedMessageManager.scala index ea38c00e32..c2ef49b524 100644 --- a/tmail-backend/mailbox/encrypted/api/src/main/scala/com/linagora/tmail/encrypted/EncryptedMessageManager.scala +++ b/tmail-backend/mailbox/encrypted/api/src/main/scala/com/linagora/tmail/encrypted/EncryptedMessageManager.scala @@ -5,8 +5,8 @@ import java.util import java.util.Date import com.linagora.tmail.pgp.Encrypter +import jakarta.mail.Flags import javax.inject.Inject -import javax.mail.Flags import org.apache.james.mailbox.MessageManager.{AppendCommand, AppendResult, MailboxMetaData} import org.apache.james.mailbox.model.{ComposedMessageIdWithMetaData, FetchGroup, Mailbox, MailboxACL, MailboxConstants, MailboxCounters, MailboxId, MailboxPath, MessageRange, MessageResultIterator, SearchQuery} import org.apache.james.mailbox.{MailboxManager, MailboxSession, MessageManager, MessageUid} diff --git a/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/ContactsCollection.scala b/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/ContactsCollection.scala index 5f8bf75f9a..a63d52cd7b 100644 --- a/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/ContactsCollection.scala +++ b/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/ContactsCollection.scala @@ -5,8 +5,8 @@ import com.fasterxml.jackson.datatype.jdk8.Jdk8Module import com.google.common.collect.{ImmutableList, ImmutableSet} import com.linagora.tmail.james.jmap.EmailAddressContactInjectKeys import com.linagora.tmail.james.jmap.contact.{ContactFields, TmailContactUserAddedEvent} +import jakarta.mail.Message import javax.inject.{Inject, Named} -import javax.mail.Message import org.apache.commons.collections.CollectionUtils import org.apache.james.core.{MailAddress, Username} import org.apache.james.events.Event.EventId diff --git a/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/TMailMailboxAppender.scala b/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/TMailMailboxAppender.scala index 5faba4c740..eb961c70ac 100644 --- a/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/TMailMailboxAppender.scala +++ b/tmail-backend/mailets/src/main/scala/com/linagora/tmail/mailets/TMailMailboxAppender.scala @@ -3,7 +3,7 @@ package com.linagora.tmail.mailets import java.util.Optional import com.linagora.tmail.team.{TeamMailbox, TeamMailboxRepository} -import javax.mail.internet.MimeMessage +import jakarta.mail.internet.MimeMessage import org.apache.james.core.Username import org.apache.james.mailbox.MailboxManager import org.apache.james.mailbox.MessageManager.AppendResult diff --git a/tmail-backend/mailets/src/test/scala/com/linagora/tmail/mailets/TMailMailboxAppenderTest.scala b/tmail-backend/mailets/src/test/scala/com/linagora/tmail/mailets/TMailMailboxAppenderTest.scala index d6a1395955..069ff7242f 100644 --- a/tmail-backend/mailets/src/test/scala/com/linagora/tmail/mailets/TMailMailboxAppenderTest.scala +++ b/tmail-backend/mailets/src/test/scala/com/linagora/tmail/mailets/TMailMailboxAppenderTest.scala @@ -23,8 +23,8 @@ import java.time.Duration import com.linagora.tmail.mailets.TMailMailboxAppenderTest.{DOMAIN, EMPTY_FOLDER, FOLDER, STORAGE_DIRECTIVE, TEAM_MAILBOX, USER} import com.linagora.tmail.team.{TeamMailbox, TeamMailboxCallbackNoop, TeamMailboxName, TeamMailboxRepository, TeamMailboxRepositoryImpl} import eu.timepit.refined.auto._ -import javax.mail.MessagingException -import javax.mail.internet.MimeMessage +import jakarta.mail.MessagingException +import jakarta.mail.internet.MimeMessage import org.apache.james.core.builder.MimeMessageBuilder import org.apache.james.core.{Domain, Username} import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources diff --git a/tmail-backend/webadmin/webadmin-email-address-contact/src/main/java/com/linagora/tmail/webadmin/EmailAddressContactRoutes.java b/tmail-backend/webadmin/webadmin-email-address-contact/src/main/java/com/linagora/tmail/webadmin/EmailAddressContactRoutes.java index 36abe47838..ddba2bf414 100644 --- a/tmail-backend/webadmin/webadmin-email-address-contact/src/main/java/com/linagora/tmail/webadmin/EmailAddressContactRoutes.java +++ b/tmail-backend/webadmin/webadmin-email-address-contact/src/main/java/com/linagora/tmail/webadmin/EmailAddressContactRoutes.java @@ -3,7 +3,6 @@ import static org.eclipse.jetty.http.HttpHeader.LOCATION; import javax.inject.Inject; -import javax.mail.internet.AddressException; import org.apache.james.core.Domain; import org.apache.james.core.MailAddress; @@ -25,6 +24,7 @@ import com.linagora.tmail.webadmin.model.EmailAddressContactIdResponse; import com.linagora.tmail.webadmin.model.EmailAddressContactResponse; +import jakarta.mail.internet.AddressException; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import spark.Request; diff --git a/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/archival/InboxArchivalTaskTest.java b/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/archival/InboxArchivalTaskTest.java index 83bf935a51..c271fb1a08 100644 --- a/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/archival/InboxArchivalTaskTest.java +++ b/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/archival/InboxArchivalTaskTest.java @@ -9,8 +9,6 @@ import java.util.Date; import java.util.Map; -import javax.mail.Flags; - import org.apache.james.core.Domain; import org.apache.james.core.Username; import org.apache.james.domainlist.api.DomainList; @@ -33,6 +31,8 @@ import com.linagora.tmail.james.jmap.settings.JmapSettingsRepositoryJavaUtils; import com.linagora.tmail.james.jmap.settings.MemoryJmapSettingsRepository; +import jakarta.mail.Flags; + class InboxArchivalTaskTest { private static final Domain DOMAIN = Domain.of("domain.tld"); private static final Username BOB = Username.fromLocalPartWithDomain("bob", DOMAIN); diff --git a/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/cleanup/CleanupServiceTest.java b/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/cleanup/CleanupServiceTest.java index e5cc030885..83ebe05f12 100644 --- a/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/cleanup/CleanupServiceTest.java +++ b/tmail-backend/webadmin/webadmin-mailbox/src/test/java/com/linagora/tmail/webadmin/cleanup/CleanupServiceTest.java @@ -9,8 +9,6 @@ import java.util.Date; import java.util.Map; -import javax.mail.Flags; - import org.apache.james.core.Domain; import org.apache.james.core.Username; import org.apache.james.dnsservice.api.DNSService; @@ -39,6 +37,7 @@ import com.linagora.tmail.james.jmap.settings.JmapSettingsRepositoryJavaUtils; import com.linagora.tmail.james.jmap.settings.MemoryJmapSettingsRepository; +import jakarta.mail.Flags; import reactor.core.publisher.Flux; public class CleanupServiceTest { From 92cd14fd9a482f892b343fdf8e573baf61f1685a Mon Sep 17 00:00:00 2001 From: Rene Cordier Date: Thu, 7 Mar 2024 10:09:27 +0700 Subject: [PATCH 3/3] Force bouncycastle version to 1.70 in TMail build Version 1.77 seems to create weird issues during encryption with zip compression when decrypting it --- tmail-backend/pom.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tmail-backend/pom.xml b/tmail-backend/pom.xml index fb20989c6a..66d04ea429 100644 --- a/tmail-backend/pom.xml +++ b/tmail-backend/pom.xml @@ -62,6 +62,7 @@ org.apache.james 3.9.0-SNAPSHOT 9.2.0 + 1.70 2.13 @@ -323,7 +324,17 @@ org.bouncycastle bcpg-jdk15on - 1.70 + ${bouncycastle.version} + + + org.bouncycastle + bcpkix-jdk15on + ${bouncycastle.version} + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} com.google.firebase