<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><strong><span class="heading">E-mail - What is it and how does it really  work?</span></strong></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><em>(Borrowed from <a href="http://www.howstuffworks.com/">howstuffworks</a>)</em></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />Have you ever  wondered how e-mail gets from your desktop to a friend halfway around the world?  What is a POP3 server, and how does it hold your mail? The answers may surprise  you, because it turns out that e-mail is an incredibly simple system at its  core. In this article, we'll take a look at e-mail and how it  works.</span></p>
<p><strong><span style="font-size: 10pt;"><span style="font-family: arial,helvetica,sans-serif;"><br /><span class="subheading">An E-mail Message</span></span></span></strong></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">An e-mail  message has always been nothing more than a simple <em>text message</em><strong> </strong>-- 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.<br /></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><strong><span style="font-size: 12pt;"><span class="subheading"><span style="font-size: 10pt;">The Email System</span></span></span></strong></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><strong><span style="font-size: 12pt;"><span class="subheading"> </span></span></strong></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">Given that you have an e-mail  client on your machine (like Microsoft Outlook), you are  ready to send and receive e-mail. All that you need is an <em>e-mail server</em><strong> </strong>for the client to connect to.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />We know that machines on the Internet  can run software applications that act as <em>servers</em><strong> </strong>. 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 <em>ports,</em> waiting for people or  programs to attach to the port.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />For the vast majority of people right  now, the e-mail system consists of two different servers running on a server  machine. One is called the <em>SMTP</em><strong> </strong><em>server</em><strong> </strong>, where SMTP stands for Simple  Mail Transfer Protocol. The SMTP server handles outgoing mail. The other is  either a <em>POP3 server </em>or an <em>IMAP server</em>, 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:  The SMTP server listens on  port number 587, POP3 listens  on port 110 and IMAP uses port 143.</span></p>
<center><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><img src="images/Email101/popgraphic.gif" /><br /><br /></span> </center>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br /><strong><span class="subheading">The SMTP  Server</span></strong></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">Whenever you send a piece of e-mail, your e-mail client  interacts with the SMTP server to handle the sending. The SMTP server on your  host may have conversations with other SMTP servers to actually deliver the  e-mail. </span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br /><img src="images/Email101/smtpgraphic.gif" /></span></p>
<center> </center>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />Let's assume that I want to send a piece of e-mail. My e-mail  ID is <em>brain</em><strong> </strong>, and I have my account on <em>hyperoffice.com</em><strong> </strong>. I  want to send e-mail to <em>jsmith@gmail.com</em>. I am using a stand-alone  e-mail client like Outlook.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />When I set up my account at HyperOffice, I told Outlook the name of the mail server --  <em>mail.hyperoffice.com </em>. When I compose a message and press the Send  button, here is what happens: </span></p>
<div align="left"><ol>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">Outlook connects to the SMTP server at mail.hyperoffice.com  using <em>port 587.</em> </span></p>
</li>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">Outlook has a conversation with the SMTP server, telling the SMTP  server the address of the sender and the address of the recipient, as well as  the body of the message. </span></p>
</li>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">The SMTP server takes the "to" address (jsmith@gmail.com) and breaks it  into two parts: </span></p>
<ul>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">The recipient name (jsmith) </span></p>
</li>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">The domain name (gmail.com) </span></p>
</li>
</ul>
</li>
</ol></div>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"> If the "to"  address had been another user at hyperoffice.com, the SMTP server would  simply hand the message to the POP3 server for hyperoffice.com (using a  little program called the <em>delivery agent</em><strong> </strong>). Since the recipient is at  another domain, SMTP needs to communicate with that domain. </span></p>
<div align="left"><ol>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">The SMTP server has a conversation with a <em>Domain Name Server</em>, or <em> </em><em>DNS</em><strong> </strong>. It says, "Can you give me the IP address of the SMTP server for gmail.com?" The DNS replies with the one or more IP addresses for the SMTP  server(s) that gmail operates. </span></p>
</li>
<li>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">The SMTP server at hyperoffice.com connects with the SMTP server at gmail using port 587. It has the same simple text conversation that my  e-mail client had with the SMTP server for HyperOffice, and gives the  message to the gmail server. The gmail server recognizes that the  domain name for jsmith is at gmail, so it hands the message to gmail's  POP3 server, which puts the message in jsmith's mailbox. </span></p>
</li>
</ol></div>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"> If, for  some reason, the SMTP server at hyperoffice.com cannot connect with the SMTP  server at gmail, then the message goes into a queue. The SMTP server on  most machines uses a program called <em>sendmail</em><strong> </strong>to do the actual sending, so  this queue is called the <em>sendmail queue</em><strong> </strong>. Sendmail will periodically try  to resend the messages in its queue. For example, it might retry every 15  minutes. After four hours, it will usually send you a piece of mail that tells  you there is some sort of problem. After five days, most sendmail configurations  give up and return the mail to you undelivered.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br /><strong><span style="font-size: 12pt;"><span class="subheading">The POP3 Server</span></span></strong></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">In the simplest implementations of  POP3, the server really does maintain a collection of text files -- one for each  e-mail account. When a message arrives, the POP3 server simply appends it to the  bottom of the recipient's file.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />When you check your e-mail, your e-mail  client connects to the POP3 server using <em>port 110</em><strong> </strong>. The POP3 server  requires an <em>account name</em><strong> </strong>and a <em>password</em>. Once you have logged in,  the POP3 server opens your text file and allows you to access it. Like the SMTP  server, the POP3 server understands a very simple set of text  commands.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />Your e-mail client connects to the POP3 server and issues a  series of commands to bring copies of your e-mail messages to your local  machine. Generally, it will then delete the messages from the server (unless  you've told the e-mail client not to).</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />You can see that the POP3 server  simply acts as an interface between the e-mail client and the text file  containing your messages. And again, you can see that the POP3 server is  extremely simple! You can connect to it through telnet at port 110 and issue the  commands yourself if you would like to!</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br /><strong><span class="subheading">The IMAP  Server</span></strong></span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">As you can see, the POP3 protocol is very simple. It allows you  to have a collection of messages stored in a text file on the server. Your  e-mail client (e.g. Outlook Express) can connect to your POP3 e-mail server and  download the messages from the POP3 text file onto your PC. That is about all  that you can do with POP3.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />Many users want to do far more than that with  their e-mail, and they want their e-mail to remain on the server. The main  reason for keeping your e-mail on the server is to allow users to connect from a  variety of machines. With POP3, once you download your e-mail it is stuck on the  machine to which you downloaded it. If you want to read your e-mail both on your  desktop machine and your laptop (depending on whether you are working in the  office or on the road), POP3 makes life difficult.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />IMAP (Internet Mail  Access Protocol) is a more advanced protocol that solves these problems. With  IMAP, your mail stays on the e-mail server. You can organize your mail into  folders, and all the folders live on the server as well. When you search your  e-mail, the search occurs on the server machine, rather than on your machine.  This approach makes it extremely easy for you to access your e-mail from any  machine, and regardless of which machine you use, you have access to all of your  mail in all of your folders.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />Your e-mail client connects to the IMAP  server using <em>port 143</em><strong> </strong>. The e-mail client then issues a set of text  commands that allow it to do things like list all the folders on the server,  list all the message headers in a folder, get a specific e-mail message from the  server, delete messages on the server or search through all of the e-mails on  the server.</span></p>
<p><span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><br />One problem that can arise with IMAP involves this simple  question: "If all of my e-mail is stored on the server, then how can I read my  mail if I am not connected to the Internet?" To solve this problem, most e-mail  clients have some way to cache e-mail on the local machine. For example, the  client will download all the messages and store their complete contents on the  local machine (just like it would if it were talking to a POP3 server). The  messages still exist on the IMAP server, but you now have copies on your  machine. This allows you to read and reply to e-mail even if you have no  connection to the Internet. The next time you establish a connection, you  download all the new messages you received while disconnected and send all the  mail that you wrote while disconnected.</span></p>
<input id="gwProxy" type="hidden" /><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden" />
<div id="refHTML"></div>
<input id="gwProxy" type="hidden" /><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden" />
<div id="refHTML"></div>
<input id="gwProxy" type="hidden" /><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden" />
<div id="refHTML"></div>
<input id="gwProxy" type="hidden" /><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden" />
<div id="refHTML"></div>
<input id="gwProxy" type="hidden"><!--Session data--></input><input onclick="jsCall();" id="jsProxy" type="hidden" />
<div id="refHTML"></div>