When configuring SMTP email notifications on Usage Meter 4.8, we get the following error even when "Enable TLS/SSL" check-box is not checked:
"Saving email notification settings failed: The mail test connection attempt failed. Check the connection settings and try again."
You will see the similar log entries in vmware-um-journal.service.log:
photon-machine start-journal-service.sh[1159]: YYYY-MM-DDTHH:MM:SS Z ERROR 1159 --- [0.1-8051-exec-1] .s.n.v.MailNotificationSettingsValidator : Testing mail notifications fail. Used SMTP settings: SmtpSettings{smtpHost='<IP-Address>', smtpPort=25, smtpUser='null', smtpUseSsl=false}.
photon-machine start-journal-service.sh[1159]: jakarta.mail.MessagingException: Could not convert socket to TLS
photon-machine start-journal-service.sh[1159]: at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2189)
The SMTP server that is being used supports STARTTLS command. Thus, UM is trying to upgrade the connection to TLS.
To resolve this issue, you have to import the certificate into UM truststore. Here are the steps for the same:
1. The certificate being used can be viewed by executing : openssl s_client -connect <smtp.server>:<port> -starttls smtp
2. You can import the certificate by following these steps.