The stage is set, and now we’re ready to introduce the players.
Think about what happens when mail is sent by a user on a PC using Netscape to someone who uses the text-mode, Unix-based MUA, PINE. As seen in Figure 1-7 , the sender (Netscape user) sends the message by SMTP to the MTA running on the sender’s ISP’s mail server. Once the mail arrives at the mail server, the MTA asks the MDA to store the message in the local message store. When the recipient reads his mail, he runs PINE on the mail server itself, which views his INBOX as a local file. Although in the example, no network mail access protocol is involved while reading the mail, you might think of the mail access protocol in this case as a way of converting the mail into something the client can understand. In those terms, the mail access protocol can be thought of as being hardcoded in the client.
An agent is a program that performs a task on behalf of a human user, either directly at the human’s behest or indirectly under instruction from another agent. Usually, a chain of agents work in concert to get the information from its point of origin to its intended destination. Unlike the previous examples, Internet email agents perform their duties in the open and usually with the full consent and support of all the participants. Here are some examples of some of the more popular Internet email agents. We’ll go into more detail about some of these later, but it’s always good to solidify theory with some real-world examples as soon as possible.
Any discussion of Internet MTAs could also easily be entitled “Sendmail and some alternatives.” The old slogan that “nobody ever got fired for buying IBM” could be adapted equally well to sendmail. Leave it to the Internet community, though, not to leave well enough alone. Recently, viable contenders have come onto the scene, such as Qmail and Postfix.
sendmail is to email what the Internet is to networking. The genesis of sendmail was Eric Allman’s Delivermail, which he wrote to connect ARPAnet email to numerous other networks’ email. As demands for routing more types of email were made of Delivermail, Allman rewrote it to be much more flexible and user-configurable, and sendmail was born. The ever-increasing flexibility acquired in the twenty-plus-year history of sendmail has come at the price of a complex interface.
Both Qmail and Postfix represent the strategy of performing the MTA mission with many smaller utilities, each of which carries out a narrow part of the MTA function rather than using one larger piece of software. Each has arguably resulted in a system with more straightforward configuration at the expense of a greater degree of process complexity. Both lay claim to being able to transit a bodacious number of messages using a ridiculously small amount of hardware. Which one you’re likely to prefer is probably one of those coffee or tea propositions where you’ll just have to try each and see which you like better.
We’ll go into more detail about MDAs and MUAs later, but let’s briefly touch on some of them.
As the agent that actually places the email in the user’s mailbox, the MDA is probably one of the most often used programs on your mail server. While a single MTA process could handle a large amount of mail bound for one site or a large number of messages from one process, each MDA process usually lives and dies for the processing of a single message.
Examples of MDAs include
/bin/mail
, /usr/lib/mail.local
, procmail
, and Cyrus deliver
. Each of these programs takes an RFC 822–formatted message on standard input and delivers it to a mailbox. In the case of procmail
, however, a mailbox could be local or remote, so procmail
is one of those examples that could be either an MDA, an MUA, or both, depending on the nuances of how it’s used.
As the frontend to the mail system, the MUA is the highest-profile element in the chain of elements between each Internet email sender and recipient. Ironically, the failure of the MTA or MDA has much greater impact than the failure of a single MUA.
PINE, Eudora, Microsoft Outlook, Netscape Messenger, and Mulberry are all MUAs. Additionally, even sendmail and imapd
can be considered MUAs. sendmail is frequently used as an MUA to generate messages programmatically. If you were to fire off a sendmail process as shown below, you would be running sendmail as an MTA. The following command starts sendmail running as a daemon and tells it to process the queue every 15 minutes:
%/usr/lib/sendmail -bd -q15m
If, however, you fired off a sendmail process as follows, you would be using sendsmail as an MUA:
%echo "Subject: Hey you!"|/usr/lib/sendmail -v kwmullet@yahoo.com
kwmullet@yahoo.com... Connecting to mx1.mail.yahoo.com. via esmtp... 220 mta220.mail.yahoo.com ESMTP >>>EHLO security.unt.edu
250-mta220.mail.yahoo.com 250-PIPELINING 250 8BITMIME >>>MAIL From:<kwm@security.unt.edu>
250 ok >>>RCPT To:<kwmullet@yahoo.com>
250 ok >>>DATA
354 go ahead dd >>>.
250 ok dirdel kwmullet@yahoo.com... Sent (ok dirdel) Closing connection to mx1.mail.yahoo.com. >>>QUIT
221 mta220.mail.yahoo.com %
In addition, each time you use your MUA to connect to an IMAP server, you create an IMAP process on the server exclusively to service the IMAP requests between your MUA and the mailstore. That process is also considered part of the MUA—a server-side MUA. To further distinguish between the server and the client side of the MUA, let’s refer to the client side as the MUA and the server side as the Mail Access Agent.
We’ll have plenty of details later about MUAs and MDAs. We won’t have so much information about MTAs, because they’re “SMTP plumbing” in the scope of this book.
Get Managing IMAP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.