Teradata Viewpoint: MessagingException sending mail. (Could not connect to SMTP host:<domain>, Port:25)

Problem:

Solution:

From the viewpoint Alert Viewer, we can see the error message “MessagingException sending mail. (Could not connect to SMTP host:<domain>, Port:25)

We can also check Log file message:

# cat /var/log/messages|grep mail.grocery.se

Nov 25 11:12:23 SERVER5-1-21 CAM[77908]: INFO: CAM: 1709100 # INFO: CamSmtpNotificationAgent: 1709100 # Received an exception while sending an email notification [javax.mail.MessagingException: Could not connect to SMTP host: mail.grocery.se, port: 25;

Check if the server can reach mail server

# telnet mail.grocery.se 25

Trying xxx.xx.xxx.xxx...

telnet: connect to address xxx.xx.xxx.xxx: Connection timed out

After investigation we found the mail server IP has been changed and the viewpoint server not using the DNS instead it’s using /etc/hosts file. After updating the right IP in /etc/host file, the error resolved.

Change with correct IP in /etc/hosts file.

XX.XXX.XX.XX mail.grocery.se

Test:

# telnet mail.grocery.se 25

Trying XX.XXX.XX.XX...

Connected to mail.grocery.se.

Escape character is '^]'.

220 mail.grocery.se Microsoft ESMTP MAIL Service ready at Wed, 25 Nov 2020 14:30:34 +0100

^]

telnet> quit

Connection closed.