3 Replies Latest reply on Sep 21, 2010 2:07 PM by davsclaus

    camel-mail smtp endpoint returning authentication failure

    dekk11

      I am trying to send simple text email message via smtp endpoint and getting MailAuthenticationException thrown from underlying mail transport.  I have a separate SMTP send mail java client that does successfully send the message via smtp using the same parameters.  I am using Camel 2.4.

       

      When I set debugMode=true the only DEBUG that appears on the karaf console is "DEBUG: setDebug: JavaMail version 1.4.3" upon starting the osgi bundle.  None of the other JavaMail debug statements are seen, could they be getting redirected somewhere else?  I need to see these debug statements to see what the mail transport is actually doing.  Any ideas on how to see the javamail debug statements?

       

      Exception:

      Error org.springframework.mail.javamail.MailAuthenticationException: Authentication Failed; nested exception is javax.mail.AuthenticationFailedException: 334

       

       

      SMTP endpoint:

       

        • 1. Re: camel-mail smtp endpoint returning authentication failure
          davsclaus

          Test it outside OSGi to see if it works. The JavaMail debug is logged to system out AFAIR. But I think you can find some info on it in the SUN Java Mail website.

          • 2. Re: camel-mail smtp endpoint returning authentication failure
            dekk11

            Using Servicemix/OSGi, I was able to see the rest of the JavaMail debugs when I set the JVM option "-Dmail.debug=true".  When set in the servicemix startup script all the javamail debug statements appeared in the console.

             

            It appears that there is a bug in the JavaMail 1.4.3 jar.  The 1.4.3 version includes NTLM support, which doesn't work, and doesn't recognize the java property "mail.stmp.auth.ntlm.disable=true".  I was able to get my standalone java SMTP client to successfully send messages using JavaMail 1.4.4-SNAPSHOT version. 

             

            I am using camel-mail 2.4.0 which has a dependency on javamail 1.4.3.  How can I force camel-mail to use javamail 1.4.4 or back to javamail 1.4.1?

             

            Can I use camel-mail 2.2.0 (which uses javamail 1.4.1) but continue to use 2.4.0 for all other camel components?  I tried using camel-mail 2.2.0  but that was not playing nice with camel-core 2.4.0.

            • 3. Re: camel-mail smtp endpoint returning authentication failure
              davsclaus

              You can most likely just install the version of the java mail bundle that works for you in the ESB container.