Alarm emails not sent from vCenter Server after upgrade
search cancel

Alarm emails not sent from vCenter Server after upgrade

book

Article ID: 447451

calendar_today

Updated On:

Products

VMware vCenter Server VMware Cloud Foundation

Issue/Introduction

Alarm definitions trigger correctly in the vCenter Server inventory, but email notifications are not delivered. 

In vCenter Server, /var/log/vmware/messages show Connection timed out with example.com(SMTP Relay server)

YYYY-MM-DDTHH:MM:SS.MS+HH:MM <HOST> ./###### < EMAIL Domain>.: user open1258942]: ########: to=[[email protected]], delay=HH:MM:SS.MS, xdelay=HH:MM:SS.MS, mailer=esmtp, pri=1021763, relay=example.com. [###.##.###.##], dsn=4.4.1, stat=Deferred: Connection timed out with example.com

The SMTP relay server in the logs is not the same as the Email Server configured in vCenter Server -> Configure-> Settings-> General -> Mail -> Mail Server.

Environment

vCenter Server 9.0

Cause

Sendmail on vCenter Server 9.0 bypasses the configured SMTP relay server and routes emails directly via DNS MX records for the email domain.

Resolution

Validate that the MX record for the email domain from the DNS server using the following command

dig +short MX <emaildomain>

For eg. dig +short MX example.com

To workaround the issue, manually add the SMTP Relay Server configuration to sendmail using the below steps:

Step 1: Backup and configure sendmail.mc

  • Backup the sendmail.mc configuration file.

    cp -v /etc/mail/sendmail.mc /root/sendmail.mc.bak


  • Open the sendmail.mc configuration file using the vi editor:

    sudo vi /etc/mail/sendmail.mc
  • Locate the OSTYPE entry in the file. Immediately after the OSTYPE entry, add the following two lines.

    FEATURE(nocanonify')dnl
    define(SMART_HOST', `[email server]')dnl
    
    For eg.
    FEATURE(nocanonify')dnl
    define(SMART_HOST', `mail.example.com')dnl
  • Save your changes and close the editor (in vi, type :wq and press Enter).

Step 2: Configure submit.mc

  • Open the submit.mc file:

    sudo vi /etc/mail/submit.mc
  • Scroll to the end of the define entries block. Add the following line:

    define(confDIRECT_SUBMISSION_MODIFIERS', C')dnl
  • Save changes and close the editor.

Step 3 Generate New Configuration Files

  • Change into the mail configuration directory: 

    cd /etc/mail
  • Generate the new sendmail.cf file:

    sudo m4 m4/cf.m4 sendmail.mc > sendmail.cf
  • Generate the new submit.cf file:

    sudo m4 m4/cf.m4 submit.mc > submit.cf

Step 5: Apply Changes and restart Sendmail

  • Reload the systemd manager configuration:

    sudo systemctl daemon-reload
  • Restart the Sendmail service to apply the new settings:

    sudo systemctl restart sendmail

Additional Information

Emails are not sent from vCenter Server Appliance after an Alert/Event is triggered.