Skip to main content
SuryaDilip
Silver ⭐️⭐️
November 17, 2020
Solved

Configuring alert email without providing mail server user name & password

Hi All,

I'm using Cloudera Express 6.3.0. I'm trying to configure alert emails to be received by a list of users. While configuring properties, it is asking for mail server user name & password. We have SMTP enabled and we are triggering emails with sendmail command on the nodes where Cloudera is installed. But, here why we need to provide the mail server user name & password for receiving the alert emails on our mail id. I have found a solution for this in Cloudera community (https://community.cloudera.com/t5/Support-Questions/Why-does-Alert-Publisher-require-mail-server-login-amp/m-p/41003#M36254), but it is not working for my version of Cloudera. Does any know a turnaround for this.

Please refer to the link above for the solution provided & please also see the picture attached for better understanding.

 

When i click on Send Test Alert, i  see this pop up & the email is not triggeringWhen i click on Send Test Alert, i see this pop up & the email is not triggering

 

Mail Server UN & PWDMail Server UN & PWD

gzigldrum
gzigldrumAnswer
Gold ⭐️
November 18, 2020

Thank you. That confirms alert email delivery fails because there is no SMTP daemon listening on localhost:25. 

 

I suspect there is a name resolution issue. Is the mail server hostname the host where CM is installed on, or a different host? Please login to CM, change the url in browser location bar to /cmf/debug/jmx and grep for MBeanServerId, does that show localhost or the correct hostname?

 

What do those commands show:

# getent hosts <mail server hostname>
# getent hosts <cm server hostname>
# getent hosts localhost

 

7 replies

gzigldrum
Gold ⭐️
Gold ⭐️
November 17, 2020

Username/password is not strictly required for sending mails. This is not the cause for the issues you are seeing. Check the Alert Publisher logs for errors at the time when you hit the Send Test Alert button, there will be related errors shown why email delivery doesn't work yet.

Translate
SuryaDilip
Silver ⭐️⭐️
November 17, 2020

Hi @gzigldrum, thanks for replying. The below message is what i see in logs. As, per the below error "Couldn't connect to host, port: localhost, 25; timeout 30000;"  - As I highlighted in red color, why it is trying to connect to localhost? I provided the SMTP hostname:port no. in the "Alerts: Mail Server Hostname" config. I did not get any solid info from the log about why the error is occurring. Do you find anything from the below message? 

 

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout 30000;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2100)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:699)
at javax.mail.Service.connect(Service.java:366)
at org.apache.camel.component.mail.DefaultJavaMailSender.send(DefaultJavaMailSender.java:112)
at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:63)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:173)
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:841)
at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:85)
at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:328)
at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:606)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:329)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2066)

Translate
gzigldrum
Gold ⭐️
gzigldrumAnswer
Gold ⭐️
November 18, 2020

Thank you. That confirms alert email delivery fails because there is no SMTP daemon listening on localhost:25. 

 

I suspect there is a name resolution issue. Is the mail server hostname the host where CM is installed on, or a different host? Please login to CM, change the url in browser location bar to /cmf/debug/jmx and grep for MBeanServerId, does that show localhost or the correct hostname?

 

What do those commands show:

# getent hosts <mail server hostname>
# getent hosts <cm server hostname>
# getent hosts localhost

 

Translate