Tuesday, September 8, 2009

How to configure SMTP for OpsMgr in test environments, using Windows 2008 Server

15-09-2009 Update: For mail delivery besides SMTP also POP3 is needed. Checkout this blog posting describing how to install POP3 on W2K08 server.

When running an OpsMgr test environment which is isolated from the production environment it is nice that the notification channel can be setup as well. This way OpsMgr can really be put through its paces and the needed experience can be gained with Notifications as well. However in situations like these the Exchange team isn’t all too excited to (ab)use ‘their’ servers for it. So how does one go about it without using Exchange AND not to create a server which can be easily used for relaying?

In situations like these I have found that W2K08 (SP2) delivers a nice feature named SMTP. Yes, I know. Nothing new. But with W2K08 the nicest part of the SMTP feature is that mail relay is disabled by default. And with an additional setting it can be even made more secure. So let’s start.

First of all, IIS 7.0 is a prerequisite where the role-services IIS 6.0 Metabase and IIS 6.0 Management Console (from the IIS 6.0 Management Compatibility group) are really needed. But these are automatically installed when the SMTP Role is added through the Server Manager Console.

  1. Open the Server Manager Console, go to the Features Node > Add Feature

  2. Select SMTP Server
    image

  3. Click the button Add Required Features > Next > Install. SMTP is being installed now. Click Close.
    image

  4. Start Menu > Administrative Tools > click Internet Information Services (IIS) 6.0 Manager

  5. In the Console go to [SMTP Virtual Server #1], right click it > Properties
    image
  6. Tab General, select the correct IP-address. Also take note of the FQDN of the SMTP Virtual Server. (This entry will be used in OpsMgr.) On the same tab additional settings like the number of allowed connections or the used port can be changed as well.
    image
  7. Tab Access, click the button Relay. This is the most important part!!!
    image 
  8. Select the option ´Only the list below´, add the correct ip-address of the RMS using the SMTP and deselect the checkbox ´Allow all computers which successfully authenticate to relay, regardless of the list above´
     image
    (The ip-address depicted here is fake.)

    Now SMTP is ready for usage by OpsMgr. Of course additional settings can be changed as well but the most risk full setting, scoping mail relay to only the RMS and not any other server – has been configured properly.

  9. One more thing left to do: Open the Services mmc and go to Simple Mail Transfer Protocol (SMTP) service and set it to start automatically:
    image 

  10. Open the OpsMgr Console > Administration > Notification > Channels > New E-Mail (SMTP) > Settings > Add
    image 
    Edit the settings and click OK. Go to Format, change as needed and click Finish.

Setup the subscribers and subscriptions in OpsMgr and you have a working SMTP solution. Happy learning!

No comments: