<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=Using_Telnet_with_SMTP</id>
	<title>Using Telnet with SMTP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=Using_Telnet_with_SMTP"/>
	<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Using_Telnet_with_SMTP&amp;action=history"/>
	<updated>2026-05-06T03:04:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=Using_Telnet_with_SMTP&amp;diff=27&amp;oldid=prev</id>
		<title>Admin at 12:24, 4 October 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Using_Telnet_with_SMTP&amp;diff=27&amp;oldid=prev"/>
		<updated>2023-10-04T12:24:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:24, 4 October 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l80&quot;&gt;Line 80:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 80:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://tools.ietf.org/html/rfc4616&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://tools.ietf.org/html/rfc4616&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Sending an Email with...]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=Using_Telnet_with_SMTP&amp;diff=26&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;== The Old Way ==  To connect to a server using Telnet you would run the following command.   telnet mail.example.com 25  However, you&#039;re not going to get very far. Unencrypted Telnet is a no-no for most mail servers and they&#039;ll cut you off right there.  == Using OpenSSL to Connect Securely ==  Luckily, you can get around this by using the wonderful &lt;code&gt;openssl&lt;/code&gt; tool/library to wrap your telnet session in a warm security blanket weaved from the finest encryption...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Using_Telnet_with_SMTP&amp;diff=26&amp;oldid=prev"/>
		<updated>2023-10-04T12:23:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== The Old Way ==  To connect to a server using Telnet you would run the following command.   telnet mail.example.com 25  However, you&amp;#039;re not going to get very far. Unencrypted Telnet is a no-no for most mail servers and they&amp;#039;ll cut you off right there.  == Using OpenSSL to Connect Securely ==  Luckily, you can get around this by using the wonderful &amp;lt;code&amp;gt;openssl&amp;lt;/code&amp;gt; tool/library to wrap your telnet session in a warm security blanket weaved from the finest encryption...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== The Old Way ==&lt;br /&gt;
&lt;br /&gt;
To connect to a server using Telnet you would run the following command.&lt;br /&gt;
&lt;br /&gt;
 telnet mail.example.com 25&lt;br /&gt;
&lt;br /&gt;
However, you&amp;#039;re not going to get very far. Unencrypted Telnet is a no-no for most mail servers and they&amp;#039;ll cut you off right there.&lt;br /&gt;
&lt;br /&gt;
== Using OpenSSL to Connect Securely ==&lt;br /&gt;
&lt;br /&gt;
Luckily, you can get around this by using the wonderful &amp;lt;code&amp;gt;openssl&amp;lt;/code&amp;gt; tool/library to wrap your telnet session in a warm security blanket weaved from the finest encryption the transport security layer has to offer.&lt;br /&gt;
&lt;br /&gt;
* To connect to a mail server using &amp;lt;code&amp;gt;openssl&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 openssl s_client -connect mail.example.com:25 -starttls smtp -no_ssl3&lt;br /&gt;
&lt;br /&gt;
* Next say hello with your domain name:&lt;br /&gt;
&lt;br /&gt;
 helo DOMAIN.COM&lt;br /&gt;
&lt;br /&gt;
* To send a message:&lt;br /&gt;
&lt;br /&gt;
 mail from: from@example.com&lt;br /&gt;
&lt;br /&gt;
* Enter the recipient:&lt;br /&gt;
&lt;br /&gt;
 rcpt to: to@example.com&lt;br /&gt;
&lt;br /&gt;
You may not be able to send to anyone except for yourself this way because most mail providers will not allow you to send without first authenticating. You&amp;#039;ll know you&amp;#039;re not allow to send externally because you&amp;#039;ll get a 554 5.7.1 Relay access denied error.&lt;br /&gt;
&lt;br /&gt;
* Type data to begin composing your message and . to end &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data&lt;br /&gt;
354 End data with &amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;.&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&lt;br /&gt;
Subject: Test Email with telnet&lt;br /&gt;
&lt;br /&gt;
Hey me, &lt;br /&gt;
&lt;br /&gt;
I was able to send an email with telnet&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
* To authenticate before sending you&amp;#039;ll need to run:&lt;br /&gt;
&lt;br /&gt;
 AUTH PLAIN&lt;br /&gt;
&lt;br /&gt;
* Then you&amp;#039;ll need to enter a base64 encoded string version of your username and password:&lt;br /&gt;
&lt;br /&gt;
 USERNAMEUSERNAMEPASSWORD (in base64)&lt;br /&gt;
&lt;br /&gt;
* Then you&amp;#039;ll be authenticated to send:&lt;br /&gt;
 &lt;br /&gt;
 235 2.7.0 Authentication successful&lt;br /&gt;
&lt;br /&gt;
You can generate the base64 encoded username/password string with the following:&lt;br /&gt;
&lt;br /&gt;
 echo -ne &amp;quot;USER@DOMAIN.TLD\x00USER@DOMAIN.TLD\x00PASSWORD&amp;quot; | base64 --wrap=0&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;USER@DOMAIN.TLD&amp;lt;/code&amp;gt; is your Email address and &amp;lt;code&amp;gt;PASSWORD&amp;lt;/code&amp;gt; is your mailbox password.&lt;br /&gt;
&lt;br /&gt;
You can also find the correct base64 encoding of the &amp;quot;username\x00username\x00password&amp;quot; string is by grabbing it out of the verbose output of the SMTP handshake that happens when you&amp;#039;re [[Sending an Email with Curl]]. This form of SASL PLAIN auth string will always be &amp;quot;username\x00username\x00password&amp;quot; as described in [https://tools.ietf.org/html/rfc4616 RFC4616]&lt;br /&gt;
&lt;br /&gt;
 PLAIN SASL Mechanism&lt;br /&gt;
 &lt;br /&gt;
   The mechanism consists of a single message, a string of [UTF-8]&lt;br /&gt;
   encoded [Unicode] characters, from the client to the server.  The&lt;br /&gt;
   client presents the authorization identity (identity to act as),&lt;br /&gt;
   followed by a NUL (U+0000) character, followed by the authentication&lt;br /&gt;
   identity (identity whose password will be used), followed by a NUL&lt;br /&gt;
   (U+0000) character, followed by the clear-text password.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
https://hostpapasupport.com/view-send-email-using-telnet/&lt;br /&gt;
&lt;br /&gt;
https://michlstechblog.info/blog/mail-connect-tls-encrypted-to-a-smtp-server-by-telnet/&lt;br /&gt;
&lt;br /&gt;
https://tools.ietf.org/html/rfc4616&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>