You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2021/08/25 12:19:19 UTC

[GitHub] [fineract] francisguchie commented on a change in pull request #1837: FINERACT-1389 add starttls and factory

francisguchie commented on a change in pull request #1837:
URL: https://github.com/apache/fineract/pull/1837#discussion_r695695411



##########
File path: fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/GmailBackedPlatformEmailService.java
##########
@@ -73,15 +73,15 @@ public void sendDefinedEmail(EmailDetail emailDetails) {
         props.put("mail.smtp.auth", "true");
         props.put("mail.debug", "true");
 
-        try {
-            if (smtpCredentialsData.isUseTLS()) {
-                // Needs to disable startTLS if the port is 465 in order to send the email successfully when using the
-                // smtp.gmail.com as the host
-                if (smtpCredentialsData.getPort().equals("465")) {
-                    props.put("mail.smtp.starttls.enable", "false");
-                }
-            }
+        // these are the added lines
+        props.put("mail.smtp.starttls.enable", "true");
+        // props.put("mail.smtp.ssl.enable", "true");

Review comment:
       @BLasan  - I read around and discovered that by triggering starttls.enable = true, intuitively if a server uses SSL this will still deliver the email. For example I have tested this code on a server that has Domain Validation Certificate verified by lets Encrypt (https://letsencrypt.org/). and it still works. 
   
   Our biggest challenge is the email is being sent as plaintext and if we enable props.put("mail.smtp.ssl.enable", "true"); then the we will get this error - javax.net.ssl.SSLException: Unsupported or unrecognized SSL message and i went ahead to look into what others say like here https://stackoverflow.com/questions/61747336/javax-net-ssl-sslexception-unsupported-or-unrecognized-ssl-message 
   
   In conclusion when i disabled this property all worked fine for create users , self service users etc it all works fine for me atleast 




-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org