<?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>Martin Fleming &#187; Troubleshooting</title>
	<atom:link href="http://martin-fleming.co.uk/category/troubleshooting/feed/" rel="self" type="application/rss+xml" />
	<link>http://martin-fleming.co.uk</link>
	<description>Sharing my experiences and knowledge</description>
	<lastBuildDate>Fri, 11 Nov 2011 15:08:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Test SMTP Mail Server With Telnet</title>
		<link>http://martin-fleming.co.uk/2009/11/test-smtp-mail-server-with-telnet/</link>
		<comments>http://martin-fleming.co.uk/2009/11/test-smtp-mail-server-with-telnet/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 05:24:07 +0000</pubDate>
		<dc:creator>Marty (admin)</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[SMTP]]></category>
		<category><![CDATA[telnet]]></category>

		<guid isPermaLink="false">http://martin-fleming.co.uk/?p=25</guid>
		<description><![CDATA[<p>Testing SMTP with telnet can come in handy.  You may have just set up your mailserver and want to test it, or your email client is having problems sending emails and is not giving very helpful error messages (if any).  Using telnet is handy as it will throw up any error messages which will help you do understand at what part of the sending process the failure has occured.</p>
<p>Testing with Telnet is real quick and simple,we are going to assume plain password authentication and no TLS or SSL. <span id="more-25"></span></p>
<ol>
<li>We need to open a connection to the server
<pre class="cmd">$ telnet yourmailserver.com 25</pre>
<p>You should get a response like this</p>
<pre class="cmd">Trying 74.125.79.16..
Connected to yourmailserver.com.
Escape character is '^]'.
220 mx.yourmailserver.com</pre>
</li>
<li>Now we need to greet the serer
<pre class="cmd">HELO yourmailserver.com</pre>
<p>Response</p>
<pre class="cmd">250 yourmailserver.com</pre>
</li>
<li>We need to authenticate ourselves with our username and password.  This may not be neccessary for all SMTP servers.<br />
We are going to use plain authentication but we need to encode it to base64.  Below is two ways to do this with Perl or PHP, with both methods you must leave in the &#8220;\0&#8243; characters.&nbsp;</p>
<pre class="cmd">$ php -r 'echo base64_encode("\0username\0password")."\n";'</pre>
<p>or</p>
<pre class="cmd">$ perl -MMIME::Base64 -e 'print encode_base64("\0username\0password");'</pre>
<p>Take the value given and pass it to the mail server</p>
<pre class="cmd">AUTH PLAIN AHVzZXJuYW1lAHBhc3N3b3Jk</pre>
<p>Response</p>
<pre class="cmd">235 2.7.0 Authentication successful</pre>
</li>
<li>Now we start to send a test message by putting in who the mail is from
<pre class="cmd">MAIL FROM:me@mydomain.com</pre>
<p>Response</p>
<pre class="cmd">250 2.1.0 Ok</pre>
</li>
<li>Add recipient
<pre class="cmd">RCPT TO:me@myotheremail.com</pre>
<p>Response</p>
<pre class="cmd">250 2.1.5 Ok</pre>
</li>
<li> Add a subject
<pre class="cmd">SUBJECT: Test message from me</pre>
</li>
<li>Start the message
<pre class="cmd">DATA</pre>
<p>Response</p>
<pre class="cmd">354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;</pre>
<p>Press enter then add the message body</p>
<pre class="cmd">Hi this is my test message</pre>
<p>Press enter and on the next line type a &#8220;.&#8221; then enter</p>
<pre class="cmd">.</pre>
<p>Response</p>
<pre class="cmd">250 2.0.0 Ok: queued as 666F4E0157</pre>
</li>
<li>Thats it the message is on the way now quit
<pre class="cmd">QUIT</pre>
</li>
</ol>
]]></description>
		<wfw:commentRss>http://martin-fleming.co.uk/2009/11/test-smtp-mail-server-with-telnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

