|
Re: Mail / SMTP / Authentication [message #1163783 is a reply to message #1162876] |
Thu, 31 October 2013 08:00   |
|
Florian,
as you probably know the original SMTP protocol did not cover authentication and instead frequently mail server limit the IPs from which they relay emails or support POP3 before SMTP. That may be the reason why there was little pressure to implement SMTP AUTH so far. That being said, this is not the first time I hear the request and we thought about it but did not get around to adding it due to other higher priorities.
It would not be a difficult change considering that Java already supports it ootb. It should be along those lines:
1. adjust org.eclipse.stardust.engine.extensions.mail.app.MailApplicationInstance to support the additional two parameters in the same way it is already done for the other parameters for instance for the mail sever
2. adjust org.eclipse.stardust.engine.extensions.mail.app.MailAssembler:
private void prepareMsg() throws MessagingException
{
Properties props = new Properties();
props.put("mail.smtp.host", mailHost);
props.put("mail.debug", "true");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(this.smtpUsername,this.smtpPassword);
}
});
...
3. add additional fields to Email application type in Modeler
To add auth support to the email notifications sent from events one would probably adjust org.eclipse.stardust.engine.core.runtime.beans.MailHelper adding similar code around line 70.
Feel free to contribute this improvement 
Best regards
Rob
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02181 seconds