February 10, 2012 7:43 PM
by Ed Blankenship
Team Foundation Server has the ability to deliver e-mail alerts. I have talked about this feature a few times (like here, here, and here) and it’s a very handy feature of any work item tracking system let alone version control, automated builds, test case management, etc. In the TFS Administration Console window, you just need to enable and specify the e-mail alert settings from the Application Tier node.
Here’s the one caveat about this functionality: TFS needs the SMTP server to allow unauthenticated requests. Notice that TFS doesn’t allow you to specify a user name and password. Other applications do allow this -- for example, my Windows Home Server 2011 instance at home asks for additional information.
Several e-mail servers on the market, including Microsoft Exchange Server, do not allow unauthenticated SMTP requests by default. In general, you actually don’t want to open up your SMTP server for unauthenticated requests or have an open SMTP server on your network. This can open you up to security issues and would allow malware or compromised servers to use it as a relay. Not fun stuff at all.
The preferred approach would be to let your e-mail server know to allow unauthenticated e-mails from each of your TFS application tier servers. (Note: You may have multiple application tier servers if you have setup your TFS environment to be highly available using network load balancing and created an AT web farm.) Since most of the customers I visit have adopted Microsoft Exchange Server, here are the steps for you to pass on to your Exchange Administrator to take to “trust” TFS to deliver e-mail alerts. As a TFS Administrator, you will not like have the permissions necessary to make these changes in your internal Exchange environment.
Thanks to the Imaginet Infrastructure team (specifically Kelsey Epps) for help with these instructions!
Your first step is to open the Exchange Management Console and head to the Hub Transport node underneath Server Configuration. This will show you all of the receive connectors that are currently defined when you select the appropriate hub transport server from this list.
What we will end up doing is creating a new receive connector specifically for use by each of the TFS application tier servers. In the Actions pane for the Exchange Management Console, choose “New Receive Connector…”
On the Introduction page for the New Receive Connector wizard, enter a friendly name to help other Exchange Administrators understand the purpose of this receive connector and choose “Custom” for the intended use.
On the next page for specifying the Local Network Settings, you’ll likely just want to leave the defaults and specify the fully-qualified DNS entry that will be used in the SMTP response when a client like TFS connects to it.
The next screen for specifying the Remote Network Settings is the important one. This tells Exchange server which IP addresses should be allowed to use this receive connector. You’ll want to remove the default entry that exists in the list and then add each of the IP addresses of each of the TFS application tier servers. (Remember from above, you might have multiple application tier servers in your TFS environment.)
At this point, you are ready to complete the wizard and it will create the new custom receive connector to be used by the TFS application tier servers. Once the wizard has completed and created the new receive connector, you’ll want to open the properties dialog window for the new receive connector and enable “Anonymous Users” on the Permissions Group tab.
Now, give the fully-qualified DNS name for the Exchange hub transport server to the TFS Administration and they will be able to enter it in the TFS Administration Console in the appropriate spot. The TFS Administrator will want to monitor the event logs for any error messages after this has been enabled in TFS to make sure that the e-mail delivery TFS jobs that run periodically when there are new e-mail alerts complete successfully.
If you happen to be using Office 365 for your Exchange instance, then you will have to setup a local SMTP Relay. Here are a few online resources for how to do that:
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u
Ed Blankenship is a Product Manager at Microsoft for Visual Studio Online. I am an author of a few books, former Microsoft MVP of the Year, and former ALM consultant. I hold Office Hours each week if you are interested in chatting.
Managed Windows Shared Hosting by OrcsWeb
Site design by Jeremy Kratz