2 Replies Latest reply on Mar 2, 2016 3:23 PM by s.santilli

    JBoss Wildfly 10 + Mail Resource Configuration

    s.santilli

      Good Day,

       

      I am new to JBoss Wildfly 10 and am migrating over from Glassfish. Previously in my glassfish configuration, we had a mail-resource configured to communicate with our remote MS Exchange mail server. I am essentially trying to mimic and duplicate the configuration, porting it over to JBoss Wildfly 10, however thus far I have been unsuccessful.

       

      I have attempted to research, but there is little to no documentation that helps or works.

       

      To elaborate further, in Glassfish I have a mail-resource defined as follows in the Glassfish configuration  file (domain.xml):

       

      <mail-resource host="msexchange" from="service@domain.com" user="ACCOUNTS\myservice" jndi-name="mail/service_msexchange"></mail-resource>
      

       

      I think/hope the configuration is self explanatory to understand what it is I am trying to achieve.

       

      Any assistance is greatly appreciated.

       

      Thank-you kindly

        • 1. Re: JBoss Wildfly 10 + Mail Resource Configuration
          jamezp

          You should be able to configure this with the web console (Configuration -> Subsystems -> Mail) or with CLI. Here's a reference to the management model Wildfly Model Reference.

           

          The CLI commands would look something like this.

          batch
          /subsystem=mail/mail-session=msexchange:add(from="service@domain.com", jndi-name="java:/mail/service_msexchange")
          /subsystem=mail/mail-session=msexchange/server=smtp:add(outbound-socket-binding-ref=mail-smtp, username="ACCOUNTS\myservice")
          run-batch
          

           

          --

          James R. Perkins

          • 2. Re: JBoss Wildfly 10 + Mail Resource Configuration
            s.santilli

            Just wanted to update this email thread in the event someone out there finds themselves in a similar position, this is how I got my JBoss WildFly 10 to communicate with our ms exchange server:

             

            Inside the standalone.xml, I configured the following:

             

            Within  <subsystem xmlns="urn:jboss:domain:mail:2.0">

            <mail-session name="mail-msexchange" from="service@domain.com" jndi-name="java:/mail/service_msexchange" debug="true">
                            <smtp-server outbound-socket-binding-ref="mail-msexchange"/>
            </mail-session>
            


            Within  <socket-binding-group>

            <outbound-socket-binding name="mail-msexchange">
                     <remote-destination host="<exchange-ip-here>" port="25"/>
            </outbound-socket-binding>
            

             

            That's all that was needed in my case.

            Hope that helps someone