playframework / play-mailer

Play mailer plugin
Apache License 2.0
250 stars 74 forks source link

Switch to Jakarta Mail #261

Closed mkurz closed 4 weeks ago

mkurz commented 1 year ago

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:

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 commented 3 months ago

Apache Commons Email 2.0.0-M1 released:

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

mikesname commented 2 months ago

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:

mkurz commented 2 months ago

@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.

mikesname commented 2 months ago

@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!

mkurz commented 4 weeks ago

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:

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).

mikesname commented 3 weeks ago

@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.

mkurz commented 3 weeks ago

@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!