Aman-Mittal commented on PR #5369:
URL: https://github.com/apache/fineract/pull/5369#issuecomment-3794768008

   I'm not sure about this, simply hard coding this logic is not the correct
   way to do it. What if google adds new SMTP hostname, de we have to maintain
   this setting everytime A new provider gets add. I think it should handled
   based on configuration based. This logic seems too fragile for me. Maybe I
   am wrong but way it is implemented in not right, these type of settings
   should be configuration driven.
   
   On Sat, 24 Jan, 2026, 6:58 pm Aira Jena, ***@***.***> wrote:
   
   > *airajena* left a comment (apache/fineract#5369)
   > <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?
   > … <#m_800436846468510565_>
   > 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., ***@***.*** or
   > ***@***.***), 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 ***@***.***) → SMTP host: smtp.gmail.com → Gmail settings
   > applied
   > Google Workspace ***@***.***) → SMTP host: smtp.gmail.com → Gmail
   > settings applied
   > Outlook 365 ***@***.***) → 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.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/fineract/pull/5369#issuecomment-3794632194>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AHV6TA4DQKCTCOXHYJ4GUE34INXQXAVCNFSM6AAAAACSUFDBTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOJUGYZTEMJZGQ>
   > .
   > You are receiving this because you commented.Message ID:
   > ***@***.***>
   >
   


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