play-mailer icon indicating copy to clipboard operation
play-mailer copied to clipboard

Switch to Jakarta Mail

Open mkurz opened this issue 2 years ago • 1 comments

Just a reminder to switch from javax.mail.* to jakarta.mail.* and from javax.activation.* to jakarta.activation.* when possible. This depends on commons-email however:

  • https://github.com/apache/commons-email/pull/133
  • https://github.com/apache/commons-email/pull/43
  • https://github.com/apache/commons-email/pull/37

Probably Angus Mail will be used as implemention of Jakarta Mail 2.x.

(BTW: Also check this line in play-grpc, not sure if or when we should change that exclude.)

mkurz avatar May 03 '23 17:05 mkurz

Apache Commons Email 2.0.0-M1 released:

  • https://lists.apache.org/thread/hhj6ls084031h1b9l1knvhomyzbms4jt
    • https://lists.apache.org/thread/4m1p5zohdz5zq8vb9lnmb923zj6lmt43
    • https://lists.apache.org/thread/4m1p5zohdz5zq8vb9lnmb923zj6lmt43

Be aware that the groupid changed to commons-email2-*: https://repo1.maven.org/maven2/org/apache/commons/

mkurz avatar Jul 10 '24 10:07 mkurz

Upvoting this because I've just run into an incompatibility with Play Mailer and the Jakarta-based SMTP appender for the version of Logback used in Play 2.9. :frowning_man:

mikesname avatar Aug 28 '24 14:08 mikesname

@mikesname Like written in my previous comment, there is a first milestone release of apache commons 2. If you want to help out you can git-checkout the the main branch and upgrade to the this first milestone. We could then release a M1 of next play-mailer as well which you coul make use of.

mkurz avatar Sep 04 '24 08:09 mkurz

@mkurz I've put in a PR with the upgraded deps. I've tested locally and all seems good, but let me know what else needs doing for an M1 release. I'm not even sure what the new versions would be given that 9.x and 10.x are current for Play 2.9 and 3.0 respectively - 11.x and 12.x?. Thanks!

mikesname avatar Sep 04 '24 15:09 mikesname

Thanks @mikesname - I've just published play-mailer 11.0.0-M1: https://github.com/playframework/play-mailer/releases/tag/11.0.0-M1 Please test it and let me know if it works for you:

libraryDependencies += "org.playframework" %% "play-mailer[-guice]" % "11.0.0-M1"

Also please report here:

  • https://github.com/apache/commons-email/pull/43

BTW, you can use it even when with Play 2.9 - play-mailer does not actually depend on anything Play 3 specific (just for testing): https://repo1.maven.org/maven2/org/playframework/play-mailer_2.13/11.0.0-M1/play-mailer_2.13-11.0.0-M1.pom https://repo1.maven.org/maven2/org/playframework/play-mailer-guice_2.13/11.0.0-M1/play-mailer-guice_2.13-11.0.0-M1.pom

So from v11 on there will be just this one release for both Play lines (Pekko/Akka).

mkurz avatar Oct 08 '24 11:10 mkurz

@mkurz thanks very much for this. I can't claim to have tested every aspect of functionality yet but works well for my purposes on Play 2.9.5.

mikesname avatar Oct 15 '24 15:10 mikesname

@mikesname Can you please also report overt at https://github.com/apache/commons-email/pull/43 to let the commons-mail maintainer know? So we get a RC and/or final release faster, thanks!

mkurz avatar Oct 16 '24 09:10 mkurz