3 Replies Latest reply on Dec 17, 2009 2:20 PM by beve

    ESB 4.5 - Email helper - support for smtp Session properties

    michal.domagala

      Hi,

       

      I use the org.jboss.soa.esb.helpers.Email helper class to send emails from JBoss ESB but I can't figure out a way to change the value of a mail Session properties. I'd like to change things like: mail.smtp.quitwait or mail.smtp.timeout because the remote server I communicate with tends to hang during the QUIT operation. Setting mail.smtp.quitwait=false (the default is true) seems like easiest way to circumvent the problem.

       

      Looking at the Email class code I don't think it's possible to achieve the desired behaviour. Looks like it's event not possible to exted the class to modify the Session creation process.

       

      Anyways, has someone run into a similar problem or found a way to set the Session properties (other than writing your own Email helper ;-) )?

       

      --

      All the best,

      Michal

        • 1. Re: ESB 4.5 - Email helper - support for smtp Session properties
          beve

          Hi,

           

          looking at the current code this does not seem to be possible.

           

          We could add the ability to pass additional properties so that users can specify them in there config. These would be set on the javax.mail.Session.

          I'm pretty sure this does not help you at the moment but I'll create a JIRA task for this so that you can track it.

          Sorry about this.

           

          Regards,

           

          /Daniel

          • 2. Re: ESB 4.5 - Email helper - support for smtp Session properties
            michal.domagala

            OK,  thanks for the reply. When you create a JIRA issue, please post the link here.

             

            Just a few ideas related to the topic:

            * I think I read that you plan to exted the email functionalities in JBoss by allowing users to configure more than one smtp server so probably it would be useful to make it possible to configure Session properties separately for these servers,

             

            * the default Java mail API behavior - so when smtp properties are not explicitly set - is to load them from System.getProperties(). It might be useful to have this option in JBoss, too (at least as an option).

             

            * based on this case I think that everyone would benefit from classes that are a bit more extensible. I mean regarding the Email class, it's basically OK (composing the body, adding attachments etc.) , but I wish I could extend it and modify only the session creation process but too many methods are marked private instead of (at least protected). anyway, this is a general remark.

             

            --

            Thanks again,

            Michal

            • 3. Re: ESB 4.5 - Email helper - support for smtp Session properties
              beve

              I've create a jira for this issue.

               

              Regards,

               

              /Daniel