[PLUG] Re: about sending mail.......

Rich Shepard rshepard at appl-ecosys.com
Tue Jul 16 18:45:33 UTC 2002


On Tue, 16 Jul 2002, Sandy Herring wrote:

> Sending and receiving mail is generally done by using a program designed for
> that purpose rather than directly invoking the system utilities (like
> sendmail) used as a foundation for a friendly user interface.

  This would make a very good topic for a HOWTO or, at least, a newbie
tutorial on the PLUG web site. Mail is a confusing topic for the newcomer
because there are 3-4 components (one of each must be present) and multiple
choices among each component. I'll start this HOWTO with a brief summary.

  Linux (and other unix-like systems) mail requires separate steps,
depending on whether the mail is coming in or going out. Let's start with
sending mail.

  The interface between you and the world of Internet mail (e-mail) is
called the Mail User Agent (MUA). The command line offerings include (but
are not limited to) pine, mutt, elm and mail. The GUI offerings include (but
are not limited to) sylpheed, netscape, mozilla, kmail and ... (I can't
think of more right now). The functions of the MUA are to allow you to read,
organize, store and compose mail messages. Most of 'em (many, anyhow) store
mail in /var/spool/mail/<your_username>; others store mail in ~/mail/.
Anyway, the MUA is what most users see as their e-mail "system". But, it's
only one part.

  When you compose a message in your MUA and want to send it out, the MUA
hands the message to the locally-installed Mail Transfer Agent (MTA),
unless, that's built into the MUA. Most linux installations include
'sendmail' as the MTA. Others available include postfix, elim, qmail and
smail. The function of the MTA is to determine (by looking at the message
header created by the MUA) whether the recipient is local or outside your
network (or single machine). In the latter case, it checks where to send it
(details skipped here) and ships it off. So, sending mail is the simpler of
the two processes.

  Incoming mail requires one or two additional components. If you do not run
your own mail server (whose address is publicly visible on the Internet),
especially if you dial into your ISP to collect mail waiting for you on
their server(s), you need a component that will fetch the mail for you. The
most common tool is called (quite logically), "fetchmail". Fetchmail will
use either of several mail protocols, the two most common (popular?) are the
Post Office Protocol, version 3 (POP3) and Internet Message Access Protocol
(IMAP). You can run fetchmail manually, from a cron job or as a background
daemon.

  Mail retrieved by fetchmail is transferred to your MTA for forwarding,
either externally or internally. If the message is intended for a local
recipient, the MTA passes the message to the Mail Delivery Agent (MDA);
procmail is the only one that occurs to me now. The MDA places the message
in the recipient's inbox or other message file based on recipes that control
how it processes incoming messages. This makes it useful as a spam filter,
too.

  In a nutshell (no trademark violation intended), that's linux mail. While
it's overwhelmingly confusing at first, when you understand the components
and how they work together then it all makes sense and is quite clear. In
concept if not in practice. :-)

HTH,

Rich






More information about the PLUG mailing list