Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

java mail verision issue of alert pulisher

java mail verision issue of alert pulisher

New Contributor

Alert publiser can not send email in our company, since the java mail library it is using has problems,can you update the version?

4 REPLIES 4

Re: java mail verision issue of alert pulisher

Super Collaborator

May I ask what issue you are reporting, perhaps there's a workaround that I can help you with.

Unless you are certain that an upgrade of the mail jar will resolve the issue. 

 

Alert publiser can not send email in our company, since the java mail library it is using has problems,can you update the version?

- How is the mail server configured?

- How did you discover that the java mail library is the root cause?

- Is it secure/insecure mail server (StartTLS)? 

- Can you outline steps to reproduce?

- Can you share the log from alertpublisher (obfuscate sensitive info)?

Highlighted

Re: java mail verision issue of alert pulisher

New Contributor

We have mail server "smtp.neusoft.com", I don't known how is the mail server setup, just found the following error in /var/log/cloudera-scm-alertpublisher/mgmt-cmf-mgmt-ALERTPUBLISHER-cloudera-manager.mr.log.out when I failed to send test mail

2018-04-04 09:43:23,401 INFO com.cloudera.enterprise.alertpublisher.processor.EmailSubjectGenerator.verbose: Generated subject [Cloudera Alert] Test Alert.
2018-04-04 09:43:23,483 ERROR org.apache.camel.processor.DefaultErrorHandler: Failed delivery for exchangeId: ID-cloudera-manager-mr-43423-1522397436934-0-95311. Exhausted after delivery attempt: 1 caught: org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 334 NTLM supported

org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 334 NTLM supported

at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:392)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:44)
at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:109)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:189)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:121)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.mail.AuthenticationFailedException: 334 NTLM supported

at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:648)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:583)
at javax.mail.Service.connect(Service.java:313)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
... 31 more

I googled the error,and found this answer
https://stackoverflow.com/questions/4337812/javamail-ntlm-authentication-failure

checked java mail version in alert publisher
ll /usr/share/cmf/lib/mail-*.jar
lrwxrwxrwx 1 root root 29 Mar 30 09:48 /usr/share/cmf/lib/mail-1.4.3.jar -> ../common_jars/mail-1.4.3.jar

replace it with mail version 1.4.5 (according to above answer)
ll /usr/share/cmf/lib/mail-*.jar
lrwxrwxrwx 1 root root 41 Apr 4 09:59 /usr/share/cmf/lib/mail-1.4.5.jar -> /usr/share/cmf/common_jars/mail-1.4.5.jar

then got mail sent

Re: java mail verision issue of alert pulisher

Super Collaborator

Thank you jiahongchao,

 

To understand correctly, you have noticed that the ERROR in the log is related to NTLM authentication. 

Per StackOverflow [0] javamail did not support NTLM as of mail.jar version 1.4.1 - though per your finding you have copied a newer version of mail.jar v1.4.5 that support NTLM, and resolved the issue.

 

Based on mail.jar RELEASE notes I found that NTLM was implemented since mail version 1.4.3 [1a,b,c,d]

though based on the mail.jar 1.4.4 release notes (which removed the jcifs.jar dependency) [2a,b] suggests that the NTLM implementation in 1.4.3 wasn't self-contained and had a dependency on jcifs.jar client library which is not distributed part of Cloudera Manager common_jars.

 

I will file an improvement ticket, 

 

Michalis

 

[0] https://stackoverflow.com/a/13861180/528634 

[1a] http://www.oracle.com/technetwork/java/javamail/javamail145-1904579.html

[1b] http://www.oracle.com/technetwork/java/javamail/javamail143-243221.html

[1c] https://github.com/javaee/javamail/blob/JAVAMAIL-1_4_3/doc/release/NTLMNOTES.txt

[1d] https://github.com/javaee/javamail/commits/JAVAMAIL-1_4_3/doc/release/NTLMNOTES.txt

[2a] http://www.oracle.com/technetwork/java/javamail/javamail144-1562675.html

[2b] https://github.com/javaee/javamail/commit/081f632e1fd8ae5fa6f96a0360dc9a681c3eaa79#diff-67c5eafbce72...

Re: java mail verision issue of alert pulisher

New Contributor
thanks