[MAGNOLIA-2420] Allow mail.smtp.starttls.enable property configuration Created: 09/Oct/08  Updated: 23/Jan/13  Resolved: 23/Jan/09

Status: Closed
Project: Magnolia
Component/s: mail
Affects Version/s: None
Fix Version/s: 4.0, 3.6.4, 3.6.5

Type: Improvement Priority: Minor
Reporter: Marco Collovati Assignee: Teresa Miyar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File MgnlMailFactory.patch     File module-mail_MAGNOLIA-2420.patch    
Issue Links:
duplicate
is duplicated by MAGNOLIA-2484 Possibility to send mails through SSL... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

For some smtp server (gmail) we need to set mail.smtp.starttls.enable property to true when creating a mail Session



 Comments   
Comment by Magnolia International [ 09/Oct/08 ]

Thanks for the patch, will review and apply asap.

Comment by Alejandro Scandroli [ 18/Jan/09 ]

Different patch to solve the same problem.
I have added the socketFactory port, class, & fallback configurations, I have also added the "debug" option and finally I have modified the bootstrap config file.

Comment by Magnolia International [ 19/Jan/09 ]

Thanks ! Will have to be modified to be applied on trunk. We'll also have to add an update task to add the new properties in the config.

Comment by Alejandro Scandroli [ 19/Jan/09 ]

I just realized that my patch only works on port 465 (SSL) and doesn't support the other gmail port 587 (TLS)
I've mixed up the configuration parameters and they are mutually exclusive.
The code should be something like this:

 
        if (Boolean.valueOf((String) this.mailParameters.get(SMTP_SSL)).booleanValue()) {
            props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
            props.put("mail.smtp.socketFactory.fallback", "false");
        }

        if (Boolean.valueOf((String) this.mailParameters.get(SMTP_TLS)).booleanValue()) {
            props.put("mail.smtp.starttls.enable", "true");
        }

Tomorrow, I will create a new patch (this time against trunk) to fix this.

Comment by Magnolia International [ 20/Jan/09 ]

Thanks Alejandro, waiting for this - we'll also apply on the 3.6 branch if you provide the update version.

Comment by Alejandro Scandroli [ 22/Jan/09 ]

I saw the changes in the trunk, do you still need the patch? what about the 3.6 branch?

Comment by Magnolia International [ 23/Jan/09 ]

If the change in the trunk does what you needed, then I guess we're fine
3.6 should have been patched too - Teresa ?

Comment by Alejandro Scandroli [ 23/Jan/09 ]

Thank you Gregory, Thank you Teresa!

Generated at Mon Feb 12 03:36:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.