Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » Mail / SMTP / Authentication(Set SMTP AuthenticationCredentials)
Mail / SMTP / Authentication [message #1162876] Wed, 30 October 2013 17:33 Go to next message
Florian Kammermann is currently offline Florian Kammermann
Messages: 12
Registered: October 2012
Junior Member
Is it possible to set the Credentials (username/password) for a SMTP host.

We have two scenarios:

1. Send Mails over the Mail Application Type, there you can configure the Mail Sever in the Mail Application. But no fields for username/password.

2. The Mails that will automtically be sent from stardust on eg. password reset. For this the Mail Server can be configured over the carnot.properties - Mail.Host. But no fields for username/password.

Is it only possible to send Mails over a server without authentication in these two scenarios?
Re: Mail / SMTP / Authentication [message #1163783 is a reply to message #1162876] Thu, 31 October 2013 08:00 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert Emsbach
Messages: 121
Registered: October 2011
Location: Singapore
Senior Member

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 Smile

Best regards

Rob



Re: Mail / SMTP / Authentication [message #1163799 is a reply to message #1163783] Thu, 31 October 2013 08:11 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert Emsbach
Messages: 121
Registered: October 2011
Location: Singapore
Senior Member

Florian,

I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=420784 for this

Btw. you could also use the Camel Application Type. Looks like Camel supports SMTP AUTH http://camel.apache.org/mail.html

Best regards

Rob



Re: Mail / SMTP / Authentication [message #1219312 is a reply to message #1163799] Tue, 03 December 2013 09:45 Go to previous message
Robert Emsbach is currently offline Robert Emsbach
Messages: 121
Registered: October 2011
Location: Singapore
Senior Member

Florian, I saw you attached your implementation to the ticket.
Glad this worked. We will test and include it.

Rob
Previous Topic:How to deploy stardust WAR to Tomcat
Next Topic:Maven repository links are broken
Goto Forum:
  


Current Time: Thu Oct 23 12:45:00 GMT 2014

Powered by FUDForum. Page generated in 0.02164 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software