Diagnose and report SMTP server communication with these helpful tools

Most people who use email aren't concerned about the details of email communication because email works—most of the time. When it doesn't work, the task of figuring out why falls to you, the Exchange administrator. SMTP is the Internet protocol that lets email systems communicate with one another. Let's look at options for configuring and using two Exchange 2000 Server SMTP tools: protocol logging and archiving.

SMTP Protocol Logging
Whenever a user makes an SMTP connection to or from your Exchange server, the server establishes an SMTP session, and the two hosts exchange a series of commands, data, and response codes. Figure 1, page 2, shows an example of a typical SMTP dialogue between two computers. The >>> chevrons indicate the commands the sending system issues, and the <<< chevrons indicate the receiving system's response. You can use the log of the two hosts' conversation for diagnostic and reporting purposes.

Enabling SMTP Protocol Logging
Before you configure your server for SMTP protocol logging, you must decide where to store the log files, how long you want to retain the logs, and how much data to record. Earlier Exchange releases required that you configure protocol logging on a per­Internet Mail Service (IMS) or per­Internet Mail Connector (IMC) basis; Exchange 2000 requires that you configure logging on a per­SMTP virtual-server basis.

To configure SMTP protocol logging, open the Microsoft Management Console (MMC) Exchange System Manager snap-in. Right-click the SMTP virtual server and select Properties. In the Properties dialog box, select the General tab, as Figure 2, page 2, shows. Enable logging and select the log file format from one of four options: Microsoft IIS Log File Format, NCSA Common Log File Format, W3C Extended Log File Format, or ODBC Logging.

Selecting ODBC Logging lets you write log data directly to an ODBC-compliant database. If you select this option, you need to manually create a database table to store the log data (use the database software you prefer, such as Microsoft SQL Server or Microsoft Access). A SQL Server template file named logtemp.sql is included in the C:\winnt\system32\inetsrv directory; you can use this file to create the necessary fields in the database table. Configuring IIS for ODBC logging is more complex than configuring IIS for the other three types of logging. For step-by-step instructions, see the Microsoft article "How To Configure ODBC Logging in IIS" (http://support.microsoft.com/default.aspx?scid=kb;en-us;q245243). Although the article mentions Microsoft Internet Information Server (IIS) 4.0, the steps are also valid for Internet Information Services (IIS) 5.0.

After you implement ODBC logging, SMTP logging operation performance is subject to the database's performance. In addition, you must configure and manage the account you use for authentication.

The IIS format, National Center for Supercomputing Applications (NCSA) Common format, and World Wide Web Consortium (W3C) Extended format are text based—in other words, IIS writes the log data to one or more text files on the local system's disks. Each of the three logging formats lets you configure settings that control how large a log file becomes. After you select a log format, click the Properties button on the General tab in the Properties dialog box to display the Extended Logging Properties dialog box that Figure 3 shows. From this dialog box, you can configure sizing options, log location, and other format-specific settings. You can let the text-based logs grow to an unlimited size, or you can configure the rollover options to create new logs hourly, daily, weekly, monthly, or when logs reach a specific size. (You can't configure rollover options for pre­Exchange 2000 SMTP protocol logging.)

You can't use general metrics to determine how quickly a log will grow; logs grow at different rates depending on the level of SMTP traffic that passes through the server and the logging format you select. Whichever format or rollover option you select, periodically purge the accumulating log files. How often you purge the log files depends on the logging partition's free disk space and your organization's record-retention requirements. When the logging partition is full, IIS logging stops until space becomes available. This action doesn't affect processing and message-traffic delivery, but it does affect logging operations. You can use your favorite scripting language and a scheduled task to easily automate the deletion of old log files.

The Extended Logging Properties dialog box lets you specify the log location. The default path is C:\winnt\system\logfiles\smtpsvcn, where n uniquely identifies a virtual server. By default, Exchange has only one SMTP virtual server, so the path is C:\winnt\system\logfiles\smtpsvc1. If you add a second SMTP virtual server, the system will identify the second directory as C:\winnt\system\logfiles\smtpsvc2.

The names of the files in the smtpsvcn directory vary depending on the options you select. For example, if you select the IIS format with monthly log rollover, the log filename will begin with the letters in followed by two digits for the year and two digits for the month (e.g., in0201.log for January 2002). If you select daily W3C Extended logging, the filename will begin with the letters ex followed by six digits for the year, month, and day (e.g., ex020417 for April 17, 2002). The Extended Logging Properties dialog box displays the available naming conventions based on your selection. (For a detailed description of the naming conventions, see the Microsoft article "IIS Log File Naming Syntax" at http://support.microsoft.com/default.aspx?scid=kb;en-us;q242898.)

   Prev. page   [1] 2 3     next page



You must log on before posting a comment.

If you don't have a username & password, please register now.

Reader Comments

I have a problem, i have had analyzing the log, but i have some lines blended, i want know if the lines in the log they come in order?

For example, i have this lines, i want know what line DATA belongs to what line RCPT, my objetive is know that mail can send it and that mail can't send it. The lines in the log are:

2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 HELO - +reforma.com 250 0 57 16 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 hotmail.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 HELO - +hotmail.com 250 0 57 16 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 HELO - +reforma.com 250 0 57 16 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 MAIL - +FROM:+<madavila@reforma.com> 250 0 45 33 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 MAIL - +FROM:+<madavila@reforma.com> 250 0 45 33 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 hotmail.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 MAIL - +FROM:+<madavila@reforma.com> 250 0 45 33 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 RCPT - +TO:<madavila@reforma.com> 550 0 52 30 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 RCPT - +TO:<agallego@reforma.com> 550 0 51 29 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 hotmail.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 RCPT - +TO:<madavila@hotmail.com> 550 0 52 30 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 hotmail.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 DATA - - 554 0 0 4 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 DATA - - 250 0 0 4 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 DATA - - 554 0 0 4 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 QUIT - reforma.com 0 0 31 4 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 reforma.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 QUIT - reforma.com 0 0 31 4 0 SMTP - - - - 2003-05-24 17:45:28 10.1.2.14 hotmail.com SMTPSVC1 GRCDEVSQL 10.1.2.14 0 QUIT - hotmail.com 0 15 31 4 0 SMTP - - - -

Than you very much!

Mario Dávila Rangel