Symptoms:
To resolve the issue follow the below steps:
Note1: Prior to applying resolution ensure you take a offline backup or snapshot of the vCenter Server Appliance.
Note2: The applied configuration change may be lost after upgrade. In such case, Please apply the steps again.
1. Connect to vCenter Server Appliance via ssh.
2. Edit sendmail.service using the vi editor.
vi /etc/systemd/system/sendmail.service
In recent releases, the file may be at different directory.
Case you do not find the sendmail.service under /etc/systemd/system, check the path beneath:
/lib/systemd/system/sendmail.service
3. Alter the After entry under [Unit] section to be as follows:
/etc/mail/sendmail.mc
6. Add following entry after OSTYPE:
FEATURE(`nocanonify')dnl
define(`SMART_HOST', `[Your_mail_host]')dnl
Note: change Your_mail_host to reflect the correct mail server hostname.
7. Save the change and close the editor.
8. Next, edit submit.mc using the vi editor.
vi /etc/mail/submit.mc
9. Add the following line at the end of the define entries:
define(`confDIRECT_SUBMISSION_MODIFIERS', `C')dnl
10. Save the change and close the editor.
11. Verify that local hostname is present and is resolvable in hosts file.
/etc/hosts
12. Execute following command and generate new .cf file
cd /etc/mail
m4 m4/cf.m4 sendmail.mc > sendmail.cf
m4 m4/cf.m4 submit.mc > submit.cf
13. Reload system daemon and restart sendmail.
systemctl daemon-reload
systemctl restart sendmail
At this point, the vCenter should be able to send emails to the mail server; however, the emails will be sent as root@localhost. Validate it by sending a test alarm and checking the messages log under /var/log/vmware/.
Once validated:
systemctl restart sendmail