You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/12/25 15:44:49 UTC

(causeway) branch spring6 updated: fixes prev. merge

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch spring6
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/spring6 by this push:
     new ad5177a675 fixes prev. merge
ad5177a675 is described below

commit ad5177a675e0c902b10764568408c12547188999
Author: andi-huber <ah...@apache.org>
AuthorDate: Mon Dec 25 16:44:44 2023 +0100

    fixes prev. merge
---
 .../runtimeservices/email/EmailServiceDefault.java  | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/email/EmailServiceDefault.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/email/EmailServiceDefault.java
index 578e0a6810..99cc37dbbc 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/email/EmailServiceDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/email/EmailServiceDefault.java
@@ -22,13 +22,13 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Properties;
 
-//import jakarta.activation.DataSource; TODO incompatible with commons-email 1.6.0
+//import jakarta.activation.DataSource; TODO[CAUSEWAY-3275] incompatible with commons-email 1.6.0
 import jakarta.annotation.PostConstruct;
 import jakarta.annotation.Priority;
 import jakarta.inject.Inject;
 import jakarta.inject.Named;
 
-import org.apache.commons.mail.DefaultAuthenticator;
+//import org.apache.commons.mail.DefaultAuthenticator; TODO[CAUSEWAY-3275]
 import org.apache.commons.mail.EmailException;
 import org.apache.commons.mail.ImageHtmlEmail;
 import org.apache.commons.mail.resolver.DataSourceClassPathResolver;
@@ -163,11 +163,12 @@ public class EmailServiceDefault implements EmailService {
             final int socketTimeout = getSocketTimeout();
             final int socketConnectionTimeout = getSocketConnectionTimeout();
 
-            if (senderEmailUsername != null) {
-                email.setAuthenticator(new DefaultAuthenticator(senderEmailUsername, senderEmailPassword));
-            } else {
-                email.setAuthenticator(new DefaultAuthenticator(senderEmailAddress, senderEmailPassword));
-            }
+//TODO[CAUSEWAY-3275] commons email not available for jakarta API
+//            if (senderEmailUsername != null) {
+//                email.setAuthenticator(new DefaultAuthenticator(senderEmailUsername, senderEmailPassword));
+//            } else {
+//                email.setAuthenticator(new DefaultAuthenticator(senderEmailAddress, senderEmailPassword));
+//            }
             email.setHostName(senderEmailHostName);
             email.setSmtpPort(senderEmailPort);
             email.setStartTLSEnabled(senderEmailTlsEnabled);
@@ -176,7 +177,9 @@ public class EmailServiceDefault implements EmailService {
             email.setSocketTimeout(socketTimeout);
             email.setSocketConnectionTimeout(socketConnectionTimeout);
 
-            final Properties properties = email.getMailSession().getProperties();
+//TODO[CAUSEWAY-3275] commons email not available for jakarta API
+//            final Properties properties = email.getMailSession().getProperties();
+            final var properties = new Properties();
 
             properties.put("mail.smtps.auth", "true");
             properties.put("mail.debug", "true");
@@ -193,7 +196,7 @@ public class EmailServiceDefault implements EmailService {
 
             if (attachments != null && attachments.length > 0) {
                 for (jakarta.activation.DataSource attachment : attachments) {
-                    //email.attach(attachment, attachment.getName(), ""); TODO incompatible with commons-email 1.6.0
+                    //email.attach(attachment, attachment.getName(), ""); TODO[CAUSEWAY-3275] incompatible with commons-email 1.6.0
                 }
             }