Sending email from the VMware vCenter Server Appliance after configuring an SMTP relay gateway fails with the error: stat=Deferred: Connection timed out
book
Article ID: 323981
calendar_today
Updated On:
Products
VMware vCenter Server
Issue/Introduction
Symptoms: After configuring the email relay gateway SMTP address, you experience these symptoms:
vCenter Server appliance fails to send email.
You notice that the vCenter Server appliance mail server is performing an MX record check to find the relay mail server, and trying to connect to that server.
In the /var/log/messages file, you see entries similar to:
2015-07-02T15:03:48.840701+00:00 hostname send mail[6978]: t5RF1iVB001116: to=it@domain, ctladdr=root@hostname (0/0), delay=5+00:02:02, xdelay=00:00:00, mailer=esmtp, pri=21720580, relay=mxb-00174d01.domain.com., dsn=4.0.0, stat=Deferred: Connection timed out with mxb-00174d01.domain.com.
Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.
Environment
VMware vCenter Server Appliance 6.0.x
Cause
In the Linux operating system provided with the VMware vCenter Server appliance (VCSA), the sendmail program is configured to do a DNS search to locate the SMTP gateway. This is good practice.
Resolution
To resolve the issue, first try to correct the issue in DNS. This issue occurs because the sendmail program checks the MX record in DNS, which does not give the correct address. You should try and resolve this issue in DNS. It is not unlikely that a mail server has been replaced and the MX record has not been updated.
SMTP is by default configured through DNS and one should try and retain this, in order to simply administration of the whole network. Therefore we recommend setting the domain's MX record to the correct server and avoiding individualised configurations. You can find a good description how to create and modify MX records in Windows DNS here https://www.mustbegeek.com/add-mx-record-in-windows-dns-server/
If this is not possible for any reason, please take the following steps
To disable MX lookup:
Log in to vCenter Server Appliance 6.0
Type shell.set --enabled true and press Enter.
Type shell and press Enter.
Create a backup of the sendmail file using this command:
cp /etc/sysconfig/sendmail /tmp/sendmail.bak
Open the sendmail parameter file located at /etc/sysconfig/sendmail with a text editor.
Change the parameter,
SENDMAIL_NOCANONIFY = "No" to SENDMAIL_NOCANONIFY = "Yes"
Save the file.
Update the sendmail configuration files by running this command:
SuSEconfig --module sendmail
Restart the sendmail service by running this command:
service sendmail restart
Verify whether you receive an email from vCenter Server.
Note: After completing the preceding steps vCenter Server appliance sends an email using the SMTP relay gateway (entered as an IP address in Mail configuration) instead of performing DNS lookup.