VMware Cloud Community
kopper27
Hot Shot
Hot Shot

vCenter appliance 5 and SMTP Configuration

hi guys

I setup the

SMTP Server IP

and

Sender Account in my new and shiny vCenter Appliance 5 server

SMTP Server: 192.168.1.x

Sender account: vcenter@mycompany.net

now testing for the email alerts I get that my email server gets or receives email from the root account from my vCenter app lie this

root@servername.mycompany.net

so this is not valid and my email server won't relay this email

any idea if there is a issue for vCenter appliance since is linux having issues sending emails?

thanks a lot

Tags (2)
14 Replies
Troy_Clavell
Immortal
Immortal

the sender address needs to be a valid domain name.  How do you have it configured in Administration-vCenter Server Settings-Mail

Also, you may try Fully qualifying the SMTP address

Reply
0 Kudos
kopper27
Hot Shot
Hot Shot

i get this exact error

Error in my lotus SMTP Server

SMTP Server [1010:01BE-0D44] Mail from root@servername.ja.la.mycompany.net rejected for policy reasons. Domain not found in DNS. <

I set dns name for my SMTP Server and sender account is

vcenter.alerts@mycompany.net

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal

The mail is making it to your SMTP Server but your SMTP Server cannot validate the domain.  You are using your company's domain name for the sender account?

if you have powershell, try to use a like script to send mail to yourself

Send-MailMessage -smtp "yoursmtpserver.com" -To "me@companydomain.com"  -Subject "Test" -From "you@companyname.com"

Reply
0 Kudos
kopper27
Hot Shot
Hot Shot

just in case I am using these two

SMTP Server: 192.168.1.x

Sender account: vcenter@mycompany.net

the error includes the FQDN...??

Reply
0 Kudos
kopper27
Hot Shot
Hot Shot

I connect to the VC using Power CLI

using your script and works OK

1. Connect-VIServer VC_DNS_Name

2.

Send-MailMessage -smtp "yoursmtpserver.com" -To "me@companydomain.com"  -Subject "Test" -From "you@companyname.com" 

any idea?

has the alarm another way to send the emails?

thanks

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal

i'm not saying this will fix it but it may be worth a shot if you haven't already done so.  Join the vCenter Server Appliance to your AD.  We had problems joining ours to the domain via the web interface.  The below article worked for us.

http://kb.vmware.com/kb/2002626

Reply
0 Kudos
escapem2
Enthusiast
Enthusiast

wrong post

Reply
0 Kudos
kopper27
Hot Shot
Hot Shot

already done in fact I had problems joining it from the Web vCenter....so I followed the article your pointing and the vCenter appliance is part of the domain

thanks a lot any other idea

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal

the IP should not be used for SMTP.  You will need to provide a FQDN of an internal SMTP Server.  Also, as you have done, provide a valid domain account for the sender address.  Beyond that, I do not know what is going on.

Reply
0 Kudos
kopper27
Hot Shot
Hot Shot

thanks a lot for your help

yes I changed from IP to FQDN since yesterday since issue

and yes usually emails are username.lastname@mycompany.com

and the email sender is the vmware.alerts@mycompany.com

the weird thing about like I said is vmware alerts won't reach the destination email it just logs an error in the lotus server

SMTP Server [1010:01BE-0D44] Mail from root@servername.ja.la.mycompany.net rejected for policy reasons. Domain not found in DNS

and connecting to PowerCLI to the vCenter Server and sending emails works just fine....

thinkig about lotus server issue

Reply
0 Kudos
kopper27
Hot Shot
Hot Shot

guys if someone has this issue with Lotus Server and vCenter appliance

please let me know

thanks

Reply
0 Kudos
duck67
Contributor
Contributor

Hi,

I had a similar issue with an Exchange Server and our external email-provider.

I changed 2 entries in /etc/sendmail.cf
look for the following lines, you have to delete oder comment one line (marked bold)

you will still have an reply-to header with root@youremaildomain.com instead of the email-Address, you configured in Email-Settings in vCenter. If your email-server still rejects the mail, create an alias root@youremaildomain.com for any user and it should work...

After these changes, i tried other mail-Hosts an Sender-Addresses and it still worked, even after rebooting vCenter...

Maybe this will be fixed within the new version of vCenter appliance?

# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
C{G}localhost.localdomain
F{G}-o /etc/mail/local-host-names %[^\#]
# C{E}root

# who I masquerade as (null for no masquerading) (see also $=M)
### DMlocalhost.localdomain
DMyouremaildomain.com
# DMvc.bm.ads
# my name for error messages
DnMAILER-DAEMON

informability
Contributor
Contributor

The smtp options in the vcenter gui are severely lacking compared to any other email enabled appliance or software these days.  Since the vcenter appliance basically uses sendmail for sending alerts (gah!), the options in the gui could easily include authentication options, but alas they don't.  So, if you are having problems receiving vcenter alerts because of what is being described in this thread, you aren't alone.  This is typically the case when you using a bogus TLD like .lan or .local on your vcenter appliance.

Duck67 above makes a nice suggestion, but I will warn that if you are going to modify your /etc/sendmail.cf on your vcenter appliance, you should also modify /etc/sysconfig/mail so that /etc/sendmail.cf is no longer generated on reboot, else a reboot of vcenter could wipe out the changes suggested by duck67. 

/etc/sysconfig/mail:

MAIL_CREATE_CONFIG="yes"  <--- change to "no"

A better approach might be to also update /etc/sysconfig/sendmail, and regenerate the /etc/sendmail.cf using information in the link provided below (make a copy of /etc/sendmail.cf before replacing it of course).

Then use the /etc/mail/genericstable and add a line like:

root@vcenterhost.mycompany.local  vcenter@mycompany.com

then run from the vcenter root command prompt:

makemap hash genericstable < genericstable

service sendmail restart

Basically when my vcenter host with the hostname vcenter51.company.local sends email now, it sends as vcenter@company.com, prior to my changes it would only send as root@company.com or root@vcenter51.company.local, neither of which are conducive.

ref: Unofficial SUSEFAQ - Customizing sendmail.cf via SuSEconfig

Reply
0 Kudos
ispeople
Contributor
Contributor

Old thread I know, but I've just been fixing the exact same issue. This solution (duck 67 post 12) is correct but slightly misleading because the wrong line is bolded. The directive "CL root" is commented anyway in a stock sendmail.cf on VCenter appliance. The line which needs to be commented out in addition is actually "C{E}root". Commenting this allows Sendmail to apply masquerading to the root address, if you leave it as is the rest of the solution might not have any effect.

Phil

Reply
0 Kudos