An E-mail Message
An e-mail message has always been nothing more than a simple text message - a piece of text sent to a recipient. In the beginning and even today, e-mail messages tend to be short pieces of text, although the ability to add attachments now makes many e-mail messages quite long. Even with attachments, however, e-mail messages continue to be text messages - we'll see why when we get to the section on attachments
- It shows you a list of all of the messages in your mailbox by displaying the message headers. The header shows you who sent the mail, the subject of the mail and may also show the time and date of the message and the message size.
- It lets you select a message header and read the body of the e-mail message.
- It lets you create new messages and send them. You type in the e-mail address of the recipient and the subject for the message, and then type the body of the message.
- Most e-mail clients also let you add attachments to messages you send and save the attachments from messages you receive.
Sophisticated e-mail clients may have all sorts of bells and whistles, but at the core, this is all that an e-mail client does.
A Simple E-mail Server
You know that machines on the Internet can run software applications that act as servers. There are Web servers, FTP servers, telnet servers and e-mail servers running on millions of machines on the Internet right now. These applications run all the time on the server machine and they listen to specific ports, waiting for people or programs to attach to the port. The simplest possible e-mail server would work something like this:
- It would have a list of e-mail accounts, with one account for each person who can receive e-mail on the server. My account name might be mbrain, John Smith's might be jsmith, and so on.
- It would have a text file for each account in the list. So the server would have a text file in its directory named MBRAIN.TXT, another named JSMITH.TXT, and so on.
- If someone wanted to send me a message, the person would compose a text message ("
Can we have lunch Monday? John") in an e-mail client, and indicate that
the message should go to mbrain. When the person presses the Send button, the
e-mail client would connect to the e-mail server and pass to the server the
name of the recipient (mbrain), the name of the sender (jsmith) and the body of
- The server would format those pieces of information and append them to the bottom of the MBRAIN.TXT file. The entry in the file might look like this:
From: jsmith To: mbrain Marshall, Can we have lunch Monday? John
There are several other pieces of information that the server might save into the file, like the time and date of receipt and a subject line; but overall, you can see that this is an extremely simple process.
- Ask the server to send a copy of the MBRAIN.TXT file
- Ask the server to erase and reset the MBRAIN.TXT file
- Save the MBRAIN.TXT file on my local machine
- Parse the file into the separate messages (using the word "From:" as the separator)
- Show me all of the message headers in a list
When I double-clicked on a message header, it would find that message in the text file and show me its body.
You have to admit that this is a very simple system. Surprisingly, the real e-mail system that you use every day is not much more complicated than this.
The Real E-mail System
For the vast majority of people right now, the real e-mail system consists of two different servers running on a server machine. One is called the SMTP server, where SMTP stands for Simple Mail Transfer Protocol. The SMTP server handles outgoing mail. The other is either a POP3 server or an IMAP server, both of which handle incoming mail. POP stands for Post Office Protocol, and IMAP stands for Internet Mail Access Protocol. A typical e-mail server looks like this:
From an e-mail received August 2006