How to verify Tfs is sending emails

Published 28 November 05 03:08 PM | psheill 
In some cases, it's necessary to verify that Tfs is attempting to send emails. In the release version, we've made sure that errors connecting to the mail server are logged in the Application event log on the TF Server. Until release, or if you would like more details, you can turn on tracing. To do so, open \Program Files\Microsoft Team Foundation 2005\Web Services\web.config and look for this section:
    <system.diagnostics>
        <assert assertuienabled="false" />
        <trace autoflush="false" indentsize="4" />
        <!--  Trace Switches
            Each of the trace switches should be set to a value between 0 and 4, inclusive.
              0: No trace output
              1-4: Increasing levels of trace output; see Systems.Diagnostics.TraceLevel
        -->
        <switches>
            <add name="API" value="0" />
            <add name="Authentication" value="0" />
            <add name="Authorization" value="0" />
            <add name="Database" value="0" />
            <add name="General" value="3" />
            <!-- WorkItem trace switches -->
            <add name="traceLevel" value="1" />
        </switches>        
    </system.diagnostics>
Set the General value to "3". Then details about the events and notifications will be logged. You can view it with either dbgview (http://www.sysinternals.com/Utilities/DebugView.html) or by adding the following section between <trace> and </trace> to create a log file. Note that the service account will need permission to write to that location on disk - c:\windows\temp in the example below.
        <listeners>
           <add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
               initializeData="c:\windows\temp\myListener.log" />
        </listeners>
After making those changes, assuming you have created a matching subscription, you should see entries like the following for each event. In this example, I have subscribed to Checkin events. If there are problems sending emails, you will see a set of entries like the second set.

// Successful email send
[Info, PID 3456, TID 3040, 22:59:25.296] Calling notification filter: Microsoft.TeamFoundation.VersionControl.Server.CheckinEventFilter 
[Info, PID 3456, TID 3040, 22:59:27.374] Found restrictions: Microsoft.TeamFoundation.VersionControl.Server.CheckinEventFilter 
[Info, PID 3456, TID 3040, 22:59:27.390] Activating a new thread to send events. 
[Info, PID 3456, TID 3060, 22:59:27.390] Entering Send loop 
[Info, PID 3456, TID 3060, 22:59:27.640] Done with notification. 
[Info, PID 3456, TID 3060, 22:59:27.656] Exiting Send loop

// Unsuccessful email send
[Info, PID 3456, TID 3040, 22:55:39.870] Calling notification filter: Microsoft.TeamFoundation.VersionControl.Server.CheckinEventFilter 
[Info, PID 3456, TID 3040, 22:55:41.995] Found restrictions: Microsoft.TeamFoundation.VersionControl.Server.CheckinEventFilter 
[Info, PID 3456, TID 3040, 22:55:42.026] Activating a new thread to send events. 
[Info, PID 3456, TID 304, 22:55:42.026] Entering Send loop 
[Info, PID 3456, TID 304, 22:55:42.636] Exiting Send loop

Error details appear in Event Log (RTM only, not Beta 3):
    TF50282: Could not connect to the following e-mail server: smtpHost 
    Error message: System.Net.Mail.SmtpException: Client does not have permission to submit mail to this server. The server response was: 5.7.3 Client does not have permission to Send As this sender.

Note that there is no "Done with notification" in the second set of entries.

Comments

# Buck Hodges said on July 21, 2006 8:38 AM:
Bill Essary provided the following as a work around for using a Team Foundation Server email notifications...
# Naren's Blog said on July 26, 2006 7:20 PM:

I was collecting links &amp;amp; pointers to answer common questions in forums related to TFS eventing...
# Naren's Blog said on October 12, 2006 8:16 PM:

I was collecting links &amp; pointers to answer common questions in forums related to TFS eventing and

# SRLTeam said on November 10, 2006 2:25 AM:

Team System has a built-in, extendable alerting mechanism. It is based on SQL Server 2005 Notification

New Comments to this post are disabled

Search

This Blog

Syndication

Page view tracker