Written by the Microsoft Exchange Server team, the SMTPDiag utility will benefit anyone with an SMTP-based environment. It's simple to use and run and has an excellent analysis engine. SMTPDiag is a command-line troubleshooting tool that works directly on a Windows server with IIS/SMTP service enabled or with Exchange Server installed. It utilizes the same APIs as Windows Server and Microsoft Exchange in order to diagnose configuration and connection issues involving SMTP and DNS.
"SMTPDiag issues DNS queries using both
User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) to validate that the queries will succeed. If TCP queries fail, mail will not be delivered successfully.
The first thing that SMTPDiag does after verifying syntax is to check the Start of Authority (SOA) record for the remote address domain. The next step is to validate that the local domain MX/A records are resolvable. This test verifies that the sender domain is valid and any bounces can return to the originating server. This test could fail if the domain is not resolvable from inside the firewall. The remote domain MX/A records are then checked also. If this step fails, mail will not route because of issues with DNS.
At this point, the network DNS infrastructure must be investigated. When all the DNS records have been successfully queried, the tool will try to connect to all the MX (mail exchange) records that were published for the remote domain on port 25 and try to do an EHLO, mail from, rcpt to, and quit command."
- Makes test requests based on user-inputted information, such as sender and receiver
- Validates that DNS MX records are configured correctly
- Ensures that the correct firewall or proxy ports are open for SMTP to properly work
- Ensures the correct permissions on the relevant SMTP directories such as BadMail, Pickup, etc.
To use the SMTP Diagnostics utility:
- Go to Start -> Run.>p>
- Type command and hit Enter.
- Once the command window is open, type: cd
Now type: cd "Program Files\IIS Resources\SMTPDiag"
- Finally, enter the following syntax to use the tool:
SMTPDIAG "sender address" "recipient address" [-d target DNS] [/v]
Below is a look at the results. (Email servers, email addresses, DNS servers, etc. are blocked out though, of course.)
Inside the IIS Diagnostics Toolkit
How to install the Microsoft IIS Diagnostics Toolkit
How to use SSL Diagnostics 1.0
How to use Authentication and Access Control Diagnostics (AuthDiag) 1.0
How to use Exchange Server SMTP Diagnostics 1.0
How to use Log Parser 2.2
How to use WFetch 1.4
How to use Trace Diagnostics
How to use Debug Diagnostics 1.0
About the author: Tim Fenner (MCSE, MCSA: Messaging, Network+ and A+) is a senior systems administrator who oversees a Microsoft Windows, Exchange and Office environment. He is also an independent consultant who specializes in the design, implementation and management of Windows networks.
This was first published in October 2007