[ 
https://issues.apache.org/jira/browse/SYNCOPE-457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838663#comment-13838663
 ] 

Hadrian Zbarcea commented on SYNCOPE-457:
-----------------------------------------

Please find attached a patch implementing the solution suggested.

As I suspected, there is a place where we need to override the mailSender, 
namely the NotificationTest. Since the fields are private and needed to 
override the mailSender, I could have added a public setter, but that was not 
very elegant. Overriding the mail.properties was not great either, because it 
was doing so for all the tests. I chose to add a mail-notification.properties, 
specific for that test and a new context defining just the property-placeholder 
(I prefer the xml syntax), but then I had to specify an order. I also removed 
the <SyncopeConf> entries from content.xml. That's pretty much it.

I hope it's complete, but I am not sure what (if anything) needs to be 
documented for a migration guide from the 1.1.x version to 1.2.0, in terms of 
configuration. I am also not sure if the changes in configuration have any 
impact on the console gui.

> Must be able to configure JavaMailSender used by NotificationJob
> ----------------------------------------------------------------
>
>                 Key: SYNCOPE-457
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-457
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.5, 1.2.0
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>             Fix For: 1.2.0
>
>         Attachments: syncope-457.patch
>
>
> In NotificationJob.executeSingle we instantiate a new JavaMailSenderImpl() 
> which we then populate with some values. There are however other properties 
> [1] that can be set on the Session. Some of them are very useful, especially 
> in production environments.
> In particular, the 'mail.smtp.connectiontimeout' should be set to a different 
> value than the default 'infinite' which would cause the thread to hang, 
> waiting for a unresponsive SMTP server (either misconfiguration of server 
> down).
> I will try to come up with a patch towards the end of the week if nobody 
> beats me to it.
> [1] https://javamail.java.net/nonav/docs/api/



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to