airajena commented on PR #5369: URL: https://github.com/apache/fineract/pull/5369#issuecomment-3794632194
> Brother, by your logic if it's for strict gmail. Then what about cases which uses their custom domain for example organization email or education email from Google workspace. What would happen to that? Will that work? > […](#) > On Sat, 24 Jan, 2026, 5:05 pm Aira Jena, ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/GmailBackedPlatformEmailService.java <[#5369 (comment)](https://github.com/apache/fineract/pull/5369#discussion_r2724067122)>: > @@ -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")) { 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. — Reply to this email directly, view it on GitHub <[#5369 (comment)](https://github.com/apache/fineract/pull/5369#discussion_r2724067122)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHV6TA63OV2P7O3AEJXFMS34INKIHAVCNFSM6AAAAACSUFDBTOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTOMBRGQ3TKMRRG4> . You are receiving this because you commented.Message ID: ***@***.***> The check is based on the SMTP host (smtpCredentialsData.getHost()), not the user's email domain. For Google Workspace with custom domains (e.g., [email protected] or [email protected]), the SMTP server is still smtp.gmail.com. So the condition getHost().endsWith("gmail.com") would correctly apply the Gmail-specific SSL settings. Examples: Gmail ([email protected]) → SMTP host: smtp.gmail.com → Gmail settings applied Google Workspace ([email protected]) → SMTP host: smtp.gmail.com → Gmail settings applied Outlook 365 ([email protected]) → SMTP host: smtp.office365.com → elaxed settings Yahoo → SMTP host: smtp.mail.yahoo.com → Relaxed settings The SMTP host is configured in Fineract's external services settings by the administrator, so it correctly identifies the mail provider regardless of the sender's email domain. -- 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]
