The visual complexity of modern email clients such as Outlook Express hides the simplicity of the underlying protocols that they use. Such clients communicate with compatible servers (which include MS Exchange) using the SMTP and POP3 protocols. These protocols have been around for several decades and if you know a few simple protocol commands it’s possible to send and receive emails via an Exchange Server with no GUI client whatsoever, if you have access to a telnet client.
Telnet forms part of the basic TCP/IP protocol suite and is therefore to be found on most machines that have TCP/IP installed. It is a very useful diagnostic tool that we can use to establish a connection to a remote computer (via a particular ‘port’) issue commands to the remote computer, and see the responses it produces. The syntax used to run the telnet program is; telnet
SMTP is the TCP/IP protocol used to send emails via the Internet. It uses port number 25, so in order to use telnet to open an SMTP session with an Exchange server we use the command telnet
Fig. 1 – Running telnet on Windows 98.
If the connection is successful, we should see a banner and a CLI interface such as that shown in figure 2. The SMTP service has a help command that we can use to show the list of commands available.
Fig. 2 – The SMTP HELP command.
The commands used to send a message using SMTP are; mail from: , which is used to identify the sender; rcpt to: , which identifies the destination address; and data , which is where we can type in the message body. If we type in ‘subject:’ followed by a blank line in the data part, we can supply a subject line for the message. The data part is terminated by a CRLF.CRLF sequence, in other words; we type in a carriage return, a full stop and another carriage return. The quit command is used to close the session. A typical SMTP dialogue is shown in figure 3:
Fig 3 . – A typical SMTP dialogue.
POP3 is the TCP/IP protocol that is used to retrieve Internet mail from a server. It uses port number 110, so to open a POP session with our Exchange server we use the command telnet
Fig. 4 – Opening a POP3 telnet session.
The commands used to retrieve email using POP3 are; user , which identifies the mailbox we want to open; pass , which we use to supply the password for the mailbox; list, which shows us a list of available messages and their size; and retr
Fig. 5 – A typical POP3 dialogue.
Here we can see the message we submitted earlier using SMTP. Figure 6 shows the same message opened in MS Outlook. Note the presence of the subject line and the absence of a date/time-sent field. This can be specified in a similar way to the subject: field by using ‘date:’ within the data part of a message.
Fig. 6 – The SMTP message in MS Outlook.
If you want to learn more about the SMTP and POP3 protocols, search for RFC 821 , and RFC 1939 . These are the documents that describe the official specifications of these protocols.
About The Author
Lee Derbyshire BSc (Hons), MCSE is a full-time IT Professional living in the UK. You can visit his Web page at www.leederbyshire.com