airajena commented on code in PR #5369:
URL: https://github.com/apache/fineract/pull/5369#discussion_r2724067122


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/GmailBackedPlatformEmailService.java:
##########
@@ -74,12 +74,16 @@ public void sendDefinedEmail(EmailDetail emailDetails) {
         props.put("mail.debug", "true");
 
         // these are the added lines
-        props.put("mail.smtp.starttls.enable", "true");
-        // props.put("mail.smtp.ssl.enable", "true");
-
-        props.put("mail.smtp.socketFactory.port", 
Integer.parseInt(smtpCredentialsData.getPort()));
-        props.put("mail.smtp.socketFactory.class", 
"javax.net.ssl.SSLSocketFactory");// NOSONAR
-        props.put("mail.smtp.socketFactory.fallback", "true");
+        // Only apply strict Gmail settings if we are actually connecting to 
Gmail
+        if (smtpCredentialsData.getHost() != null && 
smtpCredentialsData.getHost().endsWith("gmail.com")) {

Review Comment:
   The code already handles this - it only applies strict SSL/TLS settings when 
the SMTP host ends with gmail.com. For other providers (Yahoo, Outlook, 
ProtonMail, or even local testing with Mailhog), it uses relaxed settings 
without forcing the SSL SocketFactory. This way, the email service works with 
any SMTP provider configured in the external services settings.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to