You are on page 1of 16

Introduction

Electronic mail, commonly known as email or e-mail, is a method of exchanging digital messages from an author to one or more recipients. Modern email operates across the Internet or other computer networks. Some early email systems required that the author and the recipient both be online at the same time, in common with instant messaging. Today's email systems are based on a store-and-forward model. Email servers accept, forward, deliver and store messages. Neither the users nor their computers are required to be online simultaneously; they need connect only briefly, typically to an email server, for as long as it takes to send or receive messages. An email message consists of three components, the message envelope, the message header, and the message body. The message header contains control information, including, minimally, an originator's email address and one or more recipient addresses. Usually descriptive information is also added, such as a subject header field and a message submission date/time stamp. Originally a text-only (7-bit ASCII and others) communications medium, email was extended to carry multi-media content attachments, a process standardized in RFC 2045 through 2049. Collectively, these RFCs have come to be called Multipurpose Internet Mail Extensions (MIME). Electronic mail predates the inception of the Internet, and was in fact a crucial tool in creating it,[2] but the history of modern, global Internet email services reaches back to the early ARPANET. Standards for encoding email messages were proposed as early as 1973 (RFC 561). Conversion from ARPANET to the Internet in the early 1980s produced the core of the current services. An email sent in the early 1970s looks quite similar to a basic text message sent on the Internet today. Network-based email was initially exchanged on the ARPANET in extensions to the File Transfer Protocol (FTP), but is now carried by the Simple Mail Transfer Protocol (SMTP), first published as Internet standard 10 (RFC 821) in 1982. In the process of transporting email messages between systems, SMTP communicates delivery parameters using a message envelope separate from the message (header and body) itself.

How Does E-mail work?


Billions of electronic mail (e-mail) messages move across the Internet every year. Sending electronic letters, pictures and data files, either across a building or across the globe, has grown so popular that it has started to replace some postal mail and telephone calls. This universal medium is no longer restricted to exchange of simple text messages and is now regularly used to deliver voice mail, facsimiles and documents that may include images, sound and video. Typically, a message becomes available to the recipient within seconds after it is sentone reason why Internet mail has transformed the way that we are able to communicate.

1 MESSAGE SENDER :It uses mail software, called a client, to compose a document, possibly including attachments such as tables, photographs or even a voice or video recording. System software, called Transmission Control Protocol (TCP), divides the message into packets and adds information about how each packet should be handled-for instance, in what order packets were transmitted from the sender. Packets are sent to a mail submission server, a computer on the internal network of a company or an Internet service provider.

2 INTERNET MAIL ADDRESSES :It attached to each message are in the form "mailbox@domainname" - one specific example being "webmaster@seniorindian.com." The multipart domain name in the above example denotes a top-level domain (".com") following the second-level domain ("seniorindian"). A message is delivered to an individual or a group by the mailbox name ("webmaster").

3 MAIL SUBMISSION SERVER:It converts the domain name of the recipients mail address into a numeric Internet Protocol (IP) address. It does this by querying domain name servers interspersed throughout the Internet. For example, the mail submission server can first request from the "root" name server the whereabouts of other servers that store information about ".com" domains (a). It can then interrogate the ".com" name server for the location of the specific "sciam.com" name server (b). A final request to the "sciam.com" name server provides the IP address for the computer that receives the mail for sciam.com, which is then attached to each message packet (c).

4 ROUTERS :It dispersed throughout the Internet read the IP address on a packet and relay it toward its destination by the most efficient path. (Because of fluctuating traffic over data lines, trying to transmit a packet directly to its destination is not always the fastest way.) The packets of a single message may travel along different routes, shuttling through 10 or so routers before their journeys end.

5 DESTINATION MAIL SERVER:It places the packets in their original order, according to the instructions contained in each packet, and stores the message in the recipients mailbox. The recipients client software can then display the message.

6 An E-Mail Message:The first e-mail message was sent in 1971 by an engineer named Ray Tomlinson. Prior to this, you could only send messages to users on a single machine. Tomlinson's breakthrough was the ability to send messages to other machines on the Internet, using the @ sign to designate the receiving machine. 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.

7 E-Mail Clients:You have probably already received several e-mail messages today. To look at them, you use some sort of e-mail client. Many people use well-known standalone clients like Microsoft Outlook, Outlook Express, Eudora or Pegasus. People who subscribe to free e-mail services like Hotmail or Yahoo use an email client that appears in a Web Page. No matter which type of client you are using, it generally does four things: 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.

8 Simple E-Mail Server :Given that you have an e-mail client on your machine, you are ready to send and receive e-mail. All that you need is an e-mail server for the client to connect to. Let's imagine what the simplest possible e-mail server would look like in order to get a basic understanding of the process. Then we will look at the real thing. 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. Lets say amit and suresh. It would have a text file for each account in the list. So the server would have a text file in its directory named AMIT.TXT, another named SURESH.TXT, and so on. If someone wanted to send a message, the person would compose a text message ("Amit, Can we have lunch Monday? Suresh") in an e-mail client, and indicate that the message should go to amit. 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 (amit), the name of the sender (suresh) and the body of the message. The server would format those pieces of information and append them to the bottom of the AMIT.TXT file. The entry in the file might look like this: From: suresh To: amit Amit, Can we have lunch Monday? Suresh 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. As other people sent mail to amit, the server would simply append those messages to the bottom of the file in the order that they arrived. The text file would accumulate a series of five or 10 messages, and eventually Amit would log in to read them. When Amit wanted to look at his e- mail, his e-mail client would connect to the server machine. In the simplest possible system, it would: Ask the server to send a copy of the AMIT.TXT file Ask the server to erase and reset the AMIT.TXT file Save the AMIT.TXT file on my local machine Parse the file into the separate messages (using the word "From:" as the

separator) Show him all of the message headers in a list When Amit doubleclickes on a message header, it would find that message in the text file and show 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!

9 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: The SMTP server listens on well-known port number 25, POP3 listens on port 110 and IMAP Usesport 143. 10 SMTP Server 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. Let's assume that I want to send a piece of e-mail. My e-mail ID is amit, and I have my account on xserves.com. I want to send e-mail to suresh@daybegins.com. I am using a stand-alone email client like Outlook Express. When I set up my account at xserves, I told Outlook Express the name of the mail server --mail.xserves.com. When I compose a message and press the Send button, here is what happens: Outlook Express connects to the SMTP server at mail.xserves.com using port 25. Outlook Express 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. The SMTP server takes the "to" address (suresh@daybegins.com) and breaks it into two parts: The recipient name (suresh) The domain name (daybegins.com) If the "to" address had been another user at xserves.com, the SMTP server would simply hand the message to the POP3 server for xserves.com (using a little program called the delivery agent). Since the recipient is at another domain, SMTP needs to communicate with that domain. The SMTP server has a conversation with a Domain Name Server, or DNS. It says, "Can you give me the IP address of the SMTP server for daybegins.com?" The DNS replies with the one or more IP addresses for the SMTP server(s) that

Daybegins operates. The SMTP server at xserves.com connects with the SMTP server at Daybegins using port 25. It has the same simple text conversation that my e-mail client had with the SMTP server for Xserves, and gives the message to the Daybegins server. The Daybegins server recognizes that the domain name for suresh is at Daybegins, so it hands the message to Daybegins's POP3 server, which puts the message in suresh's mailbox. If, for some reason, the SMTP server at Xserves cannot connect with the SMTP server at Daybegins, then the message goes into a queue. The SMTP server on most machines uses a program called sendmail to do the actual sending, so this queue is called the sendmail queue. 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. The actual conversation that an e-mail client has with an SMTP server is incredibly simple and human readable. It is specified in public documents called Requests For Comments (RFC), and a typical conversation looks something like this: helo test 250 mx1.daybegins.com Hello abc.sample.com [220.57.69.37], pleased to meet you mail from: test@sample.com 250 2.1.0 test@sample.com... Sender ok rcpt to: suresh@daybegins.com 250 2.1.5 suresh... Recipient ok data 354 Enter mail, end with "." on a line by itself from: test@sample.com to:suresh@daybegins.com subject: testing John, I am testing... . 250 2.0.0 e1NMajH24604 Message accepted for delivery quit 221 2.0.0 mx1.daybegins.com closing connection Connection closed by foreign host. What the e-mail client says is in blue, and what the SMTP server replies is in green. The e-mail client introduces itself, indicates the "from" and "to" addresses, delivers the body of the message

and then quits. You can, in fact, telnet to a mail server machine at port 25 and have one of these dialogs yourself -- this is how people "spoof" e-mail. You can see that the SMTP server understands very simple text commands like HELO, MAIL, RCPT and DATA. The most common commands are: HELO - introduce yourself EHLO - introduce yourself and request extended mode MAIL FROM: - specify the sender RCPT TO: - specify the recipient DATA - specify the body of the message (To:, From: and Subject: should be the first three lines.) RSET - reset QUIT - quit the session HELP - get help on commands VRFY - verify an address EXPN - expand an address VERB - verbose POP3 Server 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! When you check your e-mail, your e-mail client connects to the POP3 server using port 110. The POP3 server requires an account name and a password. 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. Here are the most common commands: USER - enter your user ID PASS - enter your password QUIT - quit the POP3 server LIST - list the messages and their size RETR - retrieve a message, pass it a message number DELE - delete a message, pass it a message number TOP - show the top x lines of a message, pass it a message number and the number of lines 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. 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!

11 IMAP Server
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. 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. 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. Your e-mail client connects to the IMAP server using port 143. 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 email message from the server, delete messages on the server or search through all of the e-mails on the server. 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.

12 Attachments:Your e-mail client allows you to add attachments to e-mail messages you send, and also lets you save attachments from messages that you receive. Attachments might include word processing documents, spreadsheets, sound files, snapshots and pieces of software. Usually, an attachment is not text (if it were, you would simply include it in the body of the message). Since e-mail messages can contain only text information, and attachments are not text, there is a problem that needs to be solved. In the early days of e-mail, you solved this problem by hand, using a program called uuencode.The uuencode program assumes that the file contains binary information. It extracts 3 bytes from the binary file and converts them to four text characters (that is, it takes 6 bits at a time, adds 32 to the value of the 6 bits and creates a text character. What uuencode produces, therefore, is an encoded version of the original binary file that contains only text characters. In the early days of e-mail, you would run uuencode yourself and paste the uuencoded file into your e-mail message. Here is typical output from the uuencode program: begin 644 reports M9W)E<" B<&P_(B O=F%R+VQO9R]H='1P9"]W96(V-C1FBYA8VE< W,N;&]GM('P@8W5T("UF(#(@+60@(C\B('P@8W5T ("UF(#$@+60@(B8B(#X@<V5A<F-HM+61A=&$M)#$*?B]C; W5N="UP86=E<R!\('-O<G0@/B!S=&%T<RTD,0IC< " @M?B]W96)S:71E+V-G:2UB:6XO<W5G9V5S="UD871A+V1A= &$@<W5G9V5S="TDM,0IC<"!^+W=E8G-I=&4O8V=I+6)I;B ]W:&5R92UD871A+V1A=&$@=VAE<F4MM)#$*8W @?B]W96)S:7 1E+V-G:2UB:6XO96UA:6QE<BUD871A+V1A=&$@96UAL:6PM)# $*?B]G971L;V<@/B!L;V=S+20Q"GXO=&]T86P@/B!T;W1A; "T D,0IA End The recipient would then save the uuencoded portion of the message to a file and run uudecode on it to translate it back to binary. The word "reports" in the first line tells uudecode what to name the output file. Modern e-mail clients are doing exactly the same thing, but they run uuencode and uudecode for you automatically. If you look at a raw e-mail file that contains attachments, you'll find that the attachment is represented in the same uuencoded text format shown above! Considering its tremendous impact on society, having forever changed the way we communicate, today's e-mail system is one of the simplest things ever devised! There are parts of the system, like the routing rules in sendmail, that get complicated, but the basic system is incredibly straightforward.

Step A: Sender creates and sends an email The originating sender creates an email in their Mail User Agent (MUA) and clicks 'Send'. The MUA is the application the originating sender uses to compose and read email, such as Eudora, Outlook, etc. Step B: Sender's MDA/MTA routes the email The sender's MUA transfers the email to a Mail Delivery Agent (MDA). Frequently, the sender's MTA also handles the responsibilities of an MDA. Several of the most common MTAs do this, including sendmail and qmail (which Kavi uses). The MDA/MTA accepts the email, then routes it to local mailboxes or forwards it if it isn't locally addressed. In our diagram, an MDA forwards the email to an MTA and it enters the first of a series of "network clouds," labeled as a "Company Network" cloud.

Step C: Network Cloud An email can encounter a network cloud within a large company or ISP, or the largest network cloud in existence: the Internet. The network cloud may encompass a multitude of mail servers, DNS servers, routers, lions, tigers, bears (wolves!) and other devices and services too numerous to mention. These are prone to be slow when processing an unusually heavy load, temporarily unable to receive an email when taken down for maintenance, and sometimes may not have identified themselves properly to the Internet through the Domain Name System (DNS) so that other MTAs in the network cloud are unable to deliver mail as addressed. These devices may be protected by firewalls, spam filters and malware detection software that may bounce or even delete an email. When an email is deleted by this kind of software, it tends to fail silently, so the sender is given no information about where or when the delivery failure occurred. Email service providers and other companies that process a large volume of email often have their own, private network clouds. These organizations commonly have multiple mail servers, and route all email through a central gateway server (i.e., mail hub) that redistributes mail to whichever MTA is available. Email on these secondary MTAs must usually wait for the primary MTA (i.e., the designated host for that domain) to become available, at which time the secondary mail server will transfer its messages to the primary MTA. Step D: Email Queue The email in the diagram is addressed to someone at another company, so it enters an email queue with other outgoing email messages. If there is a high volume of mail in the queueeither because there are many messages or the messages are unusually large, or boththe message will be delayed in the queue until the MTA processes the messages ahead of it. Step E: MTA to MTA Transfer When transferring an email, the sending MTA handles all aspects of mail delivery until the message has been either accepted or rejected by the receiving MTA. As the email clears the queue, it enters the Internet network cloud, where it is routed along a host-to-host chain of servers. Each MTA in the Internet network cloud needs to "stop and ask directions" from the Domain Name System (DNS) in order to identify the next MTA in the delivery chain. The exact route depends partly on server availability and mostly on which MTA can be found to accept email for the domain specified in the address. Most email takes a path that is

dependent on server availability, so a pair of messages originating from the same host and addressed to the same receiving host could take different paths. These days, it's mostly spammers that specify any part of the path, deliberately routing their message through a series of relay servers in an attempt to obscure the true origin of the message. To find the recipient's IP address and mailbox, the MTA must drill down through the Domain Name System (DNS), which consists of a set of servers distributed across the Internet. Beginning with the root nameservers at the toplevel domain (.tld), then domain nameservers that handle requests for domains within that .tld, and eventually to nameservers that know about the local domain.

DNS resolution and transfer process

There are 13 root servers serving the top-level domains (e.g., .org, .com, .edu, .gov, .net, etc.). These root servers refer requests for a given domain to the root name servers that handle requests for that tld. In practice, this step is seldom necessary. The MTA can bypass this step because it has already knows which domain name servers handle requests for these .tlds. It asks the appropriate DNS server which Mail Exchange (MX) servers have knowledge of the subdomain or local host in the email address. The DNS server responds with an MX record: a prioritized list of MX servers for this domain. An MX server is really an MTA wearing a different hat, just like a person who holds two jobs with different job titles (or three, if the MTA also handles the responsibilities of an MDA). To the DNS server, the server that accepts messages is an MX server. When is transferring messages, it is called an MTA.

The MTA contacts the MX servers on the MX record in order of priority until it finds the designated host for that address domain. The sending MTA asks if the host accepts messages for the recipient's username at that domain (i.e., username@domain.tld) and transfers the message.

Step F: Firewalls, Spam and Virus Filters The transfer process described in the last step is somewhat simplified. An email may be transferred to more than one MTA within a network cloud and is likely to be passed to at least one firewall before it reaches it's destination.

An email encountering a firewall may be tested by spam and virus filters before it is allowed to pass inside the firewall. These filters test to see if the message qualifies as spam or malware. If the message contains malware, the file is usually quarantined and the sender is notified. If the message is identified as spam, it will probably be deleted without notifying the sender. Spam is difficult to detect because it can assume so many different forms, so spam filters test on a broad set of criteria and tend to misclassify a significant number of messages as spam, particularly messages from mailing lists. When an email from a list or other automated source seems to have vanished somewhere in the network cloud, the culprit is usually a spam filter at the receiver's ISP or company. This explained in greater detail in Virus Scanning and Spam Blocking.

Delivery
In the diagram, the email makes it past the hazards of the spam trap...er...filter, and is accepted for delivery by the receiver's MTA. The MTA calls a local MDA to deliver the mail to the correct mailbox, where it will sit until it is retrieved by the recipient's MUA.

RFCs
Documents that define email standards are called "Request For Comments (RFCs)", and are available on the Internet through the Internet Engineering Task Force (IETF) website. There are many RFCs and they form a somewhat complex, interlocking set of standards, but they are a font of information for anyone interested in gaining a deeper understanding of email.

Operation overview

Her MUA formats the message in email format and uses the Submission Protocol (a profile of the Simple Mail Transfer Protocol (SMTP), see RFC 6409) to send the message to the local mail submission agent (MSA), in this case smtp.a.org, run by Alice's internet service provider (ISP). 1. The MSA looks at the destination address provided in the SMTP protocol (not from the message header), in this case bob@b.org. An Internet email address is a string of the form localpart@exampledomain. The part before the @ sign is the local part of the address, often the username of the recipient, and the part after the @ sign is a domain name or a fully qualified domain name. The MSA resolves a domain name to determine the fully qualified domain name of the mail exchange server in the Domain Name System (DNS). 2. The DNS server for the b.org domain, ns.b.org, responds with any MX records listing the mail exchange servers for that domain, in this case mx.b.org, a message transfer agent (MTA) server run by Bob's ISP. 3. smtp.a.org sends the message to mx.b.org using SMTP.

This server may need to forward the message to other MTAs before the message reaches the final message delivery agent (MDA). 1. The MDA delivers it to the mailbox of the user bob. 2. Bob presses the "get mail" button in his MUA, which picks up the message using either the Post Office Protocol (POP3) or the Internet Message Access Protocol (IMAP4).

References:www.computer.howstuffworks.com www.seniorindian.com/email.htm www.en.wikipedia.org www.email.about.com

You might also like