4 Replies Latest reply on Nov 18, 2013 5:59 AM by Henrik Hoffmann

    how to configure jboss 7 mail for NTLM authentication?

    Henrik Hoffmann Newbie

      Hello,

       

      i'm migrating from EAP 5.1 to EAP 6.1 and encountered a new problem: sending mails via smtp and NTLM authentication

       

      my mail configuration in eap 6.1 looks like this:

      <subsystem xmlns="urn:jboss:domain:mail:1.1">
          <mail-session jndi-name="java:jboss/mail/myMail" from="service@mydomain.org" debug="true">
              <smtp-server ssl="false" outbound-socket-binding-ref="mail-smtp">
                  <login name="service" password="mypass"/>
              </smtp-server>
          </mail-session>
      </subsystem>
      
      <!-- [...] -->
      
      <outbound-socket-binding name="mail-smtp">
          <remote-destination host="192.168.0.1" port="25"/>
      </outbound-socket-binding>
      
      
      

       

       

      with this i'm getting following ERROR:

      javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

       

               at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823)

               at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756)

               at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673)

               at javax.mail.Service.connect(Service.java:317)

               at javax.mail.Service.connect(Service.java:176)

               at javax.mail.Service.connect(Service.java:125)

               at javax.mail.Transport.send0(Transport.java:194)

               at javax.mail.Transport.send(Transport.java:124)

               at org.mycode.server.MailerBean.sendMessage(MailerBean.java:170)

               at org.mycode.server.MailerBean.sendEmail(MailerBean.java:102)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

               at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)

               at org.mycode.server.LoggingInterceptor.invoke(LoggingInterceptor.java:106)

               at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:606)

               at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:123)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

               at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

               at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:226)

               at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:317)

               at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

               at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

               at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)

               at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

               at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

               at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)

               at org.mycode.server.IMailerLocal$$$view288.sendEmail(Unknown Source)

               at org.mycode.server.MyBean.sendMail(MyBean.java:113)

               ... 164 more

       

       

       

      my old (working) mail-service.xml in eap 5.1 looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- $Id: mail-service.xml 62350 2007-04-15 16:50:12Z dimitris@jboss.org $ -->
      <server>
      
        <!-- ==================================================================== -->
        <!-- Mail Connection Factory                                              -->
        <!-- ==================================================================== -->
      
        <mbean code="org.jboss.mail.MailService"
               name="jboss:service=Mail">
          <attribute name="JNDIName">java:/Mail</attribute>
          <attribute name="User">service</attribute>
          <attribute name="Password">mypass</attribute>
          <attribute name="Configuration">
            <!-- A test configuration -->
            <configuration>
              <!-- Change to your mail server prototocol -->
              <property name="mail.store.protocol" value="imap"/>
              <property name="mail.transport.protocol" value="smtp"/>
      
              <!-- Change to the user who will receive mail  -->
              <property name="mail.user" value="service"/>
      
              <!-- Change to the mail server  -->
              <property name="mail.imap.host" value="192.168.0.1"/>
      
              <!-- Change to the SMTP gateway server -->
              <property name="mail.smtp.host" value="192.168.0.1"/>
              <property name="mail.smtp.auth" value="true"></property>
            
              <!-- The mail server port -->
              <property name="mail.smtp.port" value="25"/>
              <property name="mail.smtp.ssl.enable" value="false"></property>
            
              <!-- Change to the address mail will be from  -->
              <property name="mail.from" value="service@mydomain.org"/>
          <property name="mail.smtp.auth.ntlm.domain" value="mylm" />
          <property name="mail.smtp.auth.mechanisms" value="NTLM" />
          <property name="mail.smtp.auth.ntlm.disable" value="false" />
      
              <!-- Enable debugging output from the javamail classes -->
              <property name="mail.debug" value="true"/>
                       </configuration>
          </attribute>
          <depends>jboss:service=Naming</depends>
        </mbean>
      
      </server>
      
      
      
      

       

       

       

       

      my suggest is, that the NTLM properties are missing

       

      does anyone may solved this or could anyone help please?

      thank you in advance