You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/03/19 02:47:46 UTC

[GitHub] [james-project] glennosss opened a new pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1;
     https://github.com/eclipse-ee4j/mail/releases
     https://github.com/eclipse-ee4j/jaf/releases
   
   Also upgraded from Bouncy Castle 'bcmail' (Legacy JavaMail) to Bouncy Castle 'bcjmail' (Jakarta Mail);
     Read https://github.com/bcgit/bc-java/issues/832
   
   More specifically;
     'com.sun.mail:jakarta.mail:2.0.1' from 'com.sun.mail:javax.mail' / 'javax.mail:mail' / 'org.apache.geronimo.javamail:geronimo-javamail_1.4_mail'
     'com.sun.activation:jakarta.activation:2.0.1' from 'com.sun.activation:javax.activation' / 'javax.activation:activation' / 'javax.activation:javax.activation-api'
     'org.bouncycastle:bcjmail-jdk15on' from 'org.bouncycastle:bcmail-jdk15on'
   
   Most of this change involved replacing the following strings;
     import javax.mail. -> import jakarta.mail.
     import javax.activation. -> import jakarta.activation.
     import static javax.mail. -> import static jakarta.mail.
   
   Also updated license files as well.
   
   ### Assistance required to complete pull request
   
   A majority of my time was spent fixing checkstyle issues which I believe are mostly resolved - there may be one or two remaining checkstyle issues because I wasn't able to build the entire project successfully. Please excuse the minor change to `checkstyle.xml` to ImportOrder groups - "javax" changed to "javax,jakarta" - it was done to make the review process as easy as possible (import orders would have had to change radically without this making review harder). If it's a big deal for any one, I suggest changing it in a later pull request - otherwise it would make this pull request far too unwieldy.
   
   I'm hoping the project's maintainers can continue this pull request on my behalf from here. But as I said I'm confident this change is 99% complete. Thanks in advance for your support.


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

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

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



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


[GitHub] [james-project] chibenwa commented on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   Hello. This is much welcome.
   
   > If it's a big deal for any one, I suggest changing it in a later pull request 
   
   Not an issue to me.
   
   > I'm hoping the project's maintainers can continue this pull request on my behalf from here. But as I said I'm confident this change is 99% complete. Thanks in advance for your support.
   
   Thanks for the contribution. I'' then force push to solve the rebase conflict.
   
   


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

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

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



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


[GitHub] [james-project] chibenwa commented on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   We have some issues...
   
   In `org.apache.james.CassandraMailRepositoryIntegrationTest.deniedSenderMailShouldBeStoredInCassandraMailRepositoryWhenConfigured{GuiceJamesServer}` for instance.
   
   ```
   08:05:59.211 [ERROR] o.a.j.m.i.ProcessorImpl - Exception calling Bounce: class org.apache.geronimo.javamail.handlers.MultipartHandler cannot be cast to class jakarta.activation.DataContentHandler (org.apache.geronimo.javamail.handlers.MultipartHandler and jakarta.activation.DataContentHandler are in unnamed module of loader 'app')
   java.lang.ClassCastException: class org.apache.geronimo.javamail.handlers.MultipartHandler cannot be cast to class jakarta.activation.DataContentHandler (org.apache.geronimo.javamail.handlers.MultipartHandler and jakarta.activation.DataContentHandler are in unnamed module of loader 'app')
   ```
   
   Here the fix is to get rid of `geronimo` I imagine.
   
   ```
   $ grep geronimo * -R | grep pom.xml
   server/apps/spring-app/pom.xml:                    <groupId>org.apache.geronimo.javamail</groupId>
   server/apps/spring-app/pom.xml:                    <artifactId>geronimo-javamail_1.4_mail</artifactId>
   server/mailet/dkim/pom.xml:                    <groupId>org.apache.geronimo.javamail</groupId>
   server/mailet/dkim/pom.xml:                    <artifactId>geronimo-javamail_1.4_mail</artifactId
   ```
   
   Stacktrace:
   
   ```
   16:14:03.252 [ERROR] o.a.j.m.i.ProcessorImpl - Exception calling Bounce: class org.apache.geronimo.javamail.handlers.MultipartHandler cannot be cast to class jakarta.activation.DataContentHandler (org.apache.geronimo.javamail.handlers.MultipartHandler and jakarta.activation.DataContentHandler are in unnamed module of loader 'app')
   java.lang.ClassCastException: class org.apache.geronimo.javamail.handlers.MultipartHandler cannot be cast to class jakarta.activation.DataContentHandler (org.apache.geronimo.javamail.handlers.MultipartHandler and jakarta.activation.DataContentHandler are in unnamed module of loader 'app')
   	at jakarta.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:601)
   	at jakarta.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:554)
   	at jakarta.activation.DataHandler.getDataContentHandler(DataHandler.java:590)
   	at jakarta.activation.DataHandler.writeTo(DataHandler.java:289)
   	at jakarta.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1670)
   	at jakarta.mail.internet.MimeMessage.writeTo(MimeMessage.java:1888)
   	at jakarta.mail.internet.MimeMessage.writeTo(MimeMessage.java:1862)
   	at org.apache.james.server.core.MimeMessageWrapper.<init>(MimeMessageWrapper.java:158)
   	at org.apache.james.server.core.MailImpl.setMessage(MailImpl.java:505)
   	at org.apache.james.transport.mailets.redirect.ProcessRedirectNotify.createAlterMessage(ProcessRedirectNotify.java:126)
   	at org.apache.james.transport.mailets.redirect.ProcessRedirectNotify.process(ProcessRedirectNotify.java:68)
   	at org.apache.james.transport.mailets.Bounce.service(Bounce.java:246)
   	at org.apache.james.mailetcontainer.impl.ProcessorImpl.process(ProcessorImpl.java:73)
   ```
   
   JDKIM itself should likely be proted to jakarta.mail ?
   
   The spring app should likely be able to drop `org.apache.geronimo.javamail`...


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

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

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



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


[GitHub] [james-project] chibenwa commented on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   Ok, rebased. We are in for a ride. Let's wait what CI have to say!


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

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

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



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


[GitHub] [james-project] chibenwa commented on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   Thanks for your contributions so far!


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

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

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



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


[GitHub] [james-project] glennosss edited a comment on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

Posted by GitBox <gi...@apache.org>.
glennosss edited a comment on pull request #923:
URL: https://github.com/apache/james-project/pull/923#issuecomment-1073371631


   Created Jira: https://issues.apache.org/jira/browse/JAMES-3730
   
   Any thoughts or concerns so far on approving this pull request?


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

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

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



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


[GitHub] [james-project] glennosss commented on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   Created Jira: https://issues.apache.org/jira/browse/JAMES-3730
   
   I'm keen to get some movement on this! Thanks guys :)


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

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

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



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


[GitHub] [james-project] glennosss commented on pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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


   I'm having to move onto other projects. So good luck with the project guys. I'll leave this pull request open - feel free to do whatever you want with it - hope it goes well guys :-)


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

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

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



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


[GitHub] [james-project] chibenwa commented on a change in pull request #923: Upgraded from Legacy JavaMail to Jakarta Mail 2.0.1/Activation 2.0.1

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



##########
File path: mailbox/api/src/main/java/org/apache/james/mailbox/MessageIdManager.java
##########
@@ -23,7 +23,7 @@
 import java.util.List;
 import java.util.Set;
 
-import javax.mail.Flags;
+import jakarta.mail.Flags;

Review comment:
       This breaking change on the `mailbox-api` needs to be documented.
   
   
   This should be done via an entry within `upgrade-instructions.md` telling that people writing mailets needs to change their imports.

##########
File path: mailet/api/src/main/java/org/apache/mailet/Mail.java
##########
@@ -28,8 +28,8 @@
 import java.util.Optional;
 import java.util.stream.Stream;
 
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
+import jakarta.mail.MessagingException;
+import jakarta.mail.internet.MimeMessage;

Review comment:
       This breaking change on the Mail API needs to be documented.
   
   
   This should be done via an entry within `upgrade-instructions.md` telling that people writing mailets needs to change their imports.
   

##########
File path: pom.xml
##########
@@ -2186,17 +2182,17 @@
             </dependency>
             <dependency>
                 <groupId>com.sun.activation</groupId>
-                <artifactId>javax.activation</artifactId>
-                <version>1.2.0</version>
+                <artifactId>jakarta.activation</artifactId> <!-- Replaces 'com.sun.activation:javax.activation' -->

Review comment:
       Do we need this comment?

##########
File path: pom.xml
##########
@@ -2186,17 +2182,17 @@
             </dependency>
             <dependency>
                 <groupId>com.sun.activation</groupId>
-                <artifactId>javax.activation</artifactId>
-                <version>1.2.0</version>
+                <artifactId>jakarta.activation</artifactId> <!-- Replaces 'com.sun.activation:javax.activation' -->
+                <version>${jakarta-activation.version}</version>
             </dependency>
             <dependency>
                 <groupId>com.sun.mail</groupId>
-                <artifactId>javax.mail</artifactId>
-                <version>1.6.2</version>
+                <artifactId>jakarta.mail</artifactId> <!-- Replaces 'com.sun.mail:javax.mail' -->

Review comment:
       Do we need this comment?




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

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

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



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