Sending email from the VMware vCenter Server Appliance after configuring an SMTP relay gateway fails with the error: stat=Deferred: Connection timed out
search cancel

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:

  1. Log in to vCenter Server Appliance 6.0
     
  2. Type shell.set --enabled true and press Enter.
     
  3. Type shell and press Enter.
     
  4. Create a backup of the sendmail file using this command:

    cp /etc/sysconfig/sendmail /tmp/sendmail.bak
     
  5. Open the sendmail parameter file located at /etc/sysconfig/sendmail with a text editor.
     
  6. Change the parameter,

    SENDMAIL_NOCANONIFY = "No"
    to
    SENDMAIL_NOCANONIFY = "Yes"
     
  7. Save the file.
     
  8. Update the sendmail configuration files by running this command:

    SuSEconfig --module sendmail
     
  9. Restart the sendmail service by running this command:

    service sendmail restart
     
  10. 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.



Additional Information

配置 SMTP 中继网关后,从 VMware vCenter Server Appliance 发送电子邮件失败,并显示错误:stat=Deferred: 连接超时