|
||
how does email work?
At the pointy end of the system is the MTA which stands for mail transport agent. This is the bit that does the grunt work of moving email around on the Internet. Probably the most popular MTA is sendmail but there are plenty of others to choose from including courier-mta, postfix and qmail as well as pay for offerings. The MTA probably has the most security issues as it is world facing. There used to be problems (and to some extent there still is) with open relays. These are badly configured MTAs that allow anyone to connect and send email through them. Many modern MTAs make it deliberately quite difficult to configure an open realy.
The next step down is the MDA or mail delivery agent. This has the job of deliverying the email to the user. Typically this means placing the email in a mbox or maildir. A popular MDA is maildrop but, as with MTAs, plenty of other exist (for instance procmail). As well as deliverying the mail the MDA often filters the mail as well. This can be just a simple set of rules for putting certain email in certain folders or it can be as complex as intergrating multiple external mail scanners that check to spam and viruses. Depending on the set up the next part of the puzzle is optional but almost always present and is either an IMAP or POP server. If you are setting up your own system I strongly recommend an IMAP server as it means that you will be able to easily check your mail from anywhere in the world. Again there are loads of IMAP servers but they vary in quality. I use the Courier IMAP server and have found it to be quite reliable if a little slow. The IMAP server essentailly owns your mailbox (I use mailbox here not to refere to the mbox file format but a generic place that holds you mail) and provides a view of it to the next layer of software, the MUA. The MUA is the bottom rung of the ladder and stands for mail user agent. This is the application that you actually read you email with. The reason that the layer above is optional is because there are a few MUAs that can directly read mbox format files (there might be some that can read maildirs as well). These are rare though and I wouldn't recommend using them. It is much better to get a decent MUA (such as Thunderbird, KMail, Evolution, etc, etc) that can interface with and IMAP server. An E-mail Message According to Darwin Magazine: Prime Movers, 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. 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 stand-alone clients like Microsoft Outlook, Outlook Express, Eudora or Pegasus. People who subscribe to free e-mail services like Hotmail or Yahoo use an e-mail client that appears in a Web page. If you are an AOL customer, you use AOL's e-mail reader. No matter which type of client you are using, it generally does four things:
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 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. If you have read How Web Servers Work, then 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 (see How Web Servers Work for details). The simplest possible e-mail server would work something like this:
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 mbrain, 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 I would log in to read them. When I wanted to look at my e-mail, my e-mail client would connect to the server machine. In the simplest possible system, it would:
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: The 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. When I set up my account at howstuffworks, I told Outlook Express the name of the mail server -- mail.howstuffworks.com. When I compose a message and press the Send button, here is what happens:
· The recipient name (jsmith) If the "to" address had been another user at howstuffworks.com, the SMTP server would simply hand the message to the POP3 server for howstuffworks.com (using a little program called the delivery agent). Since the recipient is at another domain, SMTP needs to communicate with that domain. 4. The SMTP server has a conversation with a Domain Name Server, or DNS (see How Web Servers Work for details). It says, "Can you give me the IP address of the SMTP server for mindspring.com?" The DNS replies with the one or more IP addresses for the SMTP server(s) that Mindspring operates. 5. The SMTP server at howstuffworks.com connects with the SMTP server at Mindspring using port 25. It has the same simple text conversation that my e-mail client had with the SMTP server for HowStuffWorks, and gives the message to the Mindspring server. The Mindspring server recognizes that the domain name for jsmith is at Mindspring, so it hands the message to Mindspring's POP3 server, which puts the message in jsmith's mailbox. 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 helo test 250 mx1.mindspring.com Hello abc.sample.com subject: testing John, I am testing... quit 221 2.0.0 mx1.mindspring.com closing connection 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:
,
|
||
|
Copyright 2003-2020 by BusinessKnowledgeSource.com - All Rights Reserved
Privacy Policy, Terms of Use |
||