<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Email management, storage and security for business email admins &#187; Telnet</title>
	<atom:link href="http://www.theemailadmin.com/tag/telnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theemailadmin.com</link>
	<description></description>
	<lastBuildDate>Thu, 09 Feb 2012 14:00:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using telnet to test your mail server</title>
		<link>http://www.theemailadmin.com/2010/12/using-telnet-to-test-your-mail-server/</link>
		<comments>http://www.theemailadmin.com/2010/12/using-telnet-to-test-your-mail-server/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 15:48:17 +0000</pubDate>
		<dc:creator>Ed Fisher</dc:creator>
				<category><![CDATA[email management]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[Telnet]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.theemailadmin.com/?p=3365</guid>
		<description><![CDATA[Sometimes, testing an email server is as simple as dropping to the cmd-line and running telnet.exe.<p><a href="http://www.theemailadmin.com/2010/12/using-telnet-to-test-your-mail-server/">Using telnet to test your mail server</a><br/><br/>

Free ebook download: <a href="http://www.theemailadmin.com/ebook/Top-10-Most-Popular-Troubleshooting-Posts-for-Email-Administrators.pdf">Top 10 Most Popular Troubleshooting Posts for Email Administrators</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a target="_blank" href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.theemailadmin.com%2F2010%2F12%2Fusing-telnet-to-test-your-mail-server%2F" onclick="pageTracker._trackPageview('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.theemailadmin.com_2F2010_2F12_2Fusing-telnet-to-test-your-mail-server_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.theemailadmin.com%2F2010%2F12%2Fusing-telnet-to-test-your-mail-server%2F&amp;source=emailadm&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignleft size-medium wp-image-3366" style="margin-left: 10px;margin-right: 10px" src="http://www.theemailadmin.com/wp-content/uploads/2010/12/telnet-300x120.PNG" alt="telnet" width="210" height="84" /></p>
<p>When troubleshooting email, one tool I use again and again is my trusty telnet client. With that one simple command line tool, and a little knowledge of the RFCs, I can usually debug network issues related to email delivery, or at least narrow them down quickly without resorting to packet captures, reconfiguring clients, or other legerdemain. While most old school colleagues will go to telnet without a second thought, many others seem to think this is eldritch magick, so today we are going to learn how to use telnet to test SMTP.</p>
<p>One reason many of the newer IT professionals may not be as comfortable with telnet is because it is not included be default in the newer Microsoft operating systems. Starting with Vista, Microsoft decided to make you &#8216;opt in&#8217; to using it, probably because it does transmit all traffic in the clear, and as such, could expose passwords or other confidential information. While that is true, and a very important thing to understand, using it to connect to services, grab banners, and send simple mail is safe enough, and I keep a generic account handy for things that require logins so that I can test without exposing my true domain account credentials. Here&#8217;s how to get started.</p>
<p><span id="more-3365"></span>If you don&#8217;t have the telnet client installed, open an administrative command prompt, and run this command to install it.</p>
<pre>servermangercmd.exe -i telnet-client [enter]</pre>
<p>Once you have it installed, you will want to run it from a cmd prompt, and not from the RUN dialog. You do not have to run it from an administrative cmd prompt. The telnet.exe can be launched by simply running the command, which will give you an interactive prompt. Or you can invoke it with arguments, that include the destination host (by ip.addr or FQDN) and port number, where the telnet protocol&#8217;s well-known port 23 is the default. Since we are going to look at troubleshooting SMTP, lets get right into it. When I use telnet to connect to an SMTP server for testing, I usually launch it like this (since the client&#8217;s default settings are usually sufficient for this).</p>
<pre>telnet mail.example.com 25 [enter]</pre>
<p>If you want to see other options, run it, and enter a ? to see the other options. You will see that ntlm is an option in the Windows client; that is only useful to protect credentials when connecting to a server running Microsoft&#8217;s telnetd. It will not encrypt creds to anything else, nor will it encrypt any data. Once you connect to your destination server on port 25, you should see the server&#8217;s banner, like this.</p>
<p style="text-align: center;"><img class="size-medium wp-image-3367 aligncenter" style="margin-top: 10px; margin-bottom: 10px; border: 0px;" src="http://www.theemailadmin.com/wp-content/uploads/2010/12/banner1-300x158.png" alt="banner1" width="300" height="158" /></p>
<p> If you see something like this instead…</p>
<p style="text-align: center;"><img class="size-medium wp-image-3368 aligncenter" style="margin-top: 10px; margin-bottom: 10px; border: 0px;" src="http://www.theemailadmin.com/wp-content/uploads/2010/12/banner2-300x158.png" alt="banner2" width="300" height="158" /></p>
<p>then you have a PIX or ASA doing fixup or inspect, respectively, on SMTP. The important piece is that little 220. RFC821 defines the response codes SMTP servers use. 220 means you have connected, and the server is ready to communicate with you over SMTP.</p>
<blockquote><p>*See that quirky banner? That is so a malicious user can&#8217;t easily tell what kind of SMTPd I am running. See <a href="http://www.theemailadmin.com/2010/08/how-to-change-your-smtp-banner-for-fun-and-profit/">How to change your SMTP banner for fun and profit</a> for how to change your banner.</p></blockquote>
<p> There are several commands that are supported by SMTP, and you can consult RFC821 for those, or RFC2821 for the ESMTP command, but here are the ones you want to know off the top of your head.</p>
<ul>
<li><strong>HELO</strong> this is your way of identifying the sending system. MTAs that do reverse DNS lookups will take what you put in the HELO command, and see if they ip.addr of your connection maps to what you assert here. YMMV.</li>
<li><strong>MAIL FROM:</strong> Note the colon. This is the email address your cmd-line email comes from.</li>
<li><strong>RCPT TO:</strong> Note the colon. This is the email address you want the server to deliver the email to.</li>
<li><strong>DATA</strong> This tells the server that you are ready to start sending the actual email.</li>
<li><strong>SUBJECT:</strong> Note the colon. Places the subject line, and must be followed by a CR. Then you can begin to type your message, using single CRs for each line break you want to enter.</li>
<li><strong>CR.CR</strong> This is how you end the message.</li>
<li><strong>QUIT </strong>Does exactly that.</li>
</ul>
<p>The server will respond with certain codes to each of your inputs.</p>
<ul>
<li><strong>220</strong> Means the server has accepted your initial connection and is ready to accept further SMTP from you.</li>
<li><strong>221 </strong>In response to a quit command, it means the session has been gracefully terminated.</li>
<li><strong>250</strong> Means that the server has accepted your input.</li>
<li><strong>354</strong> In response to the data command, it means the server knows who the mail is from, who it is to, and is ready for the message.</li>
</ul>
<p>There are some other responses that you might encounter.</p>
<ul>
<li><strong>250 </strong>2.0.0 Resetting A response the RSET command, indicating the session is being reset.</li>
<li><strong>252</strong> 2.1.5 Cannot VRFY user A response to a request to VeRiFY an address.</li>
<li><strong>421</strong> 4.7.0 Too many errors on this connection, closing transmission channel. What happens when you make too many typos, or ask for too many things that the server will not do.</li>
<li><strong>500</strong> 5.3.3 Unrecognized command</li>
<li><strong>501</strong> 5.5.4 Unrecognized parameter</li>
<li><strong>501</strong> 5.5.4 Invalid arguments</li>
<li><strong>503</strong> 5.5.2 Send hello first</li>
<li><strong>503</strong> 5.5.2 Need mail command</li>
<li><strong>503</strong> 5.5.2 Need rcpt command</li>
<li><strong>550</strong> 5.7.1 Unable to relay</li>
</ul>
<p>With these, you are ready to submit a mail to the server from the telnet prompt, and determine whether the system will accept the mail, relay the mail, or drop the mail. Be careful, one thing you cannot do using telnet is backspace, so if you make a mistake typing, you can enter a RSET command on the next line, just keep going, or kill the connection and try again. Here is how a connection would look, where everything you type is in red, and everything the server responds is in black.</p>
<blockquote><p><span style="color: #993300">telnet server.example.com 25<br />
</span>220 This is the example.com mailserver. How you doin&#8217;?<br />
<span style="color: #993300">helo example.com<br />
</span>250 server.example.com Hello [192.168.217.64]<br />
<span style="color: #993300">mail from:elvis@graceland.com<br />
</span>250 2.1.0 ed@example.com&#8230;.Sender OK<br />
<span style="color: #993300">rcpt to:ed@example.com<br />
</span>250 2.1.5 <a target="_blank" href="mailto:ed@example.com">ed@example.com</a><br />
<span style="color: #993300">data<br />
</span>354 Please start mail input.<br />
<span style="color: #993300">subject: peanut butter and banana sandwich recipe<br />
This is delicious.<br />
Thank you, thank you very much.<br />
.<br />
</span>250 Mail queued for delivery.<br />
<span style="color: #993300">quit<br />
</span>221 Closing connection. Good bye.<br />
Connection to host lost.</p></blockquote>
<p>If you make it through from the 220 to the 221, then you have successfully queued an email for delivery. When testing your external SMTP gateway, try to send an email to an external recipient. Make sure your server responds with a 550 5.7.1. With the above information at hand, you are ready to amaze your friends, impress your boss, and troubleshoot mailservers without having to break out any tools or even log onto the server. Enjoy.</p>
<span id="pty_trigger"></span><p><a href="http://www.theemailadmin.com/2010/12/using-telnet-to-test-your-mail-server/">Using telnet to test your mail server</a><br/><br/>

Free ebook download: <a href="http://www.theemailadmin.com/ebook/Top-10-Most-Popular-Troubleshooting-Posts-for-Email-Administrators.pdf">Top 10 Most Popular Troubleshooting Posts for Email Administrators</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theemailadmin.com/2010/12/using-telnet-to-test-your-mail-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Diagnosing Email Server Problems with the Windows Command Line</title>
		<link>http://www.theemailadmin.com/2009/11/diagnosing-email-server-problems-with-the-windows-command-line/</link>
		<comments>http://www.theemailadmin.com/2009/11/diagnosing-email-server-problems-with-the-windows-command-line/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 15:03:57 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Exchange server]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[SMTP]]></category>
		<category><![CDATA[Telnet]]></category>

		<guid isPermaLink="false">http://www.theemailadmin.com/?p=1842</guid>
		<description><![CDATA[An essential skill for email administrators is being able to dive into the command line to troubleshoot email delivery and connectivity problems.  In this post I will explain some of the simple command line techniques you can use for diagnosing these email issues. NSLookup NSLookup is the command line utility for querying the Domain Name [...]<p><a href="http://www.theemailadmin.com/2009/11/diagnosing-email-server-problems-with-the-windows-command-line/">Diagnosing Email Server Problems with the Windows Command Line</a><br/><br/>

Free ebook download: <a href="http://www.theemailadmin.com/ebook/Top-10-Most-Popular-Troubleshooting-Posts-for-Email-Administrators.pdf">Top 10 Most Popular Troubleshooting Posts for Email Administrators</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a target="_blank" href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.theemailadmin.com%2F2009%2F11%2Fdiagnosing-email-server-problems-with-the-windows-command-line%2F" onclick="pageTracker._trackPageview('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.theemailadmin.com_2F2009_2F11_2Fdiagnosing-email-server-problems-with-the-windows-command-line_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.theemailadmin.com%2F2009%2F11%2Fdiagnosing-email-server-problems-with-the-windows-command-line%2F&amp;source=emailadm&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignright size-full wp-image-1846" title="keyboard" src="http://www.theemailadmin.com/wp-content/uploads/2009/11/keyboard.jpg" alt="keyboard" width="200" height="133" />An essential skill for email administrators is being able to dive into the command line to troubleshoot email delivery and connectivity problems.  In this post I will explain some of the simple command line techniques you can use for diagnosing these email issues.</p>
<h2>NSLookup</h2>
<p>NSLookup is the command line utility for querying the Domain Name System (DNS).  Because email delivery relies so heavily on the Mail Exchanger (MX) records contained within DNS you need to know how to use it for verifying DNS configurations.</p>
<p>When someone reports a problem sending email to an outside party and you want to investigate it one of the first things you’ll need to determine is the name or IP address of their mail server.  This is the job of the MX record, which you can query using NSLookup.<span id="more-1842"></span></p>
<p>Open a command prompt (Start -&gt; Run, cmd.exe) and type “nslookup” and press Enter.  First test a few well known web addresses to make sure that your own DNS servers are working properly.</p>
<pre>C:\&gt;nslookup
Default Server:  UnKnown
Address:  192.168.0.1

&gt; www.gfi.com
Server:  UnKnown
Address:  192.168.0.1

Non-authoritative answer:
Name:    www.gfi.com
Address:  216.134.217.17

&gt; www.theemailadmin.com
Server:  UnKnown
Address:  192.168.0.1

Non-authoritative answer:
Name:    theemailadmin.com
Address:  69.89.31.227
Aliases:  www.theemailadmin.com</pre>
<p>Now change the query type to MX by typing “set” and press Enter.</p>
<pre>&gt; set type=mx</pre>
<p>Next type the domain name for the organization you are trying to send to, e.g. contoso.com.</p>
<pre>&gt; contoso.com</pre>
<p>If their DNS zone exists, is correctly configured, and their name servers are responding, you should receive a response similar to this.</p>
<pre>Server:  UnKnown
Address:  192.168.0.1

Non-authoritative answer:
contoso.com     MX preference = 10,
mail exchanger = mail.global.frontbridge.com

mail.global.frontbridge.com
internet address = 216.32.180.22</pre>
<p>If there is a problem you may receive a response more like this.</p>
<pre>*** UnKnown can't find contoso.com: Non-existent domain</pre>
<p>When a successful response is received it tells us that they have one MX record with a preference of 10 (this only matters when there are more than one MX records), and that its name is mail.global.frontbridge.com.  Furthermore we can see that mail.global.frontbridge.com resolves to IP address 216.32.180.22.  This is the IP address we want to connect to for testing email connectivity.</p>
<h2>Telnet</h2>
<p>Telnet is the command line utility to use for testing connectivity.  Telnet allows us to connect to any IP address and TCP port to perform testing.</p>
<p>For Windows Server 2003 and earlier Telnet is already installed, but for Windows Server 2008 Microsoft took the standpoint that Telnet is potentially a hacking tool and so is not installed by default on new servers.  You can install it when necessary by launching an elevated privilege command prompt and running this command.</p>
<pre>servermanagercmd.exe –i telnet-client</pre>
<p>From a command prompt type “telnet [name/IP address] 25” and press Enter.  This tells Telnet to connect to the given name or IP address on TCP port 25 (the SMTP port).</p>
<p>At a successful connection you will see status code 220 (meaning Service Ready) followed by the welcome banner for the server (this will vary depending on the mail server software that they are running plus whatever customization the email administrator applies).</p>
<pre>220 TX2EHSMHS026.bigfish.com Microsoft ESMTP MAIL
Service ready at Thu, 19 Nov 2009 12:44:27 +0000</pre>
<p>Now it is time to learn how to issue basic SMTP commands using Telnet.  A simple SMTP session will contain these steps:</p>
<p><strong>EHLO</strong> – Identifies the sending server (you).  You can also use HELO, but EHLO is widely supported.</p>
<p><strong>MAIL</strong> – Identifies the sending email address.</p>
<p><strong>RCPT</strong> – Identifies the receiving email address.</p>
<p><strong>DATA</strong> – The contents of the email message itself.</p>
<p>So to test email to the contoso.com email server you can use this command sequence.</p>
<pre>ehlo
250-TX2EHSMHS026.bigfish.com Hello [202.173.145.153]
250-SIZE 157286400
250-PIPELINING
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH
250-8BITMIME
250-BINARYMIME
250 CHUNKING
mail from: paul@exchangeserverpro.com
250 2.1.0 OK
rcpt to: name@contoso.com
250 2.1.5 OK
data
354  Go ahead
Subject: This is a test email
This is a test email
.
250 2.0.0 OK</pre>
<p>Note how the message is sent after the DATA verb is issued, the data itself entered, and then a &#8220;.&#8221; (period) indicating the end of the data.</p>
<p>If there are any problems with this SMTP session the error messages that are returned by the server will indicate exactly what is going on.  For example, the server may return a message saying that message relay is denied, or that the intended recipient is not valid.  From this you can determine the next steps to take in troubleshooting the email problem.</p>
<span id="pty_trigger"></span><p><a href="http://www.theemailadmin.com/2009/11/diagnosing-email-server-problems-with-the-windows-command-line/">Diagnosing Email Server Problems with the Windows Command Line</a><br/><br/>

Free ebook download: <a href="http://www.theemailadmin.com/ebook/Top-10-Most-Popular-Troubleshooting-Posts-for-Email-Administrators.pdf">Top 10 Most Popular Troubleshooting Posts for Email Administrators</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theemailadmin.com/2009/11/diagnosing-email-server-problems-with-the-windows-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

