Tasks or events fail with unable to connect to mail host
search cancel

Tasks or events fail with unable to connect to mail host

book

Article ID: 370859

calendar_today

Updated On:

Products

CA Identity Manager

Issue/Introduction

Tasks fail on Send Mail events with View Submitted Tasks showing "PxEnvironmentException: Error sending email"

Cause

The application server log shows that the mail errors are caused by "java.net.UnknownHostException: mailhost" as seen in the stack trace...

Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailhost, 25; timeout 15000;
  nested exception is:
    java.net.UnknownHostException: mailhost
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2209)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740)
    at javax.mail.Service.connect(Service.java:366)
    at javax.mail.Service.connect(Service.java:246)
    at javax.mail.Service.connect(Service.java:195)
    at javax.mail.Transport.send0(Transport.java:254)
    at javax.mail.Transport.send(Transport.java:124)
    at com.netegrity.ims.businessprocess.EmailProviderServiceImpl.sendMail(EmailProviderServiceImpl.java:264)
    at com.netegrity.ims.businessprocess.EmailProviderServiceImpl.sendMail(EmailProviderServiceImpl.java:158)
    at com.ca.identitymanager.policyxpress.plugins.shared.EmailData.sendMail(EmailData.java:109)
    ... 83 more
Caused by: java.net.UnknownHostException: mailhost
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:196)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
    at java.net.Socket.connect(Socket.java:606)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:357)

The exact error above can be caused by the SMTP mail host being missing or inadvertently deleted from the /etc/hosts file.

 

Resolution

Work with your application server and mail server teams to validate that the Identity Manager application server can contact the SMTP mail server and ensure your app server is pointing to the correct SMTP server. 

Ensure the mail host is included in the app server's /etc/hosts file.

Ensure the above hosts file entry has the correct host/IP information.