«

»

Jan 26 2013

Configure vCenter Server SMTP Mail Settings

Configure an SMTP server in vCenter is not difficult at all, and all you have to do is put the server and the sender address in some boxes then click OK. Since is so easy you might think the configuration only takes 30 seconds; and you are right, if the vCenter server is joined to a windows domain and the email system also integrates with AD. Exchange users are so lucky right now!

For those that don’t have an AD infrastructure, or they just don’t want to put the vCenter server in a domain, there are alternatives, and I’ll show them to you as we move along. First I want to start configuring the vCenter mail settings with an Exchange e-mail system, since is simpler and probably more common.

To begin, open vCenter, go to the Home page and click the vCenter Server Settings icon. You can also use the Tools menu by going to Administration > vCenter Server Settings.

    

Here click the Mail menu and type the SMTP server and sender account in those boxes then hit OK.

If is not working make sure on the Exchange Default Receive Connector you have the Anonymous users box checked.

For some of you this might not be a valid option if you have and Edge server, but there is a solution, and a simple one actually; create another Receive Connector. Just right-click on the white space and choose New Receive Connector.

Give it a name, and under Select the intended use for this Receive connector make sure you choose Internal.

On the Remote Network settings page click the Edit button. We need to modify the IP rage that this connector can receives packets from, since we will allow anonymous access. In the boxes type the IP address of your VMware vCenter server. This means that only packets can come from this IP address will be allowed on the Exchange server.

    

Click the New button to create the Receive connector.

    

Now open the properties of the newly created Receive connector and make sure you check the Anonymous users box on the Permission Groups tab. Test and see if you get emails when something happens in your VMware vCenter environment. For this you can configure alarms.

How let’s get to the other scenario where you don’t have Microsoft Exchange. For this I will use hMailerServer, which is a free mail server for Windows, and is pretty good. Download the package and install it using the default settings. When you get to the Specify main password screen, type a password and make sure you remember it, or you won’t be able to configure the hMailServer settings.

Click Finish to launch the administration console.

If you want, you can save the password by clicking the Edit button. Another great option is to check the Automatically connect on start-up box, so you do not get this Connect window every time you want to open the hMailServer administration console. When you’re done click the Connect button, then provide your password.

    

The first thing you want to do after the administration console is up, is to create a domain. Click the Add domain button from the Welcome screen, then type a domain name in the Domain box. Hit Save when done.



    

The second thing is to create mailbox accounts. Click the Accounts folder under your domain name, then hit the Add button. In the Address box type the mailbox account name you want to create then provide a password in the Password box. Click Save when done. Repeat this operation to create another mailbox account.

    

Next we need to configure the SMTP protocol, but before that some DNS entries need to be created on the DNS server. Here I’m using a Windows DNS server that has the vkernel.local zone created. Right-click the zone name and choose New Alias (CNAME).

In the Alias name box type just smtp. The target host is the machine where hMailServer is installed; in my lab here I’ve installed hMailServer on the VMware vCenter server so I will point to this host. Click OK when done.

Another DNS entry that we need to create is an MX Record. Right-click the zone name and choose New Mail Exchanger (MX). On the Fully qualified domain name (FQDN) of mail server box type the FQDN of the host where you installed hMailServer; again, in my case this is the vCenter server. Click OK.

Back on our hMailServer administration console, expand Settings > Protocols and click the SMTP protocol. On the Delivery of e-mail tab in the Local host name box type smtp.domain.com; and in my case is smtp.vkernel.local. This is the entry we just created in DNS. Since we are using a local domain, and not a public one, we need to use an SMTP relay server if we want to send reports to an external e-mail address and not be market as Spam. I’m using Socketlabs services for this. Type your SMTP relay server and authentication credentials then click Save.

Expand Settings > Advanced > IP Ranges and click the My computer object. On the Allow deliveries from leave only Local to local e-mail addresses and Local to external e-mail addresses boxes enabled. I disabled POP3 since I’m not going to use it, but I will configure my Thunderbird client with IMAP to see if logs are delivered on my local mailbox; that’s why I leave it checked. Click the Save button when done.

On the vCenter server configure the Mail settings like you did before with the Exchange server. In the SMTP server box type the name of the machine where hMailServer resides, in this case is the vCenter server. You can put localhost here but if your hMailServer is on another box, make sure you type the name of that machine. I tried using smtp.vkernel.local, but for some reason it doesn’t work. If you just type a host by using its NameBIOS name, you might need to edit the hosts file so vCenter can find it.

And here is the result. I created a vCenter alarm that sends reports whenever a VM is shut down. Reports are sent to my internal mailbox, but also on my Gmail address.

     

Want content like this delivered right to your

email inbox?


4 comments

Skip to comment form

  1. Peter

    Hello Adrian Costea

    I have a trouble to setup exchange 2013 SMTP function and then I found your web site when I searching internet resource.
    As you said it is simple to setup SMTP server on VMware vcenter, but for the MS Exchange 2013, I try to using your mentioned for Exchange 2010 and to configure it on Exchange 2013 but it seem not work.

    Do you know how to setup SMTP on Exchange 2013?

    Thanks and best regards,
    Peter

    1. Adrian Costea

      Hi,
      Did you tried creating a new Receive Connector ? Follow Create a Receive connector to receive email from the Internet and let me know if it works.

  2. Derrick

    I went with the second option, and installed hmailserver. I have set everything up as per this article but from what I can see in the logs hmailserver can’t relay the messages coming from vcenter since the from address is not a valid email address. My from address is just vcenter@home.local.

    Anyone else have this problem? I am trying to send the mail to my google apps account. I confirmed that the ports are opened and accessible from my network to smtp.gmail.com 465.

    1. Adrian Costea

      Hi,
      First try with two email accounts that you create on the hmailserver see if that works, then try using an SMTP relay. I don’t know how this works with Google, or if it actually works but try and create an account on the Socketlabs site or any other site that provides a SMTP relay service and see if that works. It has to, since it worked for me. Let me know how it goes.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

css.php