spring-boot-starter-mail (at least for 3.5.6 release) brings transitive depenedency org.eclipse.angus:jakarta.mail.
However usage of this dependency should be discouraged in Maven/Gradle world because it's an uberjar.
So if the classpath of a module contains jakarta.mail-api or/and angus-mail dependencies we have duplication of classes.
See https://eclipse-ee4j.github.io/angus-mail/#Download_Angus_Mail_Release and also greenmail-mail-test/greenmail#553 for the detail explanation.
Suggestion: depend on jakarta.mail-api and angus-mail as recommended by Angus